AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Lerp Tracker (and fixer!) (https://forums.alliedmods.net/showthread.php?t=149333)

ProdigySim 02-05-2011 12:34

[ANY] Lerp Tracker (and fixer!)
 
1 Attachment(s)
About:

Interpolation on clients is an important part of hit calculation in Source games. It's meant to be used to smooth out entity movement on clients. It also has great implications upon close-range interactions between players.
At the basic level, however, it lets clients "see into the past." This is exploitable in a number of ways. This plugin is meant to help mitigate lerp exploitation.

This plugin will track the lerp values of all players and announce changes to players' lerp (and log them). This plugin can also be configured to fix lerp values for servers that allow cl_interp_ratio 0.

References:
Valve Wiki on Intepolation
My write up on Lerp as it relates to L4D(2) and competitive play

Cvars and Commands:
  • sm_announce_lerp - Announce changes to players' lerp. 1=Announce new players' lerp and lerp changes 2=Announce lerp changes only (Default 1)
  • sm_log_lerp - Log changes to players' lerp. 1=Log new players' lerp and lerp changes 2=Log lerp changes only (Default 1)
  • sm_fixlerp - Fix Lerp calculation for interp_ratio 0 (Default 0)
  • sm_max_interp - Kick players whose calculated lerp is higher than this value. (Default 0.5 - valve max)
  • sm_lerps (Command) - List the lerp values of all players

To set a minimum lerp, simply set sv_client_min_interp_ratio to (DESIRED_MIN_LERP * sv_maxupdaterate).

sm_fixlerp details:
Lerp calculation (according to the Valve wiki) uses the following calculation:
Code:

min( max( cl_interp, cl_interp_ratio / cl_updaterate ), 0.25f )
In actuality, at least in L4D2, the lerp calculation looks this on server side:
Code:

min( max( cl_interp, (cl_interp_ratio != 0 ? cl_interp_ratio: 1) / cl_updaterate ), 0.5f)
And this on client side:
Code:

min( max( cl_interp, cl_interp_ratio / cl_updaterate ), 0.5f )
This means that any client with a cl_interp_ratio of 0 has a different lerp value being used locally than is stored on the server. Most servers don't allow interp_ratio 0, but low lerps are often used in competitive play, and this disconnect between client and server can cause massive registration issues, and may even be exploitable.

TODO:
  • Whatever people recommend.
  • Set a maximum/minim lerp value, and kick players that breach it. - Completed (max lerp only)
  • Maybe reduce the number of backend calculations for fixlerp 0 - Completed
  • Be a baller - Completed ahead of schedule

Change log:

Code:

0.8
    - sm_announce_lerp and sm_log_lerp can be set to 2 to only display/log lerp changes, not initial lerps (on connect)
    - sm_max_interp added to set a hard limit on the maximum lerp for clients, kicking when lerp is too high.
    - Bugfixes thanks to psychonic and Bacardi
    - Some small cosmetic fixes so lerp output is consistent
0.5
    - Fixed attempting lerp calculations on some invalid entities.
    - Changed lerp outputs to be only 1 decimal place to match net_graph.
0.4
    - Stopped some non-lerp changes from being announced
    - Got rid of some unnecessary calculations
    - Did some things that aren't acceptable to speak of in polite company
0.3
    - Initial release.

Latest source:
https://bitbucket.org/ProdigySim/mis...od-plugins/src (lerptrack)

McFlurry 02-05-2011 13:15

Re: [ANY] Lerp Tracker (and fixer!)
 
So this fixes the the "I walk around a corner and the guy shoots me and kills me even though I'm already around the corner in my perspective" thing?

ProdigySim 02-05-2011 13:18

Re: [ANY] Lerp Tracker (and fixer!)
 
Quote:

Originally Posted by McFlurry (Post 1407792)
So this fixes the the "I walk around a corner and the guy shoots me and kills me even though I'm already around the corner in my perspective" thing?

Nope, you can't fix that without turning off lag compensation (which is a bad idea).

This is something completely different which almost nobody cares about :|

McFlurry 02-05-2011 13:20

Re: [ANY] Lerp Tracker (and fixer!)
 
So what does it do by fixing the "see into the past" part?

ProdigySim 02-05-2011 13:36

Re: [ANY] Lerp Tracker (and fixer!)
 
Quote:

Originally Posted by McFlurry (Post 1407795)
So what does it do by fixing the "see into the past" part?

It doesn't do that (nor does it claim to).

Interpolation means mixing between a past gamestate and a current one to create smoother motion. Lerp settings set how far in the past players will look for their interpolation.

If I'm sitting with a Lerp of 0ms, I'm seeing only the most recent state I've received. Say I'm a tank in L4D. There's someone running away from me, and he's just out of my reach. I toggle my Lerp value to 100ms, and now the gamestate I'm seeing is further in the past. Both the client and the server are okay with this, and now my hits are calculated against the old gamestate. I've just gone into the past to get a punch I otherwise couldn't.

This helps mitigate that issue (in terms of cheating) by echoing, logging, tracking lerp changes. In tournament play, this is enough proof of cheating to overturn a match result.

Of course, I'm aware that most sourcemod users don't care about knowing that someone is cheating as much as they care about blocking it, so I'll probably update this with some other functionality.

coach 02-05-2011 19:08

Re: [ANY] Lerp Tracker (and fixer!)
 
Interesting plugin. I already have something that limits the use of Lerp but still interested in the progress of this plugin. Any testing on games with more than 8 clients? Much server load with queries? If it changes clients Lerp settings why the need for a kick ability?

McFlurry 02-05-2011 20:24

Re: [ANY] Lerp Tracker (and fixer!)
 
Ah, that is always an issue with tanks online. It sounds like a very nice plugin. :D

jasonfrog 02-06-2011 18:11

Re: [ANY] Lerp Tracker (and fixer!)
 
Interesting!

What would cause someone's lerp to change like this? TF2 server btw.
Code:

L 02/06/2011 - 23:05:41: [lerptracker.smx] ****'s LerpTime Changed from 15.00 to 33.33
L 02/06/2011 - 23:05:42: [lerptracker.smx] ****'s LerpTime Changed from 33.33 to 15.00
L 02/06/2011 - 23:06:23: [lerptracker.smx] ****'s LerpTime Changed from 15.00 to 33.33
L 02/06/2011 - 23:06:24: [lerptracker.smx] ****'s LerpTime Changed from 33.33 to 15.00
L 02/06/2011 - 23:07:03: [lerptracker.smx] ****'s LerpTime Changed from 15.00 to 33.33
L 02/06/2011 - 23:07:03: [lerptracker.smx] ****'s LerpTime Changed from 33.33 to 15.00
L 02/06/2011 - 23:07:08: [lerptracker.smx] ****'s LerpTime Changed from 15.00 to 33.33


ProdigySim 02-08-2011 12:39

Re: [ANY] Lerp Tracker (and fixer!)
 
Quote:

Originally Posted by coach (Post 1408084)
Interesting plugin. I already have something that limits the use of Lerp but still interested in the progress of this plugin. Any testing on games with more than 8 clients? Much server load with queries? If it changes clients Lerp settings why the need for a kick ability?

It doesn't query the clients for any settings, it simply reads the settings it has sent to the server. Load shouldn't be an issue, especially on 0.4.

This plugin only tries to fix client lerp on the server-side to match the client side. If we simply block changes to client lerp server-side, clients and servers will have a massive disconnect on what they think their lerp is. It wouldn't be a good idea.

Quote:

Originally Posted by jasonfrog (Post 1408859)
Interesting!

What would cause someone's lerp to change like this? TF2 server btw.
Code:

L 02/06/2011 - 23:05:41: [lerptracker.smx] ****'s LerpTime Changed from 15.00 to 33.33
L 02/06/2011 - 23:05:42: [lerptracker.smx] ****'s LerpTime Changed from 33.33 to 15.00
L 02/06/2011 - 23:06:23: [lerptracker.smx] ****'s LerpTime Changed from 15.00 to 33.33
L 02/06/2011 - 23:06:24: [lerptracker.smx] ****'s LerpTime Changed from 33.33 to 15.00
L 02/06/2011 - 23:07:03: [lerptracker.smx] ****'s LerpTime Changed from 15.00 to 33.33
L 02/06/2011 - 23:07:03: [lerptracker.smx] ****'s LerpTime Changed from 33.33 to 15.00
L 02/06/2011 - 23:07:08: [lerptracker.smx] ****'s LerpTime Changed from 15.00 to 33.33


I don't see a reason anything less than the client toggling their lerp would cause this. As I mentioned, some people script lerp changes for various bonuses.

Whist 02-09-2011 12:15

Re: [ANY] Lerp Tracker (and fixer!)
 
Nice plugin. I will check it out.


All times are GMT -4. The time now is 02:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.