Skip to content

feat: static key logic algorithm for vanilla dungeons (OverworldShuffle) - #7

Closed
CVW-HMB wants to merge 1 commit into
OverworldShufflefrom
feat/static-key-logic-owr
Closed

CVW-HMB wants to merge 1 commit into
OverworldShufflefrom
feat/static-key-logic-owr

Conversation

@CVW-HMB

@CVW-HMB CVW-HMB commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Adds key_logic_algorithm: static: ER's hand-written key rules for the vanilla dungeon layouts, counting chest keys only as its has_key does. It needs vanilla doors and unshuffled key drops and key pots; entrance shuffle and overworld shuffle are allowed, and Turtle Rock picks the same front / front+middle / back / big chest cases as ER's set_trock_key_rules from which portals are reachable without its own keys.

source/dungeon/StaticKeyLogic.py holds a door table applied at the end of link_doors through KeyDoorShuffle.apply_key_rule_specs, plus set_static_key_rules inside set_rules for the rules a door number cannot carry: open-mode Boomerang and Zelda's chests, the GT randomizer, compass and firesnake chest rules with their big-key-in-room alternatives, the Kholdstare Somaria alternative, and the forbids and always-allows on Desert, Hera, PoD, Thieves, Skull Woods, Turtle Rock and the GT map chest. The door evaluators use has_sm_key_strict when a dungeon's key logic counts chest keys. Door rando's key placement validator still runs on top.

Port of the static parts of CVW-HMB/ALttPDoorRandomizer PRs #3, #4 and #6 (DoorDevUnstable) onto codemann8's OverworldShuffle. Differences from that branch: bigkeyshuffle is a choice here, so the big chest case checks == 'none'; the customizer key_logic section and its validation are not included, so apply_key_rule_specs carries only what the static table needs. test/TestBase.py gains a build_vanilla_world that follows Main.main up to set_rules for the tests.

Verification against DoorDevUnstable

  • Door rules dumped from a vanilla world under static (120 doors: number, worst case, big key and small key alternates, allow-small locations, pairing) are byte-identical in open, standard and inverted mode.
  • Per-chest scenario tables (minimum external chest keys for every location, for every small key and big key placement, with and without Hookshot / Somaria): open 3929 of 3929 pairs match, inverted 3929 of 3929. Standard differs in 299 pairs, all in three places where the OverworldShuffle world model itself differs from DoorDev in standard mode and identically so under partial logic: the light world needs one Hyrule Castle chest key to escape, Turtle Rock's lobby ledge is reachable without Somaria, and Kholdstare with one key without Somaria.
  • Item requirement probe (every location's required items and minimum keys, vanilla open world): static output identical between the two branches on all 123 rows the probe lists on both (the other 10 DoorDev rows are event locations this branch's probe does not list); partial output is identical between the branches too. Against partial on this branch the same 22 rows lose requirements as on DoorDevUnstable (25 there; Ice Block Drop, Trench 2 Switch and Agahnim 2 are the event rows missing here): Zelda's Chest no longer needs the Lamp, Desert Compass and Big Key Chest lose Power Glove, Swamp West / Big Key Chest / Trench 2 lose Hookshot, Ice Block Drop 2 keys to 1, Ganon's Tower loses its hidden Bow / Hammer / Somaria / Fire Rod requirements and its bottom section drops from 4 keys to 3.
  • Crosskeys seeds (--shuffle crossed --keyshuffle wild --bigkeyshuffle wild --mapshuffle wild --compassshuffle wild --accessibility locations --key_logic_algorithm static, Skull Woods key preset in the Pinball Room): 60 seeds each, 2001 to 2060: DoorDevUnstable generated 60 of 60, this branch 58 of 60; the two failures (2035, 2054) are Cannot beat game and fail identically under partial, so they are not from this change. No ER small key or big key forbid violated in any generated spoiler.
  • python -m pytest test/TestStaticKeyLogic.py: 9 passed. The pre-existing test/vanilla modules do not import on this branch (get_dungeon_item_pool moved out of Dungeons), unchanged here.

Adds key_logic_algorithm 'static': ER's hand-written key rules for the
vanilla dungeon layouts, counting chest keys only as its has_key does.
Needs vanilla doors and unshuffled key drops and key pots; entrance and
overworld shuffle are allowed, and Turtle Rock picks its front, middle,
back or big chest case from which portals are reachable.

source/dungeon/StaticKeyLogic.py holds the door table, applied at the end
of link_doors through KeyDoorShuffle.apply_key_rule_specs, and
set_static_key_rules inside set_rules for what a door number cannot carry:
open-mode Boomerang and Zelda's chests, the GT randomizer, compass and
firesnake chest rules with their big-key-in-room alternatives, the
Kholdstare Somaria alternative, and the forbids and always-allows on
Desert, Hera, PoD, Thieves, Skull Woods, Turtle Rock and the GT map chest.
The door evaluators use has_sm_key_strict when a dungeon's key logic
counts chest keys. Door rando's key placement validator still runs on top.

Ported from CVW-HMB/ALttPDoorRandomizer DoorDevUnstable (the static parts
of PRs 3, 4 and 6). Door rules and the per-chest scenario tables match
that branch exactly in open and inverted mode; test/TestBase.py gains a
build_vanilla_world for the tests.
@CVW-HMB
CVW-HMB force-pushed the feat/static-key-logic-owr branch from 7b39bdb to d518a82 Compare September 10, 2026 19:09
@CVW-HMB

CVW-HMB commented Sep 12, 2026

Copy link
Copy Markdown
Owner Author

Moved to CVW-HMB/ALttPDoorRandomizer-OWR#1; this repo is the DoorDev fork.

@CVW-HMB CVW-HMB closed this Sep 12, 2026
@CVW-HMB
CVW-HMB deleted the feat/static-key-logic-owr branch September 12, 2026 01:00
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.

1 participant