Spielerando

Some players lose their whole save when the phone kills the app while saving

A phone can end a game at any moment, including the instant it is writing the save. The file is then half written and the next start finds nothing usable. This entry keeps two copies and picks the good one, so at worst a player loses the last few moves.

Why this works

A write that is cut off can only damage the copy being written. Alternating between two copies and trusting only one whose check number matches means the other one always survives.

When not to use it

Skip it when a server holds the save and the phone only caches it, since the server copy is the safety net there.

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
  • 36 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 "Some players lose their whole save when the phone kills the app while saving" (read_entry save-corrupted-when-app-is-closed-mid-write) 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