Spielerando

Check the light lasts for the route, with batteries found on the way

In a dark house where light runs out, the player must always have at least one way through. This entry computes the best battery left at the exit over all routes, including detours to pick things up once, and shows when the amount is only enough by luck.

Why this works

A limited resource is fair only if some route through the level lets it last. Because each pickup works once and cannot hold more than the cap, the order of the route matters, so the check must follow the order and not only add up the totals.

When not to use it

Wrong when running out of light is meant to be a real failure the player can cause, or when the game gives unlimited light and tension comes from elsewhere. Then check only that the player can recover, such as a way back to a charger.

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
  • 35 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 the light lasts for the route, with batteries found on the way" (read_entry flashlight-battery-must-last-the-route) 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