Undo in my city builder brings back the wrong building, or none at all
Undo only works if every action remembers what it destroyed. This entry gives your AI an undo and redo history for tile edits that restores exactly what stood there, drops the redo path when you do something new, and keeps memory in check.
Why this works
Undo must not run the action backwards; it must put back what the action replaced, as recorded when it ran. Recording the old content at that moment is the only way to restore it exactly, even after many edits.
When not to use it
Skip a history for actions that cost money or time and cannot be reversed in the game's world, such as a bought item. Offer a confirmation instead.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 48 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 "Undo in my city builder brings back the wrong building, or none at all" (read_entry strategy-undo-brings-back-the-wrong-building) 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