ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
634 stars 74 forks source link

[TF2] [gameplay] give people the opportunity to set the lerp value to 0 #4509

Open kucta opened 1 year ago

kucta commented 1 year ago

I'm sick of these delays between pressing the left mouse button and firing this relic of the past needs to be removed or given the opportunity to change the value of lerp

RicochetYT commented 1 year ago

This would imply disabling interpolation. I don't think this is a good idea.

https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking "By default, the client receives about 20 snapshot per second. If the objects (entities) in the world were only rendered at the positions received by the server, moving objects and animation would look choppy and jittery. Dropped packets would also cause noticeable glitches. The trick to solve this problem is to go back in time for rendering, so positions and animations can be continuously interpolated between two recently received snapshots. With 20 snapshots per second, a new update arrives about every 50 milliseconds. If the client render time is shifted back by 50 milliseconds, entities can be always interpolated between the last received snapshot and the snapshot before that."

treacherousfiend commented 1 year ago

Interpolation is a part of any multiplayer video game simply because sending data at a rate where moving objects will not stutter is infeasible, especially as hardware gets better and player's framerates get higher. Without interpolation, if a player had 1000fps the server would need to send data 1000/s for there to not be stuttering for those players. Most games just do not let you change this value or even see it, and even later valve games like CS:GO do not let you edit it.

Its also worth noting that interpolation does NOT affect any of the actions done by the client and instead only affects any data that the server sends back to the player (Other players, projectiles, etc.)

The only case where there could even be a tiny visual delay between left clicking and firing is in the case of projectile weapons, but with the lowest possible interp setting, that delay is 15.2ms, which is... not a lot. I'm fairly certain that this delay could be fixed, but that would be a different beast entirely since it revolves around how projectiles are networked.

As mentioned in the comment above, setting your interp to 0 would completely disable interpolation, which would cause every single movement of every object to stutter. If this assumption that 0 lerp would help comes from old footage of players with "0 lerp" its worth noting that before it was fixed, some players would (usually unknowingly) abuse a bug to set their interp setting to a "fake" 0. This fake 0 lerp is NOT the same as actually disabling interpolation, with this fake 0 lerp, players would desync from the server. I may be misremembering some details, so take this with a minor grain of salt. In this case, the client did not actually disable interpolation and used the intended minimum of 15.2ms, but the server thought that the player actually had disabled interpolation and as such caused hit registration to be offset by 15.2ms. As a fun side note, this bug is what caused some sniper players to say that you need to aim a tiny bit behind a player in order to hit them.