Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stardew Valley: Replace current naive entrance rando with GER #4624

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Jouramie
Copy link
Contributor

@Jouramie Jouramie commented Feb 8, 2025

What is this fixing or adding?

This replaces the current naive implementation of entrance randomization we did with the GER. This also splits the region module in multiple files. I'm submitting the refactor before adding the new features (everything entrance rando) to make is easier to review.

Ginger islands regions and connection have been split from the rest of vanilla/SVE regions. Now, they will not be created if ginger island is excluded, just like mods regions, no longer need to remove them.

The randomization flag mechanism has been modified so we can know if a connection is eligible with on single in between the flag of the connection and the flag calculated from the player options. Instead of adding a flag on connections that need to be excluded when masteries are not randomized, all connections have the flag enabled (meaning that they can be randomized when masteries are excluded). The flag is removed on connections that are excluded when masteries are excluded.

I removed a lot of the tests that were generating worlds, since most of the code is now unit tested. Even tho there are new tests, since those do not generate worlds and only test the methods they aim tho, this should improve tests speed. I also moved the tests validating the mod regions with the rest of the region tests. This seemed like the right place to avoid changing multiple files from multiple modules when touching the region system.

How was this tested?

  • Added some unit tests on the modified flag system and the integration with GER
  • Made sure the existing entrance randomization still pass (before deleting most of them, lol)
  • Tested a couple of generation with and without item plando and validated the spoilers
  • python ap-roller.py --limit 2 --slots 1 --spoiler 0 --repeat 1 --seeds "1-1000" "#4624" with the following yamls
    • allsanity (buildings ER by default)
    • allsanity + all mods + buildings ER
    • medium (non progression ER by default)
    • medium + buildings ER
    • medium + chaos ER
    • medium + ginger island excluded + no progression ER
    • medium + ginger island excluded + buildings ER
    • medium + pelican town ER

If this makes graphical changes, please attach screenshots.

N/A

@Jouramie Jouramie changed the title Stardew valley/ger integration Stardew Valley: Replace current dummy entrance rando with GER Feb 8, 2025
Comment on lines -41 to -42
ConnectionData(DeepWoodsEntrance.deep_woods_house, DeepWoodsRegion.abandoned_home,
flag=RandomizationFlag.NON_PROGRESSION),
Copy link
Contributor Author

@Jouramie Jouramie Feb 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found out that this connection had the wrong flags with the new tests. It requires access to the secret woods, which is not accessible with an empty inventory. This could soft lock the seed if something important rolled in there.

connection_in_randomized = connection.name in randomized_connections
reverse_in_randomized = connection.reverse in randomized_connections
self.assertTrue(connection_in_randomized, f"Connection {connection.name} should be randomized but it is not in the output.")
self.assertTrue(reverse_in_randomized, f"Connection {connection.reverse} should be randomized but it is not in the output.")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely remove this test, which was just validating that the output of ER for the mod gives swaps in both directions. (unless I'm missing something?) All functions used for our GER integration are now properly unit tested, so this test seems highly unnecessary.


for connection in vanilla_connections:
if flag in connection.flag:
if RandomizationFlag.GINGER_ISLAND in connection.flag:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entrance randomization for ginger island now use the same mechanism used for mods (based on content packs), so testing it separately seems highly unnecessary.

@Jouramie Jouramie changed the title Stardew Valley: Replace current dummy entrance rando with GER Stardew Valley: Replace current naive entrance rando with GER Feb 9, 2025
@Jouramie Jouramie marked this pull request as ready for review February 9, 2025 20:35
@agilbert1412 agilbert1412 added is: enhancement Issues requesting new features or pull requests implementing new features. waiting-on: world-maintainer Issue/PR is waiting for feedback or approval by the maintainer of a world. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Feb 10, 2025
@agilbert1412 agilbert1412 self-requested a review February 10, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: enhancement Issues requesting new features or pull requests implementing new features. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. waiting-on: world-maintainer Issue/PR is waiting for feedback or approval by the maintainer of a world.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants