The game does actually have lag compensation for most melee and ranged combat, and for a certain other unique attacks, but it’s very specific, and some things lack it entirely.
As an example:
Hounds, on colliding with a player, will actually freeze up to 0.2 seconds on the server, based on ping, and an extra 0.1 seconds if the player is blocking. For local players (think of when testing in the Meat Grinder with mods), the timer defaults to 0 so it only lasts a frame. Keep in mind that Hounds can actually land on players who aren’t their current target, though they usually push them out of the way (their push always ignores their main target, but everyone else is susceptible).
Once they’re unfrozen, they check if the player is right in front and within a certain distance (3 units, vs the initial server collision which is 0.65 if the player is dodging or 0.8 if not dodging), if so, the player is considered pounced.
If not, the player is let go, and if they were dodging and weren’t in front of the hound, the hound becomes incapable of landing on anyone at all during that leap attack.
Something to keep in mind is that, while leaping, hounds check if their main target is within 25 units (way, way more than their collision, that’s more than 25x the range of their collision to land on a player) and pushing, regardless of where they’re looking. This applies even while the hound is frozen in midair due to lag compensation.
This makes hounds one of the most fair enemies in the game in regards to latency. Not only the hound will freeze up and wait a bit before checking again if you should be caught, if the player pushes in any direction before or during this period, the hound will be forcibly staggered.
That said, there is one improvement that could be made to this, something that Mutants do. There’s no additional dodge check for when the lag compensation timer is over, and the radius is now always 3 units instead of allowing it to be 0.65 if the player is dodging (which you know, could happen at this point instead of earlier due to latency). This is why dogs seem to magnetize to you if you dodge to the side after they freeze up.
Mutants do check for dodge again for when their timer is up, essentially giving players with latency a second chance to dodge and have the Mutant use their smaller dodge radius (though Mutants themselves have had a huge oversight this entire time, making them extremely forgiving, dodging right into them on the server makes you immune to their grab levels of forgiving, see here).
Speaking of Mutants, ignoring that bug I just mentioned, they’re also very similar to hounds in how they’re intended to check for collision on the server, then set a lag compensation timer if they hit someone, then check again (but better than how hounds do it due to checking for dodge again, so if you dodge in time and away from the Mutant, you should get away with it).
Though right now as I said earlier, due to an oversight, dodging straight into them to collide into them on the server, makes you completely immune to getting grabbed by that Mutant until he starts a new charge action. Don’t assume this will stay, dodging in place to not get grabbed is way too silly to keep it in the game..
Also one last note in case you might think this is lag. If you’re at a different height compared to the Mutant, and the Mutant is slowed down (like by charging around something you vaulted on), and you’re close enough, you will get grabbed, that’s not lag but an intended mechanic to not make chargers useless by just jumping on a crate or so.
Next, yeah, for some reason, despite Trappers being the most unfair enemy in the game with how they can:
- Shoot nets through enemies. They basically just ignore enemies entirely.
- Nets are only stopped by geometry through a raycast from the center of the net, but the collision against players is a sphere around it (always move away from corners if they’re shooting around a corner).
- When they incapacitate a player, assistance through an interaction is always required, so you can’t save yourself through grenades, certain talents, and allies can’t just kill the Trapper from a range to save you, etc. Compared to Hounds and Mutants who allow those things, and Mutants also straight up just don’t damage the player if grabbed against a wall.
Trappers lack lag compensation entirely. Which is extremely weird given that the net isn’t a physics projectile, but rather a fake projectile moved in a straight line through the same updating code that checks for collisions against geometry and players.
Why is it extremely weird? It’d be pretty simple to freeze the net in place when colliding with a player, and have a lag compensation timer just like with hounds. Would it look weird? Yes, but hounds already freeze up in mid air and they’re okay with that, so that can’t be a valid argument against this.
When I say simple there, I do mean it, the code that updates the net is also what manually moves it before checking for collisions against players. I really don’t understand how they settled on keeping the most punishing enemy in the game with no lag compensation whatsoever, when they could be very similar to pox hounds to give high ping players a better chance.
Moving on again, almost all melee attacks have insane lag compensation compared to the cases above.
I say almost because there’s some caveats.
- If the melee attack is an aoe attack, only the main target of the attack gets lag compensation, everyone else gets nothing. This is why Crusher overheads targeting other players are so unforgiving against you, don’t go anywhere near them if you want to be sure while playing at high ping, unless you have a guaranteed stagger or can block unblockable attacks (with a shield or so).
- At the time the attack lands on the server, you must either have been considered as dodging against melee at some point during the attack prior to the hit, or you’re currently considered dodging as such, or you’re NOT blocking and you’d be capable of blocking the attack.
-
- Regarding that last one, unblockable attacks (overheads from Maulers, Crushers, and specific unblockable attacks from monstrosities and captains) will straight up ignore it, as you’d have to not be actively blocking, but that means the game will consider you unable to block them because it’s the block stance that grants the property to block unblockables on shields, as an example. Only exception is having some specific buff that grants you the ability to block unblockables regardless of weapon, but it’s better to dodge at least once against these attacks, and try to time another dodge for when they’re about to land.
If conditions apply properly, when hit on the server, the attack is delayed instead and a lag compensation timer starts. The timer is based on ping as usual.
During this time, the game will retry 10 times across this timer to see if the player can be hit (but blocked) or if they dodged, but the conditions mentioned above can apply again and negate the hit again and again. If the hit never lands through these 10 tries and the timer runs out, it goes off one more time without being able to be delayed further.
Of course, the attack can still be dodged or blocked (if blocking is possible) at this point, and there’s also a unique lag compensation check done here, where if the player is considered dodging against it and has moved far away enough from the enemy, they can also ignore the hit.
Lastly, ranged attacks. Rather than doing this stuff that melee attacks do where the hit is delayed, they instead tend to increase the timer for their “dodge window” (and thus when they fire) based on ping.
Snipers specifically will have to keep their aim on target for longer before preparing to fire and giving a warning, based on ping.
Then, once they give off their warning, the time before firing is that of the scope’s reflection timing + extra timing based on ping (this is why they fire extremely quickly in the Meat Grinder if you use mods to test that stuff, because a local player has 0 extra timing). Plasma Gunners do only this bit, they don’t have a “keep aim on target for X seconds before preparing to fire”.
Being considered as dodging against ranged on the server at any point during this dodge window, will cause their aim to stay at that point where you were considered as dodging (you can still be hit if you’re not considered as dodging against ranged attacks and you’re physically in the way, so obviously, strafe dodge them if possible).
Against other enemies that shoot, it’s a bit different. First, if you’re considered as dodging ranged attacks too early (dodging on the server by the time they play their scope reflection), dodging afterwards is ignored for tracking purposes (you can still dodge to avoid taking damage, it’s more that they’ll continue to track you instead of shooting at your position when you were considered dodging).
Gunners and Reapers always keep track of you though so this is irrelevant to them, and you must be considered as dodging against ranged to not take damage from them (or for them to miss due to spread, which, yeah don’t count on it).
With other shooters, if you weren’t considered as dodging too early, and then you’re considered as dodging shortly before they open fire or afterwards, they will fire their entire burst at your dodge position. This includes extremely long bursts that enemies get from havoc and/or with yellow stimms, just don’t physically walk back into the volley..
The dodge windows are usually 0.5 seconds. Snipers have 0.45, Plasma Gunners have 0.6 (I think). Scab Shocktroopers (that’s an internal name, I forget which ones these are..), Captains with a shotgun and the Ranged Twin with One Handed Plasma gun have 0.75. Extra timing based on ping is added with all of these.
Anyhow.. this is long enough as is. As you can see, there are some cases that could use some improvements, like the slight improvement to pox hounds once they unfreeze (to check if the player is dodging at that point like how mutants do), or how unblockable attacks can ignore lag compensation if you don’t dodge at some point while they wind up the attack (it should probably activate regardless of blocking, dodging, or being able to block an attack or not..), etc.
And other cases where there’s none and could really, really use having something like this, like Trapper nets. The grab action for Chaos Spawns, where they start munching on you, also lacks lag compensation entirely and it’s why it feels like it can get you from very far sometimes.
But that said, there’s also a lot of it that, if it wasn’t there, the game would be unplayable, way more than it is. If you want an example of that, Left 4 Dead 2 is right there (I know it’s an old game, but it’s still a good example!).
Actually, one last thing, seeing as it gets brought up here, the game does make use of rollback, kinda, have you noticed that if you shoot a moving enemy with a hitscan weapon, you land your shots reliably most of the time? Without needing to shoot in front of the enemy trying to predict where they are on the server? Yeah, I wonder why that is huh?
This is also used for melee and pushing as well, and it’s why it works as well as it does. There’s some occasional ghost hits, but most of the time it works out greatly even it high ping (I always play with 200-250ms, I know how it is).
That said, projectiles do kinda suck for this stuff because you do have to shoot ahead with higher ping, more than you’d do for the travel time of the projectile, but that’s can of worms on its own to make it less of a problem..
But anyhow, again for real, to wrap this up. Let me know if there’s something that isn’t clear or that needs more elaboration, I’ll try to answer when I have the time.
I do think than rather than suggesting a lot of things that are already somewhat there, or for client authority which they clearly didn’t want to implement, and it might never get added (I’d love that to be the case, especially if we finally get to host local games, don’t get me wrong!). I think it might be better for now to push for these things instead:
- To add lag compensation for Trappers as there’s no excuse if hounds have that, and they’re fine with freezing them up in mid air.
- For improvements for thrown projectiles with higher ping, as unlike hitscan weapons, they suffer if the target isn’t standing still or moving in a straight line. Forcing you to try to predict based on ping like in many other games.
- For making Pox Bursters and Pox Hounds check for push from all players in range, and not just their main target (or at least for Bursters, it feels really bad when they ignore players at point-blank range). It’s not lag for Pox Bursters most of the time, it’s how specific the forced stagger check is where only the main target can do it.
- For making unblockable attacks still allow lag compensation to trigger even if the player can’t block them, without needing for them to dodge. The player could still end up blocking during the lag compensation timing with a perfect block, which could end up allowing an unblockable attack to be blocked more reliably if they have a talent for that! or with a shield or so, and that would be valid, yet it’s not accounted for!