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

[CS:S/CS:GO] LagCompensation / 0 Ping


Post New Thread Reply   
 
Thread Tools Display Modes
Author
BotoX
Junior Member
Join Date: Sep 2015
Plugin ID:
6953
Plugin Version:
1.0.3
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    4 
    Plugin Description:
    Lag compensation for moving triggers and physboxes. (Lasers and bosses for example)
    Old 02-23-2020 , 13:20   [CS:S/CS:GO] LagCompensation / 0 Ping
    Reply With Quote #1

    What is lag compensation?
    https://developer.valvesoftware.com/...g_compensation
    https://developer.valvesoftware.com/...g_compensation

    Watch this: https://www.youtube.com/watch?v=6EwaW2iz4iA

    Okay, so why this plugin?
    The source engine has lag compensation for player entities ONLY.
    Anything else that's moving around in the server is NOT lag compensated.
    This plugin fixes this for the most part.

    It provides accurate and cheap (no interpolation between two snapshots) lag compensation for trigger_{hurt,push,teleport} and func_physbox* entities which are parented to moving entities.
    It does this automatically and avoids breaking

    How does it work?
    The plugin remembers the last 32 (configurable) states of up to 256 (configurable) entities.
    It keeps track if entities are actually moving and only compensates them if they are.
    There are barely any performance implications of running this plugin, especially because it also optimizes how triggers work. If a trigger is lag compensated it will not run any physics simulation any more.

    Usually a moving trigger would be actively scanning and touching any entity in its collision hull.
    To make lag compensation possible this is blocked with the PhysHooks extension and now only players will be touching triggers.
    Before a player is simulated, all (active/moving) entities are moved to where they are on their screen. This is done for each player.
    At the end of the player simulation loop the compensated entities are restored to their server state.
    After the entities have been simulated their parameters are recorded.

    Issues
    Moving platforms/trains are not lag compensated. If a trigger is parented to it, it will be lag compensated however.
    Imagine a thin platform with a kill trigger parented on the bottom of it. If a player stands on the platform and it moves up the trigger on the bottom will move through the platform, into the player and kill them.
    In this case you'll have to modify the map with something like stripper-source and add the no-lagcomp flag to the trigger.

    Only letting players touch triggers comes with some issues on CS:S however, if a player stops sending packets to the server they are not simulated at all any more. Hence they will not touch any triggers that move through them.
    CS:GO seems to have a fix for this in built. For CS:S I've included a plugin AntiLagSwitch which forces player simulation with empty packets after the server didn't hear from them for 16 ticks.

    Because source has no client side prediction of triggers and we can't cheat the laws of physics something else has to be delayed now: death.
    You play with 300ms ping and seemingly jump over a laser, only to die after it has already passed you.
    A smart player will obviously scream "fucking 0 ping botox you gamer-word" into the voice chat.
    A not-so-smart player will realize they made a mistake and it's just the information of their death which had to travel for 300ms before reaching them.

    3rd person and server demos view for players with lag compensation enabled will look weird, they will touch lasers on your screen but not die.
    This makes sense of course because on their screen they've jumped over the laser, that's the whole point of lag compensation.
    To get an accurate view of their screen the demo needs to be recorded in their client.

    Usage
    Install the DHooks + Detours extension: https://forums.alliedmods.net/showpo...&postcount=589
    Install the PhysHooks extension: https://forums.alliedmods.net/showth...09#post2684809
    Install the LagCompensation.smx into your plugins/ folder and LagCompensation.games.txt into your gamedata/ folder.

    If you want to avoid a trigger (or physbox) from being lag compensated by this plugin then you can add the value 1073741824 (1 << 30) to the spawnflags of the entity.

    Players can choose to effectively this plugin by using the commands: !lagcomp or !0ping
    (effectively: the plugin will always take the newest entity snapshot for those players, it will assume the player actually has 0 ping)

    Thanks to:
    All players and staff of UNLOZE Zombie Escape server.
    While developing this plugin there have been many bugs and weird things happening for weeks.
    Thanks for not pulling the plug and letting me continue working on this until all issues have been fixed.
    Special thanks to xen for a lot of help with testing and investigating issues.

    POSSESSION and ZombiEden for testing the CS:GO Win32 version and helping with windows signatures.

    Obviously the SourceMod project, without SourceMod most of our mods would be incredibly harder or outright not possible.

    Dr!fter and Pyschonic for DHooks + Detours.

    The leaked 2007 engine source code provided insight into the depths of the engine, PhysHooks makes heavy use of this.

    Video demonstration
    Don't jump as early as this guy:
    https://www.youtube.com/watch?v=ubZtbI0xCGE
    In the past you had to jump lasers very early depending on your ping and lerp, because there was no lag compensation.
    Now you'll just die because you fall into the laser.

    Git repository
    https://git.botox.bz/CSSZombieEscape...agCompensation

    Donations
    CS:GO Windows source code and builds have been released publicly after I've received donations in total of 200€.
    Supporting Windows requires a lot more effort, debugging it even more. It's also really stupid to run a Windows server when Linux causes a lot less trouble.
    https://paypal.me/BotoXbz
    50€ - Net4All.ru
    20€ - JAZE
    60€ - GFLClan.com
    65€ - Kxnrl
    70€ - Mapeadores.com
    Attached Files
    File Type: sp Get Plugin or Get Source (AntiLagSwitch.sp - 794 views - 2.5 KB)
    File Type: txt AntiLagSwitch.games.txt (248 Bytes, 749 views)
    File Type: smx AntiLagSwitch.smx (4.1 KB, 595 views)
    File Type: sp Get Plugin or Get Source (LagCompensation.sp - 513 views - 37.0 KB)
    File Type: txt LagCompensation.games.txt (5.4 KB, 575 views)
    File Type: smx LagCompensation.smx (33.3 KB, 536 views)

    Last edited by BotoX; 12-30-2020 at 15:26.
    BotoX is offline
    Groven
    AlliedModders Donor
    Join Date: Apr 2011
    Location: Sweden
    Old 02-23-2020 , 13:23   Re: [CS:S/CS:GO] LagCompensation / 0 Ping
    Reply With Quote #2

    Looks very interesting
    __________________
    Groven is offline
    extr1m725
    Member
    Join Date: Oct 2014
    Old 02-23-2020 , 13:43   Re: [CS:S/CS:GO] LagCompensation / 0 Ping
    Reply With Quote #3

    Sent 20 euros, thank you for the great plugin!
    extr1m725 is offline
    NanoC
    Veteran Member
    Join Date: Jan 2016
    Location: Argentina
    Old 02-23-2020 , 14:48   Re: [CS:S/CS:GO] LagCompensation / 0 Ping
    Reply With Quote #4

    Fantastic Botox!
    __________________
    NanoC is offline
    Send a message via Skype™ to NanoC
    Zeddy_god
    Senior Member
    Join Date: May 2015
    Location: Mumbai, India
    Old 02-23-2020 , 16:22   Re: [CS:S/CS:GO] LagCompensation / 0 Ping
    Reply With Quote #5

    Good stuff man! Thankyou for the release.
    __________________
    Zeddy_god is offline
    Syoudous
    Junior Member
    Join Date: Feb 2013
    Old 02-23-2020 , 17:15   Re: [CS:S/CS:GO] LagCompensation / 0 Ping
    Reply With Quote #6

    I'm not too familiar with Source innards but I do know CS:GO bloated itself with more lag compensation over the years. Do LagCompensate key values make no difference in a situation as is this on entities?
    Syoudous is offline
    BotoX
    Junior Member
    Join Date: Sep 2015
    Old 02-23-2020 , 18:42   Re: [CS:S/CS:GO] LagCompensation / 0 Ping
    Reply With Quote #7

    Quote:
    Originally Posted by Syoudous View Post
    I'm not too familiar with Source innards but I do know CS:GO bloated itself with more lag compensation over the years. Do LagCompensate key values make no difference in a situation as is this on entities?
    CS:GO indeed has an option to lag compensate other entities by the means of the LagCompensate FGD.
    However that probably only works on stuff you can shoot, definitely not triggers.
    I am not sure if any maps with moving bosses etc make use of that FGD and what happens when both are active.
    The plugin was made with CS:S in mind, so it doesn't take this into consideration (yet).
    I guess I could make the plugin check for that FGD and either remove the FGD or ignore the entity.
    Just hope that nobody set the FGD on moving triggers and then those are not lagcomped at all.
    BotoX is offline
    Syoudous
    Junior Member
    Join Date: Feb 2013
    Old 02-23-2020 , 19:21   Re: [CS:S/CS:GO] LagCompensation / 0 Ping
    Reply With Quote #8

    Quote:
    Originally Posted by BotoX View Post
    The plugin was made with CS:S in mind, so it doesn't take this into consideration (yet).
    I guess I could make the plugin check for that FGD and either remove the FGD or ignore the entity.
    Just hope that nobody set the FGD on moving triggers and then those are not lagcomped at all.
    Yeah, I understand that and I know CS:GO isn't totally your thing and this isn't something I looked into myself but I figured someone here (or the people testing your idea/stuff) would shed light on this if it actually has any effect at all. This is supported on all entities. If it is effective at all, I have not a clue. I never personally tested it nor really thought much of it.

    I do know L4D2 (which this game's engine at least partially uses) used it heavily for a lot of stuff than just NPC's.

    Last edited by Syoudous; 02-23-2020 at 19:23. Reason: L4D2 mention.
    Syoudous is offline
    694372459
    Member
    Join Date: Aug 2012
    Old 02-24-2020 , 02:03   Re: [CS:S/CS:GO] LagCompensation / 0 Ping
    Reply With Quote #9

    botox changed ze xd
    694372459 is offline
    BReeZ
    AlliedModders Donor
    Join Date: Feb 2013
    Location: Denmark
    Old 02-24-2020 , 07:24   Re: [CS:S/CS:GO] LagCompensation / 0 Ping
    Reply With Quote #10

    Trying to understand this plugin.
    So players playing on a server that is located far away (example: US player on an EU server) would normally have delay after entering a teleporter, or hit a triggerpush of sorts.

    Would this make it feel snappier, more instant?

    Similar to how valve added clientsided autobhop compared to the server sided laggy bhop plugins (CS:GO)?
    __________________
    BReeZ is offline
    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 04:14.


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