Do not lose the whole world when the game closes in the middle of saving
A power cut or a closed browser tab during a save can leave a file that is cut off, and the player's whole world is gone. This entry gives the AI a way to keep two copies and always load the newest one that is still whole.
Why this works
Writing is the dangerous moment, so never let it touch the only good copy. With two places that take turns, a break can ruin only the one being written, and a fingerprint of the text tells a whole copy from a cut-off one.
When not to use it
It protects against accidents, not against a player who edits or copies files on purpose, and it cannot help when both copies are lost together, as when the device itself fails. For worlds that matter a lot, also offer an export or a cloud copy.
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
- 37 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 "Do not lose the whole world when the game closes in the middle of saving" (read_entry save-half-written-backup-pick) 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