한국어English日本語简体中文繁體中文DeutschไทยTiếng ViệtРусскийPortuguês (Brasil)EspañolBahasa Indonesia

Game Lag White Paper › L1 Client game process

Clock sync error Clock sync error

Cause ID cg-clock · Primary owner Game team (Client development)

Open the interactive card with figures and simulations →

If the client’s estimate of the server time is wrong, interpolation timing and cooldown checks drift out of step with the server.

Why The client syncs to server time only once when connecting and never adjusts as ping changes → Effect The point to interpolate to and the time a cooldown ends drift away from the server’s → On screen Opponents occasionally hitch; skills get rejected even after the cooldown has ended

Symptoms
Stutter, Dropped action / rollback
Factors
Latency
Who’s affected
Just me
When
The longer it runs, Randomly
Owner
Primary owner Game team (Client development)
Game team action items
Sync time periodically (measure round-trip time and correct), adjust gradually with no sudden jumps, switch elapsed-time measurement from the PC’s clock to a monotonic clock.
On the graph
Slow climb · Error in the estimated server time
Where to look
Periodically log the difference between the client’s estimated server time and the server time (tick number) the server puts in its packets
Confirmed if
The error grows the longer the session runs, or jumps all at once when the PC clock gets corrected, and reports of rejected skills and hitches rise around then
Ruled out if
Error stays small but skills still get rejected: points to server-side validation or latency
Check with
Game server or client logs and metrics
Learn more
If elapsed time is measured with the PC’s date and time (wall clock), game time jumps the moment Windows corrects the clock against internet time or the user changes the clock. Measure elapsed time with a monotonic clock, which never goes backward (Stopwatch and so on).

Sources

  1. RFC 5905: Network Time Protocol Version 4: Protocol and Algorithms Specification IETF
    A method that computes round-trip delay and clock offset from the four timestamps of a request and its response
  2. Acquiring high-resolution time stamps Microsoft
    QueryPerformanceCounter (used by Stopwatch) is a clock for elapsed time that isn’t synced to external time; use system time only when UTC time is needed
  3. Time synchronization (Netcode for Entities 6.5) Unity
    Estimates server time from round-trip time and converges by adjusting the clock rate slightly, with no large time jumps

See also

Same layer: L1 Client game process

Same symptom (Stutter), other layers

View the interactive card with figures and simulations