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

Game Lag White Paper › Netcode design

Hit registration without lag compensation Server-now hit validation

Cause ID sy-no-lagcomp · Primary owner Game team (Server development) · Also Game team (Client development)

Open the interactive card with figures and simulations →

If the server checks hits only against where targets are on the server right now, what you saw on your screen and the server’s call disagree.

Why The opponent on your screen is at a position about 0.2 s in the past (at 150 ms ping and 100 ms interpolation) → Effect The server checks against the current position, so the target has already left the spot you aimed at → On screen A clear hit counts as a miss. You have to lead moving targets

Symptoms
Dropped action / rollback
Factors
Latency
Who’s affected
Just me
When
During specific actions
Owner
Primary owner Game team (Server development) · Also Game team (Client development)
Game team action items
Server: rewind to what the attacker was seeing and check the hit there (lag compensation), or switch to a target-lock system. Client: send the moment you were seeing (the server time being interpolated) with each attack.
On the graph
Outliers only · Hit rate on moving targets (by ping bracket)
Where to look
Server hit log with the attack time, the target position on the attacker’s screen (sent by the client), the target position the server used, and the attacker’s RTT. In a development build, drawing the position the server used over the client’s screen shows it right away
Confirmed if
On misses, the gap between the two positions is roughly target speed × (attacker RTT + interpolation time), and higher ping lowers the hit rate on moving targets only
Ruled out if
Stationary targets get missed too: hitbox or collision check problem. Still mismatched with rewind in place: check whether the client reports its interpolation time to the server incorrectly
Check with
Game server or client logs and metrics

Sources

  1. Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization (Yahn W. Bernier, GDC 2001) Valve
    Without lag compensation, you have to lead targets by your latency. Lag compensation has the server rewind by latency plus interpolation time to check hits
  2. Peeking into VALORANT's Netcode Riot Games
    The server rewinds to the game state the player saw at the moment of the shot to check the hit; the client sends the simulation time it was seeing
  3. Source SDK 2013: player_lagcompensation.cpp Valve
    In the Source engine, rewind time = network latency + interpolation time

See also

Same layer: Netcode design

Same symptom (Dropped action / rollback), other layers

View the interactive card with figures and simulations