Raised This Month: $32 Target: $400
 8% 

[ANY] Lerp Tracker (and fixer!)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ProdigySim
SourceMod Plugin Approver
Join Date: Feb 2010
Plugin ID:
2211
Plugin Version:
0.5
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Tracks player interpolation (lerp) values, announces/logs changes, and can fix server-side lerp for low values
    Old 02-05-2011 , 12:34   [ANY] Lerp Tracker (and fixer!)
    Reply With Quote #1

    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)
    Attached Files
    File Type: sp Get Plugin or Get Source (lerptracker.sp - 4920 views - 5.7 KB)

    Last edited by ProdigySim; 04-20-2011 at 15:45. Reason: 0.8
    ProdigySim is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 02-05-2011 , 13:15   Re: [ANY] Lerp Tracker (and fixer!)
    Reply With Quote #2

    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?
    __________________
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    ProdigySim
    SourceMod Plugin Approver
    Join Date: Feb 2010
    Old 02-05-2011 , 13:18   Re: [ANY] Lerp Tracker (and fixer!)
    Reply With Quote #3

    Quote:
    Originally Posted by McFlurry View Post
    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
    ProdigySim is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 02-05-2011 , 13:20   Re: [ANY] Lerp Tracker (and fixer!)
    Reply With Quote #4

    So what does it do by fixing the "see into the past" part?
    __________________
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    ProdigySim
    SourceMod Plugin Approver
    Join Date: Feb 2010
    Old 02-05-2011 , 13:36   Re: [ANY] Lerp Tracker (and fixer!)
    Reply With Quote #5

    Quote:
    Originally Posted by McFlurry View Post
    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.
    ProdigySim is offline
    coach
    SourceMod Donor
    Join Date: Jun 2008
    Old 02-05-2011 , 19:08   Re: [ANY] Lerp Tracker (and fixer!)
    Reply With Quote #6

    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?
    coach is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 02-05-2011 , 20:24   Re: [ANY] Lerp Tracker (and fixer!)
    Reply With Quote #7

    Ah, that is always an issue with tanks online. It sounds like a very nice plugin.
    __________________
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    jasonfrog
    Senior Member
    Join Date: Mar 2008
    Old 02-06-2011 , 18:11   Re: [ANY] Lerp Tracker (and fixer!)
    Reply With Quote #8

    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
    jasonfrog is offline
    ProdigySim
    SourceMod Plugin Approver
    Join Date: Feb 2010
    Old 02-08-2011 , 12:39   Re: [ANY] Lerp Tracker (and fixer!)
    Reply With Quote #9

    Quote:
    Originally Posted by coach View Post
    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 View Post
    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.
    ProdigySim is offline
    Whist
    Member
    Join Date: Sep 2010
    Old 02-09-2011 , 12:15   Re: [ANY] Lerp Tracker (and fixer!)
    Reply With Quote #10

    Nice plugin. I will check it out.
    __________________
    Whist is offline
    Send a message via AIM to Whist
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 06:44.


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