Spielerando

Find the door a limited key must not be spent on

Keys open doors and are used up, and the way to the final room needs one more than the player may have left. If a key goes into the wrong door early, the story can no longer be finished, and nobody notices for an hour. Here is how your AI finds the first such mistake and the route to it.

Why this works

When something is used up, a position is not only where you stand but also what you have left and what you have opened. A trap is any place you can reach from which the goal is out of reach. Trying every order of spending, and checking backwards from the goal, finds it.

When not to use it

Skip it when keys can be bought again, found without limit or are never used up, because then nothing can be wasted. Also not needed in a small area where the player can simply walk back and try another door.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • A diagram of every state
  • 71 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 door a limited key must not be spent on" (read_entry keys-spent-on-wrong-door-softlock) 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