Skip to main content

Mobile Multiplayer: Fixing Lag, Jitter and Desync

Diagnose mobile multiplayer latency, packet loss and desynchronisation with server ticks, prediction, interpolation and reconnect tests.

R
Written by Reiko

Movement that snaps backwards on one phone while remaining smooth on another needs a timeline comparison. The frame rate may be stable on both devices. The failure can come from delayed input, irregular network delivery, a server correction or incompatible simulation rules. Identifying which timeline diverged is more useful than treating every visible pause as “lag.”

Separate rendering, simulation and network timing

Rendering produces visible frames. The simulation advances game rules. Network updates carry selected information between participants. These rates need not match, and increasing one does not automatically improve the others.

For a hypothetical game, a server running at 20 ticks per second advances its simulation every 50 ms. A client rendering at 60 FPS presents frames roughly every 16.67 ms. Those extra frames require an appropriate visual representation between server updates; they do not create additional authoritative simulation steps.

Measurement

Meaning

Diagnostic value

Round-trip time, or RTT

Time for a request and its response to travel through the measured path

Estimates communication delay, including any processing included by the probe

Jitter

Variation in delivery timing

Explains uneven motion despite an acceptable average RTT

Packet loss

Packets missing under the measurement's definition

Reveals gaps, retransmissions or stale updates

Tick execution time

Server work needed for a simulation step

Shows whether the server can maintain its schedule

Do not assume the one-way delay equals exactly half the RTT. Uplink and downlink paths can differ. If an example assumes a symmetrical route, say so; otherwise the estimate can mislead hit-registration and reconnect analysis.

Decide which participant can confirm each action

In a server-authoritative design, the server validates important state changes. Clients can submit movement inputs and requested actions, while the server checks speed, cooldowns, ownership and other game rules. Sending “award a win” is less defensible than submitting the inputs from which the trusted simulation determines the result.

Unity's multiplayer guidance distinguishes responsiveness techniques from authority. Immediate visual feedback can hide some waiting, but it does not make the client a trustworthy source for damage or inventory changes. Select an authority model deliberately and document exceptions, such as a cosmetic selection that has no competitive effect.

Use prediction for local actions and interpolation for remote motion

Client-side prediction applies the local player's input before the server confirms it. When an authoritative update arrives, reconciliation compares it with the predicted history and corrects discrepancies. A practical implementation needs input sequence numbers and acknowledgement of which inputs the server has processed.

For example, the client may have produced inputs 101 through 108 when the server confirms the state after input 104. The client can restore that confirmed state and replay inputs 105 through 108 under its prediction model. If replay is inconsistent because physics or random choices differ, corrections will continue even on a good connection.

Interpolation usually presents remote objects using a buffered history of received states. If snapshots arrive every 50 ms, a chosen 100 ms buffer spans two snapshot intervals. That is an illustrative configuration, not a universal recommendation: a larger buffer can absorb irregular arrival while adding visible delay.

Extrapolation estimates motion beyond known states and can help briefly when an update is missing. Bound it. Continuing a stale velocity indefinitely can place a disconnected character through a wall. The fallback after the allowed horizon should be explicit and appropriate to the game.

Choose delivery behaviour for each message

Some messages describe durable events; others describe the latest state. An inventory transfer needs reliable, duplicate-safe processing. A movement update that has already been replaced by a newer one may have no value if delivered much later.

Inspect what the selected transport guarantees about reliability, ordering, fragmentation and congestion. Sending all traffic through one ordered stream can allow an earlier missing message to delay later ones. Unreliable delivery also requires intentional handling of missing and reordered updates; switching transport does not remove application-level design work.

Use sequence numbers to reject stale state and separate a command's identity from its packet's identity. A retransmitted command must not become a second attack or item use simply because it arrived in another packet.

Calculate bandwidth with a defined payload

Suppose one illustrative snapshot is 120 bytes per player and is sent 20 times per second. That is 2,400 bytes per second per player stream. Sending eight such streams to one client requires 19,200 bytes per second, or 153.6 kilobits per second, before transport headers, encryption, acknowledgements and other messages.

The calculation describes a specific payload model, not a measured requirement for an eight-player game. Real replication may include only nearby entities, use delta compression or batch messages. Measure bytes at a consistent layer and record whether your counter includes protocol overhead.

Interest management reduces which entities a client receives. Test boundaries carefully: entering a new area must supply the complete state needed to construct an object before applying subsequent changes. A missed baseline can resemble random desynchronisation.

Keep hit detection on a defined timeline

Lag compensation may evaluate an action against a bounded history of authoritative states. Define what time the action refers to and how much history the server will consider. Accepting an arbitrary client timestamp would let a modified client request an implausibly old view of the match.

For a storage example, a history of 40 snapshots for 32 players, with 64 bytes of recorded state per player per snapshot, contains 81,920 bytes of payload, or 80 KiB. This excludes indexes, object overhead and non-player entities. The numbers illustrate why the retained fields and history length matter.

Test fairness as well as memory. A shot accepted against an earlier position can appear to hit after the target has moved behind cover. Explain the chosen rules to the design team and compare both players' views with the server record before classifying the result as a defect.

Make reconnection a state transition

A mobile client can lose its route while switching networks or be suspended when the player changes apps. Retain a server-side session policy that defines whether a player may rejoin, how long a slot remains reserved and what happens to their character meanwhile. Those values are product decisions, not fixed platform timeouts.

On reconnect, verify the session, match identifier and current protocol compatibility. Load an authoritative baseline before accepting new inputs. Associate queued work with the original match so a delayed command cannot affect a later game.

Never trust a client assertion that a match ended in victory while it was disconnected. Reconcile rewards against the match service's recorded outcome. If the match no longer exists, explain the result rather than leaving the interface on an endless reconnect animation.

Reproduce network problems under controlled conditions

  1. Capture a baseline without artificially introduced impairment.

  2. Add latency alone and measure input-to-confirmation behaviour.

  3. Add jitter, packet loss and reordering separately before combining them.

  4. Disconnect during a critical action, then reconnect to the same match.

  5. Repeat with mixed supported client versions and a loaded server.

A sample test set might use 40, 120 and 250 ms RTT with 0%, 1% and 3% introduced packet loss. These are selected test conditions, not network-quality categories or promised tolerances. Record the impairment tool and distribution: constant delay differs from short bursts of loss.

Keep evidence of the correction, not just a ping value

Correlate client build, match ID, input sequence, server tick and correction distance. Compare the frequency and size of corrections with RTT, loss and server tick overruns. If corrections rise after a physics update while connection metrics stay unchanged, investigate simulation compatibility.

Define success around the genre. A turn-based game and a competitive action game have different timing needs. The release decision should show that the chosen authority, buffering and recovery policies preserve understandable play across the supported conditions, with rewards issued only from a confirmed result.

Did this answer your question?