Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

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


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
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.

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.

POSSESSION Zombie Escape version for testing the CS:GO Win32 version and helping with 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.

Donations
CS:GO Windows source code and builds will be released 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

Attached Files
File Type: sp Get Plugin or Get Source (LagCompensation.sp - 36.7 KB)
File Type: txt LagCompensation.games.txt (4.4 KB)
File Type: smx LagCompensation.smx (36.6 KB)
File Type: sp Get Plugin or Get Source (AntiLagSwitch.sp - 2.5 KB)
File Type: txt AntiLagSwitch.games.txt (248 Bytes)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

×
×
  • Dodaj nową pozycję...