Skip to content

Commit

Permalink
Merge branch 'decoupled-boss-savewarps-fix' into dev-fenhl
Browse files Browse the repository at this point in the history
  • Loading branch information
fenhl committed Jun 13, 2024
2 parents f251336 + 7e72384 commit 1f36c6b
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 3 deletions.
2 changes: 1 addition & 1 deletion EntranceShuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def shuffle_random_entrances(worlds: list[World]) -> None:
for pool_type, entrance_pool in entrance_pools.items():
for entrance in entrance_pool:
target = (entrance.replaces or entrance).reverse
if not target or target.type not in ('ChildBoss', 'AdultBoss'):
if not entrance.primary or not target or target.type not in ('ChildBoss', 'AdultBoss'):
continue
savewarp = target.parent_region.savewarp
if not savewarp:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is a randomizer for _The Legend of Zelda: Ocarina of Time_ for the Nintendo
When asking questions or reporting issues in the main Randomizer Discord, please make sure to include the full version number in the `A.B.C Fenhl-D` format — that last part is important!
You can also [open an issue](https://github.com/fenhl/OoT-Randomizer/issues/new) on this fork or contact me directly on Discord (`@fenhl`) for any help, report or request.

This branch is available to use online at <https://ootrandomizer.com/generatorDev?version=devFenhl_> (may be outdated).
This branch is available to use online at <https://ootrandomizer.com/generatorDev?version=devFenhl_>.

This branch (`dev-fenhl`) is based on [Roman971](https://github.com/Roman971)'s branch ([`Dev-R`](https://github.com/Roman971/OoT-Randomizer)) which is in turn based on the main [`Dev`](https://github.com/OoTRandomizer/OoT-Randomizer) branch.

Expand Down
48 changes: 48 additions & 0 deletions Unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,54 @@ def test_spawn_point_invalid_areas(self):
with self.assertRaises(EntranceShuffleError):
build_world_graphs(world_settings)

@unittest.skip("test usually fails during entrance shuffling, but keep this for documentation")
def test_decoupled_boss_shuffle(self):
# Note that this test will frequently fail to shuffle all entrances.
# This is a side effect of the settings combo and not related to the
# goal of this test. Failure does not mean anything broke, which
# makes this test less useful but still has a place for documentation.
#
# Savewarps in boss rooms are set during entrance shuffle, while
# all other savewarps are set immediately after region file parsing
# and kept static. Boss room savewarps are identified by filtering
# shuffled entrance pools for ChildBoss and AdultBoss types. In
# decoupled, the entrance pools need to filter for only forward/primary
# entrances to avoid catching the savewarp on the dungeon side of the
# boss door and modifying it. This test ensures that all dungeon-side
# savewarps remain pointing to their vanilla regions. While possible
# for modified savewarps to be set to all of their vanilla regions, it
# is unlikely enough that this check should provide confidence nothing
# is being touched that shouldn't be.
filenames = [
"decoupled_boss_shuffle.sav",
]
boss_door_savewarps = [
"Deku Tree Before Boss -> Deku Tree Lobby",
"Dodongos Cavern Before Boss -> Dodongos Cavern Beginning",
"Jabu Jabus Belly Before Boss -> Jabu Jabus Belly Beginning",
"Forest Temple Before Boss -> Forest Temple Lobby",
"Fire Temple Before Boss -> Fire Temple Lower",
"Water Temple Before Boss -> Water Temple Lobby",
"Shadow Temple Before Boss -> Shadow Temple Entryway",
"Spirit Temple Before Boss -> Spirit Temple Lobby",
]
for filename in filenames:
with self.subTest(filename):
# Work around normal test loading system to avoid disturbing the seed
sfile = os.path.join(test_dir, 'plando', filename)
basename = os.path.splitext(filename)[0]
with open(sfile) as f:
j = json.load(f)
base_settings = make_settings_for_test(j, seed='UWR8ZEKTU7', outfilename=basename)
_, world_settings = resolve_settings(base_settings)
# Known working seed values hardcoded to avoid issues with version/setting changes
world_settings[0].seed = 'UWR8ZEKTU7'
world_settings[0].numeric_seed = 24225027679129157771418409769358900835786779545219061240209643832751186884349
worlds = build_world_graphs(world_settings)
for savewarp_name in boss_door_savewarps:
savewarp = worlds[0].get_entrance(savewarp_name)
self.assertEqual(savewarp.connected_region.name, savewarp.name.split(' -> ')[1])


class TestValidSpoilers(unittest.TestCase):
# Normalizes spoiler dict for single world or multiple worlds
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__version__ = '8.1.45'

# This is a supplemental version number for branches based off of main dev.
supplementary_version = 2
supplementary_version = 3

# Pick a unique identifier byte for your fork if you are intending to have a long-lasting branch.
# This will be 0x00 for main releases and 0x01 for main dev.
Expand Down

0 comments on commit 1f36c6b

Please sign in to comment.