Lag compensation is the technique a multiplayer game server uses to validate your shot against the world as you saw it, not the world as it is by the time your shot arrives. In practice, the server rewinds other players’ positions to the moment you fired, checks whether your aim would have hit there, and then restores the live game. It is the reason a clean first shot sometimes kills you in an instant you never saw coming.
Below is the actual algorithm, without the marketing language, plus why it can still produce deaths that look physically impossible.
Table of Contents
- 1Quick answer
- 2What Is Lag Compensation?
- 3Lag, latency, ping, jitter, and packet loss are not the same thing
- 4Why Does Latency Make Online Combat Feel Unfair?
- 5How Lag Compensation Works: The Core Idea
- 6How lag compensation works step by step
- 7What Does the Server Rewind?
- 8Why timestamps and interpolation delay drive the rewind
- 9What Are the Main Lag Compensation Techniques?
- 10How this plays out by genre
- 11How Lag Compensation Works in One Match Example
- 12Why Can Lag Compensation Feel Unfair?
- 13Lag Compensation vs. Rollback Netcode
- 14How Do Game Developers Tune Lag Compensation?
- 15What Can Players Do About Inconsistent Hits?
- 16Frequently Asked Questions
- 17Does lag compensation mean the game knows where you are at all times?
- 18Why do I sometimes hit the enemy but the server says I missed?
- 19How much latency should a game compensate for?
- 20Is rollback netcode better than lag compensation?
- 21Can lag compensation be used by cheats?
- 22Conclusion
Quick answer
Lag compensation: the server temporarily restores old player positions, runs the hit test against that past state, then returns the live world unchanged.
- Without it, high-ping players lose every gunfight before it starts.
- With it, low-ping players can be hit by shots they had no way to see or react to.
- It is a deliberate fairness trade, and every studio caps it. The cap is the whole argument.
What Is Lag Compensation?
Lag compensation is netcode logic on the authoritative server. When a shot arrives, the server looks up a short history of where every player was, restores that history, tests the shot against it, then puts the live positions back. What gets validated is the past, briefly.
It is not the same thing as client prediction or rollback. Client prediction is your own machine guessing your movement so your inputs feel instant. Rollback is a full resimulation of the match when inputs arrive late. Lag compensation only affects hit validation, and only the shot it is checking.
Lag, latency, ping, jitter, and packet loss are not the same thing
These get mixed up constantly, and the difference matters for everything below.
| Term | What it actually means |
|---|---|
| Latency | The delay between your action and the server receiving it. Measured one way. |
| Ping | Latency expressed as a round trip, so roughly double your one-way delay. |
| Jitter | How much that delay varies from moment to moment. Jitter wrecks prediction more than steady high ping does. |
| Packet loss | Data that never arrives. The server must guess or hold the last known state. |
| Frame advantage | A real in-game edge earned through rendering speed, separate from network delay. |
A player with a rock-steady 120ms connection often has a better time than one bouncing between 15ms and 90ms, because compensation only works cleanly when the delay it rewinds by is a delay it can actually predict.
Why Does Latency Make Online Combat Feel Unfair?
Because the server only knows what it has received. Your client sees the world immediately, at your own frame rate. The server learns about your click roughly half your ping after you made it, and learns about the opponent’s position at their half-ping. Both clocks are always out of step.
Picture two players trading fire on a flat corridor. One sits on a 20ms connection, the other on 150ms.
- At t = 0ms the 150ms player fires. The server does not hear about it until roughly t = 75ms.
- At t = 40ms the 20ms player fires. The server hears about that at roughly t = 50ms.
- By t = 75ms the opponent has already moved for another 75ms of walking.
Checked against live positions, the high-ping player’s perfectly reasonable shot hits a wall where the target used to be. The high-ping player loses every exchange by a margin they cannot see, and no amount of aim fixes it. Lag compensation exists so that this stopgap rule stops deciding matches.
That is also the honest framing of the complaint you see on r/GlobalOffensive and similar boards: the system is not adding an advantage to anyone, it is removing a structural handicap from one side.
How Lag Compensation Works: The Core Idea

The core idea is that your view of the world is roughly a quarter-second old, so the server must test your shot against a similarly aged world or the test is meaningless. The full path, end to end, takes about four steps.
How lag compensation works step by step
- Your client stamps the input. When you click, the game records the moment of the click along with your position, aim direction, and weapon state, then sends it to the server with a sequence number.
- The server keeps a rolling history. Every tick, the server snapshots player positions and keeps a ring buffer of the last second or so, discarding anything older.
- The server rewinds to your timestamp. When the shot lands, the server walks the history back to the time you fired and restores everyone’s position to that moment.
- The hit is validated, then the world is restored. The game runs the collision test against the rewound state, records damage, then puts live positions back before the next tick. Nothing else in the match ever sees the rewind.
That last point is worth repeating. The rewind is a private, momentary operation inside the server. Other players keep seeing a continuous world.
| Stage | What the server has | What it does |
|---|---|---|
| Input received | A timestamped command with aim data | Places the shot in its history buffer |
| Rewind | Position snapshots for every player over the last second | Restores the world to your shot’s moment |
| Validation | Rewound positions plus live hitbox geometry | Runs the hit test and registers damage |
| Restore | Live positions from the current tick | Puts the real world back and continues |
| Return | The authoritative result | Sends hit or miss back to your client and everyone else |
What comes back is not a suggestion. The server decides who died, and your client shows you the result roughly one round trip later.
What Does the Server Rewind?

Only positions, and only a bounded window of them. A typical implementation rewinds player locations, sometimes the visible parts of the world, and then re-runs the collision check against that state. Health, ammo, and ability cooldowns are almost never rewound, because rolling those back creates far stranger failures than the ones it would fix.
The window length is the important part. If the history buffer holds one second of snapshots and you are playing at 120ms, the server has plenty to work with. Play at 400ms and it is running close to the edge. Play at 900ms on a connection that spikes, and the buffer may no longer hold the shot at all, so the server falls back to validating against live positions, which is the exact unfairness compensation was built to remove.
Why timestamps and interpolation delay drive the rewind
The target you saw on screen was already interpolated into the past. Entity interpolation is the rendering trick that makes other players look smooth: instead of snapping to their newest known position, your client displays them between older snapshots, usually one or two behind.
So the shot you fired was aimed at a position roughly one interpolation step behind the server’s live truth, plus your own ping. Good compensation aims the rewind at the client display timeline, not the raw input timestamp, otherwise the correction overshoots in the other direction and your hits start feeling late.
Players on r/deadbydaylight and r/apexuniversity ask constantly why the enemy in their kill feed was somewhere they never could have been. The answer is usually a mismatch between those two clocks rather than a broken server.
What Are the Main Lag Compensation Techniques?
Lag compensation is one piece of a larger netcode system, and confusing it with its neighbours is the source of most bad explanations online.
| Technique | What it does | Fixes | Breakdown |
|---|---|---|---|
| Entity interpolation | Draws other players between past snapshots | Stuttering movement | Adds a fixed display delay |
| Lag compensation | Rewinds positions to validate a hit | High-pin players missing fair shots | Low-pin players can be killed by invisible shots |
| Client prediction | Your client runs your own movement ahead of the server | Input feeling mushy | Wrong guesses get corrected and you see rubber-banding |
| Server reconciliation | Server compares its state to the prediction and replays | Prediction errors compounding | Visible corrections when the gap is large |
| Rollback netcode | Resimulates the whole match from a past frame | Input delay in fighting and sports games | Visual artifacts, and heavy engineering |
| Fixed-tick simulation | Server advances the world on a fixed schedule | Physics behaving differently per client | Low tick rates still feel choppy |
None of them fix the problem the others fix. Rollback titles usually skip lag compensation entirely because the whole simulation already travels back in time.
How this plays out by genre
- First-person shooters: full lag compensation, because one millisecond decides who reacts first. This is the category where the complaints are loudest.
- Battle royales: the same core system, usually with a large rewind allowance because players can be spread far apart. At least one developer has publicly named this artifact, confirming that being shot while fully behind cover is intended behaviour rather than a bug.
- Sports sims: heavy use, sometimes described as shifting the whole experience toward the timing of the better-connected player, which is exactly why football sim players complain about it.
- Fighting games: rollback instead, so that a late input is not punished with a dropped frame.
- Online chess: almost no compensation, because a move is atomic and the cost of a wrong guess is far higher than in a shooter.
How Lag Compensation Works in One Match Example
Here is the whole thing in a single exchange, with two players on very different connections.
A player on 120ms is holding a long corridor. A player on 40ms is holding the far end behind a doorway. Both are strafing, so neither is standing still.
- The 120ms player spots the doorway opening and fires. The client stamps the shot at t = 0ms and sends it.
- The 40ms player sees the muzzle flash at t = 40ms, steps behind the door, and fires back. That shot reaches the server at about t = 60ms.
- The server receives the second shot first. At that moment the 120ms player is still standing in the open on live positions, so the shot lands and kills them.
- At t = 60ms the first shot arrives, stamped from t = 0ms. The server rewinds to t = 0ms, where the 40ms player was still in the doorway, and registers a hit on a body that has already moved.
Both players die, roughly a second apart in wall-clock time. The 120ms player fired first on their own screen and still lost the trade. That is not a bug; it is the algorithm doing exactly what it promises, and it is why the losing side of that trade feels like nonsense.
Notice what compensation did not do. It did not speed up either player, and it did not let anyone shoot through walls in real time. It only changed the past used for validation.
Why Can Lag Compensation Feel Unfair?
Because the cost lands on the person with the best connection, and the benefit lands on the person with the worst. A handful of specific conditions make it much worse.
- Rewind beyond what a player can perceive. If the window allows compensating 300ms of delay, a 20ms player can be killed by someone they had no possible reaction time to, and that death is unwinnable rather than merely surprising.
- Mismatched interpolation. When the display delay used for rendering differs from the one used for validation, hits land consistently slightly early or late. This is the most common cause of a persistent bad streak that feels like aim error.
- Variable ping and packet loss. The rewind assumes a delay you can look up in the history buffer. A connection that spikes past that buffer cannot be rewound at all.
- Low server tick rates. Fewer snapshots per second means a coarser history and more guesswork between recorded positions. Players in shooter communities regularly treat tick rate and compensation as two separate problems rather than one.
- Abuse. A history buffer can be turned into a wallhack. Clients that send large or stale timestamps to probe where enemies were, then fire at those positions, are the clearest cheat case, which is why servers validate timestamps and clamp rewind distance.
One limit is structural and rarely discussed: compensation cannot fix a peek. When someone steps out of cover, both players physically waited for information to cross the network. No amount of rewinding changes that a player who moves first, moves first.
That question has sat on r/GlobalOffensive for roughly a decade, and the most accepted answer there is that the advantage comes from raw transmission delay rather than from ping or from compensation. Which means compensation is a mitigation, never a cure.
Lag Compensation vs. Rollback Netcode
These solve different problems and are sometimes used to look similar. Lag compensation reconstructs a small piece of the past to judge one shot. Rollback reconstructs the entire match and simulates it forward again.
| Criterion | Lag compensation | Rollback netcode |
|---|---|---|
| What is reconstructed | Player positions across a short history window | The whole simulation state, then resimulated |
| Scope of the correction | One hit test | Every frame since the last confirmed state |
| Where it runs | Authoritative server | Every client running the same deterministic simulation |
| Typical use | First-person shooters, battle royales, sports sims | Fighting games, some sports titles |
| Player-visible cost | Dying to shots you never saw | Occasional flicker or a wrong animation frame |
| Main weakness | Unfair deaths at the low-ping end | Visible artifacts and high CPU cost on rollback frames |
A fighting game using rollback never rewinds for hit detection, because there is no hit detection to rewind. The whole match was already replayed from your input’s timestamp. Shooters cannot do that, because simulating a physical firefight deterministically for a hundred players at once is a different and much harder problem.
Online chess servers usually take the third route entirely: no compensation, no rollback, and a rule that inputs arriving late are simply discarded, since a stale move is worse than no move.
How Do Game Developers Tune Lag Compensation?
It is a balancing exercise between two groups of players who both feel cheated, so nobody ships an unlimited rewind window. The tuning variables interlock.
- Maximum rewind distance. The hard ceiling on how much delay gets compensated. Community testing has put the engagement mark somewhere around the 160ms point, with plenty of argument it should sit nearer 120ms. Shooters with lower tick rates generally sit lower still.
- Server tick rate. Snapshots per second. The history buffer’s resolution is the tick rate, so a low tick rate produces a coarse rewind that can miss fast movement between samples.
- Interpolation buffer length. Usually one to two ticks. Too short and other players stutter, too long and everyone sees the world late, which then has to be matched in the rewind target.
- Input prediction and smoothing. Extrapolating missing positions and blending corrections, so a jittery connection does not produce rubber-banding.
- Telemetry and thresholds. Studios track compensation rates, desync reports, and hit registration complaints to decide where the window sits.
- Abuse prevention. Timestamp sanity checks and rewind distance clamps, since the history buffer is otherwise a wallhack.
There is no universal correct setting. A 128-tick shooter and a 32-tick battle royale on the same engine need different numbers, which is why cross-game comparisons of compensation windows usually end in arguments.
What Can Players Do About Inconsistent Hits?
Most of the fix is on your side of the cable, and a good chunk of it is about telling the two apart before you blame your aim.
- Open the network graph. Nearly every competitive shooter can display a live graph of ping, jitter, and packet loss. Flat lines beat spiky ones, so fix jitter before you chase raw latency.
- Use a wired connection. Wi-Fi adds variable delay that no amount of compensation can predict.
- Check which server you are on. The distance number in your match screen is a rough guide, but a congested region can be worse than a further one. Trying a neighbouring region for a session is cheap.
- Verify the server tick rate. Community servers and modes vary a lot. A low tick rate makes compensation coarser and hits feel less accurate regardless of your ping.
- Watch for a repeating pattern, not a single death. One kill through a wall is noise. Every duel ending at the same range, in the same direction, points at interpolation or rewind tuning.
- Keep your settings honest. Turning off frame caps or removing V-Sync removes an entire category of stutter that gets mistaken for a network problem.
And accept the limit: if you die to someone you never saw, there is no setting that gives you the reaction time that was never there.
Frequently Asked Questions
Does lag compensation mean the game knows where you are at all times?
No. The server holds a rolling buffer of recent position snapshots and only reconstructs part of it when a hit needs validating. Between shots it is working from the freshest data it has received, which on a high-latency connection may already be out of date. The game also does not know where you intend to go, only where your inputs have put you so far.
Why do I sometimes hit the enemy but the server says I missed?
Two things are usually at play. Your aim was correct for the position the target occupied when you fired, but the rewind target may have been offset by the server’s interpolation setting, so the hitbox it checked was a tick ahead of or behind what you saw. Variable ping also means the shot sometimes arrives past the end of the rewind window, forcing validation against live positions. What is left is usually ordinary aim error that looks worse in hindsight.
How much latency should a game compensate for?
There is no published universal number, and developers treat it as a balance decision rather than a technical one. Reported thresholds in shooters have landed around 120 to 160ms, with lower figures where the server tick rate is low. Compensating more protects high-ping players and makes the game increasingly unfair for low-ping players, which is why every studio caps the window somewhere.
Is rollback netcode better than lag compensation?
Better for its own purpose, and that purpose is different. Rollback resimulates the entire match from a past frame so inputs register immediately, which is what fighting games need. Lag compensation reconstructs only positions for one hit test, which is what a shooter with dozens of simultaneous players needs. Comparing them is like comparing seat belts to crumple zones: each fits its own collision.
Can lag compensation be used by cheats?
It can be abused, and the abuse is well known. A cheat that spoofs timestamps can request rewinds to distant past moments and use the returned position data as a wallhack, or claim an extremely old timestamp to extend the rewind window so it can hit through walls. This is why servers validate timestamp sanity and clamp rewind distance, and why the feature is treated as a security boundary rather than a convenience.
Conclusion
Lag compensation works by testing your shot against a reconstructed past rather than the present, so the server judges what you saw instead of what arrived in time. That is the entire mechanism, and it is the source of every complaint about it.
What you should do first is open the network graph and check for jitter before you blame your aim. Beyond that, the system is doing what it was built to do, and the cure for it is a stable connection, a decent server tick rate, and clients that report honestly rather than a feature you can switch off.


