The shooter sees the past
By the time your fire input reaches the server, the target has already moved. Without help, you would have to lead every shot by your ping, which feels broken. Lag compensation lets the server judge the shot from the shooter's point of view.
Rewinding the world
The server keeps a short history of recent world states, a ring buffer of snapshots. When it processes a fire input it:
- Estimates the time the shooter actually saw, using their latency and interpolation delay.
- Rewinds every target to where it was at that moment.
- Runs the hit test against the rewound positions, then restores the present.
The fairness tradeoff
- The shooter gets fair, what you see is what you get hit detection.
- The victim can feel shot behind cover, since they were exposed in the past.
- Designers cap the rewind window so very high latency players cannot exploit it.
Key idea
Lag compensation rewinds targets to the time the shooter saw, so hits register fairly at the cost of occasional shot behind cover moments.