Raised This Month: $ Target: $400
 0% 

[ANY] Lerp Tracker (and fixer!)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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 - 4970 views - 5.7 KB)

    Last edited by ProdigySim; 04-20-2011 at 15:45. Reason: 0.8
    ProdigySim is offline
     



    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 12:39.


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