Check that a single-use key cannot lock the player out of the game
If a key is used up and there are two doors, the player may spend it on the wrong one and have no way to finish, without any warning. This entry shows how to test every order of moves for such a trap before a player finds it.
Why this works
Whether a player is stuck depends not on the room alone but on what they hold and what they have already used. So you must look at every combination of place and belongings, and any reachable combination from which the goal cannot be reached is a trap.
When not to use it
Skip it when levels are large with many items, since the number of combinations grows too fast to check, or when the game always lets the player go back and take things again. Check small parts separately or add a way to reset.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 52 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Check that a single-use key cannot lock the player out of the game" (read_entry one-key-two-doors-softlock-search) 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