Back to Blog
    Deep Dive

    Lag Compensation: Why You Get Shot Behind Walls

    DevDiary Sep 28, 2025 8 min read
    Lag Compensation: Why You Get Shot Behind Walls

    "I shot him first!"

    We've all been there. You run behind a wall, and 0.5 seconds later, you die. Is the game broken? No, it's Lag Compensation working exactly as intended.

    The Past vs The Present

    Server-side, the game keeps a history of where every player was for the last second. When a high-ping player shoots at you:

    1. They see you in the open (on their screen, which is "in the past").
    2. They shoot.
    3. The server receives the shot 100ms later.
    4. The server "rewinds" the simulation to see if you were there 100ms ago.
    5. You WAS there. So the hit counts.

    On your screen, you are safe behind the wall. But in the timeline of the shooter, you were dead. It feels unfair, but without it, you would have to aim ahead of moving targets like in the Quake 1 days.

    DevDiary

    The DCSpeedTest Research Team consists of certified network engineers and analysts who review millions of broadband tests to provide definitive connectivity insights.

    #Netcode#Gaming#Lag