Quick answer: Your multiplayer game desyncs because players' copies of the game state diverge. The cause depends on your model: in deterministic lockstep, any non-determinism (floating-point differences, unordered iteration, uninitialized values) causes drift; in state-replication, it's missed/out-of-order updates or clients diverging with no authority to correct them. The result is players seeing different things.
Desync is one of the hardest multiplayer bugs: players' games drift apart until they're effectively playing different games. It stems from the fundamental challenge of keeping multiple machines' simulations in agreement, and the cause depends on your networking model.
Why Desync Happens
Multiplayer keeps multiple machines' states in sync, and desync is those states diverging. In deterministic lockstep (clients simulate in step from shared inputs), any non-determinism causes desync, if the same inputs produce different results on different machines (floating-point differences across platforms, unordered iteration, uninitialized values, anything not perfectly deterministic), the simulations drift apart. In state-replication/authoritative models, desync comes from missed or out-of-order updates (a client missing a state update diverges) or from clients diverging with no authority to correct them.
The common theme: something caused two machines to hold different state, and without correction the divergence compounds. Identifying whether you have a determinism problem (lockstep) or a state-reconciliation problem (replication) is the first step.
How to Diagnose and Fix It
Detect desync with a checksum: periodically hash the game state on each machine and compare; when checksums diverge, you've detected a desync and know roughly when it started, which narrows the cause. Capture desync occurrences with context (what preceded them, which players/platforms), since correlation with an action or platform points at the cause. Bugnet captures reports and context, so desync incidents and patterns surface.
Fix by model: for lockstep, enforce determinism rigorously (deterministic math and iteration order, initialize everything, no platform-specific behavior in the simulation); for authoritative/replication, make the server the source of truth clients defer to and ensure updates are reliable and ordered. Add checksums as standing detection. See our guide on fixing multiplayer desync.
Desync is players' states drifting apart, from non-determinism (lockstep) or missed updates with no authority (replication). Use checksums to detect it, then enforce determinism or an authoritative server.