Cobo Makes Games blog

Game development glossary

Lag compensation

Lag compensation judges a hit by what the attacker saw: the host puts targets back where they were on the attacker's screen when they swung.

Also called lag comp, rewind hit detection.

In online games, other players and enemies are drawn slightly in the past, so a swing aimed at a creature is aimed at where it was a moment ago. If the host judged the hit against where the creature is now, swings that clearly connected on the player's screen would miss. Lag compensation fixes that by looking back.

How does it work?

Each attack carries the time the attacker was seeing. The host briefly moves the targets back to where they were at that time, checks the hit, and puts them back. A limit on how far it looks back stops a player from faking an old timestamp to hit things they never could have.

Lag compensation in Mytheria

Guest melee swings are judged up to 150 milliseconds back. Because the host reads the actual delay from each attack, it follows the guest's interpolation buffer as that grows and shrinks with the connection. When a hit lands, the host sends one event to every screen with the damage number, the flash, the freeze, the sound and the shove, so everyone sees the same hit.

A guest fighting beside the host in Mytheria with 150 ms of delay each way, still smooth The full post, with clips and demos How to hide lag in an online co-op game

Mytheria

Coming to Steam

The store page isn't up yet. Leave your email and we'll tell you when you can wishlist Mytheria on Steam.

We'll send that one email and never share your address.

Windows · macOS · Steam Deck