Spielerando

Allow undoing a purchase only while it cannot break later prices

Players misclick, and an undo button for builds feels kind. But if the price of the next barracks depends on how many you own, undoing an old one changes what the later ones should have cost. This entry keeps a ledger of what was really paid and allows only safe steps back.

Why this works

Later prices were built on top of earlier purchases. Taking back the newest one leaves everything else exactly as it was, while pulling one out of the middle would make every price after it wrong, so only the safe step back is offered.

When not to use it

Don't offer it when a purchase has already set something in motion, such as a building that produced goods, or when the player is meant to live with their choices. There, ask for confirmation before buying instead of allowing a reversal.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 4 common mistakes and the fix
  • 21 lines of example code with 3 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Allow undoing a purchase only while it cannot break later prices" (read_entry undo-purchase-only-latest-this-turn) 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