Spielerando

Find the order of actions in which a one-use key makes the game unwinnable

If a key is used up by the door it opens, a player can spend it on the wrong door and later stand in front of the only way forward with nothing in their hand. This entry shows how to try every order of moves and return the exact steps that lead to such a dead end.

Why this works

Whether a game can still be won depends on the whole situation: where you stand, what you hold and what is already spent. Looking at each door alone misses this, so you must try the orders of moves and ask from every reachable situation whether the goal is still open.

When not to use it

The number of situations grows very fast with more keys, doors and other changeable things, so this is for small levels or parts of one. For a big world, cut it into sections, or simply let the player buy or find a spare key.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 68 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 "Find the order of actions in which a one-use key makes the game unwinnable" (read_entry one-use-key-wasted-on-wrong-door) 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