← All interactive demos

Build a dungeon with no dead-end routes

On the room map, tap chests to add keys (cycling back after 4), and tap doors to toggle locks. Count every route to try all door-opening orders and count successful paths (green) and dead ends (red). The display also shows dead-end doors (no keys beyond them) and spare keys (keys left after taking the direct route).

—

Example layouts

Try this

Keep both treasure-room doors locked and reduce red dead-end routes to zero. What is the fewest keys needed? Their locations matter too. Share your layout in the video comments.

How it works

The adventurer repeatedly collects keys in reachable rooms, then opens one reachable locked door. Multiple available doors create branches. Track two quantities: dead-end doors (opening one consumes a key without returning a key) and spare keys (keys left after taking the direct route). More dead-end doors than spare keys creates routes that get stuck. Two fixes are possible: unlock side-room doors to remove all dead-end doors (only one reachable locked door remains at a time, eliminating the choice), or put keys beyond dead-end doors so the spent key is returned. Too many extra keys remove the need to think about door choices.

This original model references Zelda Wiki and dungeon analyses: Game Maker's Toolkit's Boss Keys and VG Thought's Forest Temple. It is not a design document for Ocarina of Time. No game footage or official characters are used.

Video: How Games Are Made