Skip to content

The Lake Hylia gate no longer opens by itself with dungeon rando - #145

Merged
OruizGl merged 1 commit into
ootrando:nightlyfrom
deanrather:pr/er-lake-gate
Nov 26, 2026
Merged

OruizGl merged 1 commit into
ootrando:nightlyfrom
deanrather:pr/er-lake-gate

Conversation

@deanrather

Copy link
Copy Markdown
Contributor

With "Shuffle Dungeon Entrances" on and the Water Temple behind another dungeon's door, entering the temple there opened the gate at the bottom of Lake Hylia on the next visit, without the hookshot switch, giving a free way into whatever dungeon sits behind that gate. The gate now stays shut until its switch is hit.

Cause

The gate (Obj_LakeHrl_SwitchShutter_A_01) is driven by Logic/HyruleField_LakeHylia_Common_Prefab_6a9d.logic.module.ainb, run by both ages' Hyrule Field maps. Its OR opens the gate on HavePlayedEvent.Dm_WaterTemple_0000 or directly on the Water Sage quest (SageOfWater) being past Step05, and the same quest check also writes the flag (element 16). The Water Temple's door carries SageOfWater_Arrival_WaterTemple, which moves the quest to Step06, and the shuffle moves that event with the dungeon. In the vanilla game the temple can only be entered through the gate, so neither path shows. With the temple moved, entering it opens the gate.

Change

randomizer/core/src/entr/lake.rs, called from entr::story::stage. Only when the seed's layout moves the Water Temple away from its own spot, the lake module is rewritten in two places: element 16's drive input becomes constant false, and the gate OR's multi-input entry that read the quest step reads the flag instead. Nothing then reads the quest step. The gate opens only on the flag, which only the switch's scene sets, as in the vanilla game. The switch, the scene request and the pillar are untouched, and the Water Sage quest still moves to Step06 when the temple is entered. The game's logic already requires the Hookshot for the Water Temple spot.

entr.rs, entr/build.rs, entr/story.rs: the module declaration, one build-report line and the call. With shuffle_entrances off the stage returns before reading anything. With the Water Temple in place nothing is staged.

Checked

  • Regression tests in lake.rs (game files): the unfixed module has 2 readers of the quest check, the patched one 0. Only the two edits differ. The scene request is AND(NOT flag, switch OnState) before and after. With only the first edit, 2 of the 5 lake tests fail.
  • cargo test --workspace: 2433 passed, 0 failed, 13 ignored.
  • Default output byte-identical to nightly 240af8b: shuffle off 295 files identical. Dungeons shuffled with the Water Temple in place: 298 identical. With it moved, only the lake module differs.
  • In the game (scripted, same seed, fixed build and an unfixed control): entering the Water Temple by the Sacred Forest Meadow door leaves the flag 0 and the gate shut (the control opens it). Hookshotting the switch above the gate on the fixed build plays Dm_WaterTemple_0000, sets the flag and opens the gate, which stays open after a map reload and after a save reload.

…are shuffled

With "Shuffle Dungeon Entrances" on and the Water Temple behind another dungeon's door, entering the temple there opened the gate at the bottom of Lake Hylia on the next visit, without the hookshot switch, giving a free way into whatever dungeon sits behind that gate. The gate now stays shut until its switch is hit.

## Cause

The gate (`Obj_LakeHrl_SwitchShutter_A_01`) is driven by `Logic/HyruleField_LakeHylia_Common_Prefab_6a9d.logic.module.ainb`, run by both ages' Hyrule Field maps. Its OR opens the gate on `HavePlayedEvent.Dm_WaterTemple_0000` or directly on the Water Sage quest (`SageOfWater`) being past Step05, and the same quest check also writes the flag (element 16). The Water Temple's door carries `SageOfWater_Arrival_WaterTemple`, which moves the quest to Step06, and the shuffle moves that event with the dungeon. In the vanilla game the temple can only be entered through the gate, so neither path shows. With the temple moved, entering it opens the gate.

## Change

`randomizer/core/src/entr/lake.rs`, called from `entr::story::stage`. Only when the seed's layout moves the Water Temple away from its own spot, the lake module is rewritten in two places: element 16's drive input becomes constant false, and the gate OR's multi-input entry that read the quest step reads the flag instead. Nothing then reads the quest step. The gate opens only on the flag, which only the switch's scene sets, as in the vanilla game. The switch, the scene request and the pillar are untouched, and the Water Sage quest still moves to Step06 when the temple is entered. The game's logic already requires the Hookshot for the Water Temple spot.

`entr.rs`, `entr/build.rs`, `entr/story.rs`: the module declaration, one build-report line and the call. With `shuffle_entrances` off the stage returns before reading anything. With the Water Temple in place nothing is staged.

## Checked

- Regression tests in `lake.rs` (game files): the unfixed module has 2 readers of the quest check, the patched one 0. Only the two edits differ. The scene request is `AND(NOT flag, switch OnState)` before and after. With only the first edit, 2 of the 5 lake tests fail.
- `cargo test --workspace`: 2433 passed, 0 failed, 13 ignored.
- Default output byte-identical to nightly 240af8b: shuffle off 295 files identical. Dungeons shuffled with the Water Temple in place: 298 identical. With it moved, only the lake module differs.
- In the game (scripted, same seed, fixed build and an unfixed control): entering the Water Temple by the Sacred Forest Meadow door leaves the flag 0 and the gate shut (the control opens it). Hookshotting the switch above the gate on the fixed build plays `Dm_WaterTemple_0000`, sets the flag and opens the gate, which stays open after a map reload and after a save reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OruizGl
OruizGl merged commit 52db1a1 into ootrando:nightly Nov 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants