Spielerando

Roll quest progress back when the player undoes a move

A player undoes a move and the quest still shows the gems or the combo that move earned, or the reward fires and then the move is gone. Here is why subtracting is not enough, what to store per move, and when a quest may really be called complete.

Why this works

Some counts only grow and some keep a best value, and a best value cannot be walked backwards because the old best is gone. Saving the whole picture before each move makes taking it back exact for both, and paying out only at the end avoids rewards for moves that later vanish.

When not to use it

Skip it when undo does not exist or costs something that should stay spent, like a paid take-back. Then the quest should keep its progress as the price of the move, so do not roll it back.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 4 common mistakes and the fix
  • A diagram of every state
  • 24 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 "Roll quest progress back when the player undoes a move" (read_entry undo-takes-back-quest-progress-too) 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