Difference between revisions of "Lag compensation"

From Team Fortress Wiki
Jump to: navigation, search
m (Auto: templateParamFilter (Review RC#3836928))
(mc)
 
Line 16: Line 16:
 
* Fixed an exploit with The [[Eureka Effect]] and The [[Phlogistinator]] where the effects could activate without taunting in high-lag situations
 
* Fixed an exploit with The [[Eureka Effect]] and The [[Phlogistinator]] where the effects could activate without taunting in high-lag situations
  
'''{{Patch name|9|10|2014}} #1'''
+
'''{{Patch name|9|10|2014|num=1}}'''
 
* Fixed [[vdc:trigger_push|push triggers]] applying push values twice when lag compensation is being done
 
* Fixed [[vdc:trigger_push|push triggers]] applying push values twice when lag compensation is being done
  
Line 22: Line 22:
 
* Fixed the [[Short Circuit]] causing lag compensation problems on the server
 
* Fixed the [[Short Circuit]] causing lag compensation problems on the server
  
'''{{Patch name|3|28|2018}}''' ([[Blue Moon Pack]])
+
'''{{Patch name|3|28|2018|major=Blue Moon Pack}}'''
 
* Lag compensation system will now reliably restore pose parameters responsible for animation layering
 
* Lag compensation system will now reliably restore pose parameters responsible for animation layering
 
** This makes server-side hitboxes for lag compensated players better match client-side rendered models
 
** This makes server-side hitboxes for lag compensated players better match client-side rendered models
  
 
'''{{Patch name|7|7|2022}}'''
 
'''{{Patch name|7|7|2022}}'''
* Fixed lag compensation when [[Weapons|melee]]-ing teammates
+
* Fixed lag compensation when [[melee]]-ing teammates
  
 
'''{{Patch name|12|6|2022}}'''
 
'''{{Patch name|12|6|2022}}'''
* [[vdc:VScript|VScript]] support changes
+
* [[VScript]] support changes
 
** Fixed lag compensation when [[friendly fire]] is enabled
 
** Fixed lag compensation when [[friendly fire]] is enabled
  
'''{{Patch name|7|18|2024}} #1''' ([[Summer 2024 Update]])
+
'''{{Patch name|7|18|2024|major=Summer 2024 Update|num=1}}'''
 
* Fixed [[Gunslinger]] punch combo not being lag compensated (community fix from Marxvee)}}
 
* Fixed [[Gunslinger]] punch combo not being lag compensated (community fix from Marxvee)}}
  

Latest revision as of 07:40, 2 October 2025

Stop lagging and start tagging, men!
The Soldier

Team Fortress 2, being a Source Engine game, is generally configured to make use of lag compensation. Lag compensation is most commonly the technical reason behind cases of kills or actions that would otherwise seem infeasible in given circumstances; for example, when players perceive themselves to have been "shot through a wall" by a Sniper, backstabs being performed at the incorrect angle (known as facestabs), or otherwise missing entirely (known as failstabs).

When a high-latency (high-ping) player attacks, the server temporarily "rewinds" its copy of the action in order to compensate for their lag. For example, the enemy Sniper shoots when he sees your head, at that moment you and most other players may believe you successfully ran behind a wall. When the server receives the fire message from the Sniper, it "rewinds", finds out if you had ought to have been hit, and then deals damage, leading to the appearance of being "killed through a wall".

This system is an intentional trade-off designed to maintain the fairness of attacks at the cost of making damage reception feel less immediate. Without lag compensation, attacks that appear to hit but fail to register, especially in the case of melee weapons, would occur more frequently.

Exceptions

Projectile weapons such as rockets, grenades, syringes, and flares are not lag-compensated. The Pyro's compression blast and Flame Thrower are also not lag compensated, despite the effects appearing immediately after firing on a player's screen. This makes Pyro an increasingly difficult class to play at higher latencies.

Spectators do not have lag compensation. If you are spectating someone in first person, you are not seeing exactly what they are seeing, rather you are looking at what the server is seeing. This is especially noticeable with high-latency Snipers, where you should expect to see unusual shots that may appear to miss or jerk about from your perspective.

Update history

December 16, 2011 Patch
  • Fixed an exploit with The Eureka Effect and The Phlogistinator where the effects could activate without taunting in high-lag situations

September 10, 2014 Patch 1

  • Fixed push triggers applying push values twice when lag compensation is being done

August 29, 2016 Patch

  • Fixed the Short Circuit causing lag compensation problems on the server

March 28, 2018 Patch (Blue Moon Pack)

  • Lag compensation system will now reliably restore pose parameters responsible for animation layering
    • This makes server-side hitboxes for lag compensated players better match client-side rendered models

July 7, 2022 Patch

  • Fixed lag compensation when melee-ing teammates

December 6, 2022 Patch

July 18, 2024 Patch 1 (Summer 2024 Update)

  • Fixed Gunslinger punch combo not being lag compensated (community fix from Marxvee)

See also

External links

See the following links for in-depth technical explanation of how lag compensation works in the Source Engine: