Place dungeon keys so a run can never get stuck behind a door
Hiding keys in random rooms sounds fine until one lands behind the very door it opens, and the run can no longer be finished. This entry places each key only where the player can already get to, proves that the end is reachable, and shows how the naive version fails.
Why this works
A level is only fair if it can be finished. Placing each key only where the player can already walk, given the keys placed before it, makes the end reachable by construction, instead of hoping that random choices happen to work.
When not to use it
Don't build levels this way when the map is handmade and every key has a meant place, or when backtracking through a hidden shortcut is part of the design. Place keys by hand, and run the same reachability check as a test.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 36 lines of example code with 3 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Place dungeon keys so a run can never get stuck behind a door" (read_entry keys-are-never-placed-behind-their-own-doors) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP