PolyTowerz logoPolyTowerz
Devlog banner for PolyTowerz: Devlog 8: when two phones disagree, and the tool that says where
General
Sep 24, 2026

Devlog 8: when two phones disagree, and the tool that says where

Last devlog ended with a promise: what the game does when the two devices disagree anyway. Here is the honest version.

Once a second, both phones hash their entire game state and send the number to the server. The server compares the two. If they match, fine. If they do not, it ends the match on the spot, because a co-op run where each player sees a different game is worse than no run at all.

That check has one big weakness. It can tell you THAT the phones disagree. It cannot tell you where. Two hashes are either equal or they are not.

So each phone now keeps a short history of smaller hashes, one per part of the game: enemies, towers, credits and so on. When the server ends a run for a mismatch, both phones write that history to a file, and a small script lines the two files up and names the first tick and the first field that moved.

A tool like that is worthless until you have seen it catch something on purpose. So I built one phone with a single extra hit point on every enemy and left the other one alone. The script pointed at the enemy hash, from the exact tick the first enemy spawned, and at nothing else. That was the moment I started trusting it.

Then a real desync happened, about two minutes into a run. I have a suspect: a testing switch of my own that throws away one percent of network messages to simulate a bad connection. It explains everything I measured. It is not proven yet, and I am not calling it solved until a run with that switch off stays clean.

One thing I learned the embarrassing way: my replay tool records every finished run so I can play it back. A run that ends in a desync was not counted as finished. So the one run I most wanted to replay was the one run that was never saved. It is not fixed yet. It is next on the list.

Next devlog: whether it survives a run with the switch turned off.

Discussion