Difference between revisions of "Lag compensation"

From Team Fortress Wiki
Jump to: navigation, search
(Added section on exploits.)
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Stub}}
+
{{Quotation|'''The Soldier'''|Stop lagging and start tagging, men!|sound=Cm_soldier_pregamelostlast_02.mp3}}
  
''Team Fortress 2'', being based on the [[Source Engine]], 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]], or [[Backstab]]s being performed at the incorrect angle (known as ''[[Backstab#Issues|facestabs]]''), or otherwise missing entirely (known as ''[[Backstab#Issues|failstabs]]'').
+
''Team Fortress 2'', being based on the [[Source Engine]], 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]], [[backstab]]s being performed at the incorrect angle (known as ''[[Backstab#Issues|facestabs]]''), or otherwise missing entirely (known as ''[[Backstab#Issues|failstabs]]'').
  
In a nutshell, 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".  
+
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 is an intentional engineering and design decision, a tradeoff to enhance the realism of attacks at the expense of the realism of taking damage. Were lag compensation disabled, many players would have cause to complain that they shot the enemy without inflicting any damage.
+
This is an intentional engineering and design decision, a tradeoff to enhance the realism of attacks at the expense of the realism of taking damage. Were lag compensation disabled, many players would complain that they shot the enemy without inflicting any damage, which is still a issue due to [[Hit detection|hit registry]] and which is more of a issue with melee weapons.
  
 
== Exceptions ==
 
== Exceptions ==
Projectile weapons such as [[rocket]]s, [[grenade]]s, [[syringes]] and [[flare gun|flares]] are not lag-compensated. The [[Pyro]]'s [[compression blast]] and [[Flamethrower]] 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.
+
Projectile weapons such as [[rocket]]s, [[grenade launcher|grenade]]s, [[syringes]], and [[flare gun|flares]] are not lag-compensated. The [[Pyro]]'s [[compression blast]] and [[Flamethrower]] 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. 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.
+
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.
 
 
== Issues ==
 
Lag compensation, while an important feature of TF2, can also open the door to a variety of exploits and cheating. For instance, a player could use a lag switch, either physical or software-based, to create artificial lag, allowing them to essentially "pause" other players and shoot them in this vulnerable state. This kind of cheating is usually prevented via VAC; However, VAC bans are time-delayed and therefore server admins may need to take note of this technique.
 
  
 
== See also ==
 
== See also ==
* [[Backstab#Issues|Backstab Issues]]
+
* [[Backstab#Issues|Backstab issues]]
 
* [[Source Engine]]
 
* [[Source Engine]]
  
Line 23: Line 20:
  
 
* {{vdc|Lag compensation}}
 
* {{vdc|Lag compensation}}
 +
* {{vdc|Latency_Compensating Methods in Client/Server In-game Protocol Design and Optimization}}
 
* {{vdc|Source Multiplayer Networking}}
 
* {{vdc|Source Multiplayer Networking}}
 
* {{vdc|Prediction}}
 
* {{vdc|Prediction}}
  
 
[[Category:Gameplay]]
 
[[Category:Gameplay]]

Revision as of 05:35, 29 November 2019

Stop lagging and start tagging, men!
The Soldier

Team Fortress 2, being based on the Source Engine, 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 is an intentional engineering and design decision, a tradeoff to enhance the realism of attacks at the expense of the realism of taking damage. Were lag compensation disabled, many players would complain that they shot the enemy without inflicting any damage, which is still a issue due to hit registry and which is more of a issue with melee weapons.

Exceptions

Projectile weapons such as rockets, grenades, syringes, and flares are not lag-compensated. The Pyro's compression blast and Flamethrower 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.

See also

External links

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