Spielerando

Playing on phone and computer gives two different saves and one overwrites the other

When the same player continues on a second device, someone has to decide whose progress survives. Taking the newer file loses work, and adding numbers together invents money. Here is a merge that keeps what both sides did.

Why this works

Two devices can both be right about different things. Treating a single value and a growing collection differently, and making the merge give the same answer in either order, lets both devices end up in the same place.

When not to use it

Skip it when only one device plays at a time, or the server is the single truth. Then ask which save is newer and let the player pick, instead of building rules for a conflict that cannot happen.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 29 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 "Playing on phone and computer gives two different saves and one overwrites the other" (read_entry merge-saves-from-two-devices) 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