Raised This Month: $12 Target: $400
 3% 

[Tutorial] Some Quality Changes & Improvements in Source Engine


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xutax_Kamay
Member
Join Date: Feb 2016
Old 12-23-2021 , 14:45   [Tutorial] Some Quality Changes & Improvements in Source Engine
Reply With Quote #1

Hello,

I'm here just to describe some issues that some of you may be aware of,
but I would like to give some of my knowledge of what can be done to improve Source Engine games in general.
The issues/solutions discussed can be implemented in SP or any low-level language.
I am mainly focused on Surf Combat (in CS:S or CS:GO) servers, but I believe these fixes can also improve the whole Source Engine in general.

1) First biggest issue: network compression.
The Source Engine games have a huge problem with network compression, which makes in some situation the game unplayable because of prediction errors.
Before, when Source Engine was mostly done (around 2000s), we had very low bandwidth on modems so network compression was really important.

My idea is that Valve implemented probably their own method for compressing because compressing the whole packet wasn't enough,
so they implemented a compression method to send entity structures / networked variables over the network. (SendPropVector with proxy hooks with specified amount of bits, etc...)

But nowadays, I guess most of people have 1 megabyte/second of download at least and I don't think this method of compression is necessary anymore.

This was already discussed somewhere in this forum even though I knew about this earlier (https://forums.alliedmods.net/showthread.php?t=314962),
but it is possible to disable the compression in networked variables by setting sv_sendtables to 1 and
by invaliding the CRC check here: https://github.com/VSES/SourceEngine...lient.cpp#L835

Now as for why you want to do that,
atleast on specific variables is because you can remove the network compression on animation layers and angles, position etc. of an entity which results in better alignment between server and client hitboxes.

There's also the fact that we can remove the limits of m_vecBaseVelocity, so it can render this extension useless: https://forums.alliedmods.net/showthread.php?t=195008
it fixes also problems with trigger_push 'force' value to be more than -1000/1000 on each axis: https://github.com/ValveSoftware/sou...ayer.cpp#L7967

We can also remove the limits of m_fFlags in Source Engine / CS:GO which will fix push triggers that is demonstrated here: https://forums.alliedmods.net/showthread.php?t=267131
Please, do not use this plugin in your servers, it does not respect the physics of the game originally,
if you have been using it for a bhop/surf server you can be ready to remove all your times, as it invalidates all of them since physics changed (except if trigger_push wasn't used).

Now as for why it will fix it properly, it is because it is an issue with client prediction because of the network compression not sending the FL_BASEVELOCITY flag in first place,
so it doesn't apply m_vecBaseVelocity in the new origin and results in prediction issues.
See these references:

https://github.com/alliedmodders/hl2...ayer.cpp#L7983
https://github.com/alliedmodders/hl2...ayer.cpp#L7884
https://github.com/alliedmodders/hl2...c/const.h#L117

As you can see FL_BASEVELOCITY is after the limit of PLAYER_FLAG_BITS (which is 11 bits currently),
so the FL_BASEVELOCITY is never actually sent to the client and results in unsmooth movements due to client prediction issues.
It renders this calculation not even being executed in CS:GO (in fact it can't even call it even if FL_BASEVELOCITY flag is set due to FL_CONVEYOR being the 13th bit):
https://github.com/perilouswithadoll...tion.cpp#L1012

Worse, it sets the entity's base velocity to zero so it breaks totally the triggers, because now game movement code can not even process base velocity since it is zero in first place:
https://github.com/perilouswithadoll...tion.cpp#L1021

This was not an issue on CS:S or other Source Engine games because CheckMovingGround wasn't implemented yet.

Though there's still the fact that it executes this code in client side for all Source Engine games, when it should not:
https://github.com/alliedmodders/hl2...ared.cpp#L1815

Also, I must say that if you use these fixes, you server demos will be broken because sv_sendtables was an experimental feature and was never really properly implemented by Valve, but this can be fixed of course.
If I had a chance to work at Valve I would probably write the fix for it (or continue to work on it).

Fun fact, this experimental feature is vulnerable to a crash and can be probably exploited for a Remote Code Execution in both client - server side, but I did not investigate further either, have fun searching.

As a last final note, I have discussed here just some issues of the networked variables compression but there might be other issues that I may be not aware of and get magically fixed by removing variables compression.
I am done now kinda with the explanations of this first part, but you see why now every variables should be decompressed by default as it avoid the game to be a broken game in first place.
2) Not so big issues in lag compensation.
Besides pose parameters that are fixed now in CS:GO (not sure about CS:S and other games) thanks to Altimor,
there is some issues that Surf Servers will encounter,
First issue is the 1 tick delay in the local player's screen and the game's one due to interpolation and RunCommand logic which is known to public:
https://forums.alliedmods.net/showthread.php?t=315405

The second issue is the teleport check, which is known to hack vs hack coders because of fakelag, but maybe not other people:
https://github.com/ValveSoftware/sou...ation.cpp#L463

Although it may seem a good idea at first because it does not require the real logic to check when a player has teleported,
it breaks lag compensation when others players are going too fast in surf.
Remove that check, or implement a better one.

You might also increase the value of this check a bit or remove it completely so high ping players can hit accurately:
https://github.com/ValveSoftware/sou...ation.cpp#L390

A message to Surf Combat servers: Please dear God, do not use bigger hitboxes for God sake, this breaks the game, do not use it please, I'm begging you. Thanks.

There's also an issue with interpolation that breaks a bit lag compensation in this game that I need to investigate further,
but this can't be really fixed (don't take my word for it though, it may be fixable and I might correct this post further if I want to continue to investigate on that I like to solve impossible things)
as it is more a client side problem, though, I think it is because it uses Hermite interpolation rather than a simple linear interpolation (would need INTERPOLATE_LINEAR_ONLY I guess).

That is all for now, but I might edit this post for future fixes of Source Engine that is possible to do server side, don't hesitate also to share you knowledge.
I don't have really those issues solved by a plugin so I'm waiting some slaves to do it for me, if they can, it would be great for the community.
I can also do it if you pay me.
Ping me also if there is errors on my post, I'll correct them.

Cya!

Last edited by Xutax_Kamay; 02-17-2022 at 13:33. Reason: typo
Xutax_Kamay is offline
Nairdaa
Member
Join Date: Nov 2012
Old 12-24-2021 , 21:04   Re: [Tutorial] Some Quality Changes & Improvements in Source Engine
Reply With Quote #2

I love you, Kamay.
Nairdaa is offline
poggu
Junior Member
Join Date: Dec 2021
Old 01-03-2022 , 09:50   Re: [Tutorial] Some Quality Changes & Improvements in Source Engine
Reply With Quote #3

Thanks for this thread, I find this stuff really interesting and it's super fun for me to try out this stuff. I've made a test plugin doing few changes mentioned in this thread, here's the code and gamedata https://github.com/Poggicek/SendTable-Modifier . Everything works as explained however changing the m_vecBaseVelocity minimal value seems to make the camera go all crazy and not match players actual position, can be seen when shooting.
poggu is offline
brooks
Junior Member
Join Date: Oct 2020
Location: United States
Old 01-17-2022 , 00:25   Re: [Tutorial] Some Quality Changes & Improvements in Source Engine
Reply With Quote #4

I also wanted to point out that you should avoid buying HitReg Fix plugins for CS:GO if you don't know exactly how they work. A popular fix made by backwards that is ran on many Surf Combat and AWP Bhop servers includes models with large hitboxes and do not fix hit registration in any way.
Please remove these plugins/models from your server.
https://i.imgur.com/zsjc565.png

If you believe your server will have better hit registration with these models then take a look here: https://streamable.com/xx9qpu https://streamable.com/tr0ufc (NoSpread 100% Accuracy Enabled with hitboxes shown above)

Please feel free to correct me if any of my information is incorrect

All of the fixes above have been implemented into a sourcemod plugin + another fix for WantsLagCompensationOnEntity. Latest DHooks + Detours is required to run this plugin. (Thanks to D34DSpy for helping!)
https://github.com/br69ks/Hit-Registration-Fix

This fix will remove network compression from all variables as described in the first post: https://github.com/br69ks/Netvar-Compression-Remover

You should also include these fixes on your server as they can both improve hit registration and other issues related to Surf Combat:
https://forums.alliedmods.net/showthread.php?t=315405
https://github.com/GAMMACASE/PushFixDE

Last edited by brooks; 02-20-2022 at 23:33.
brooks is offline
skitzad
New Member
Join Date: Jan 2022
Old 01-18-2022 , 08:50   Re: [Tutorial] Some Quality Changes & Improvements in Source Engine
Reply With Quote #5

kamay goat
__________________
skitzad is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 02-13-2022 , 03:59   Re: [Tutorial] Some Quality Changes & Improvements in Source Engine
Reply With Quote #6

Quote:
Originally Posted by brooks View Post
I also wanted to point out that you should avoid buying HitReg Fix plugins for CS:GO if you don't know exactly how they work. A popular fix made by backwards that is ran on many Surf Combat and AWP Bhop servers includes models with large hitboxes and do not fix hit registration in any way.
Please remove these plugins/models from your server.
https://i.imgur.com/zsjc565.png

If you believe your server will have better hit registration with these models then take a look here: https://streamable.com/xx9qpu https://streamable.com/tr0ufc (NoSpread 100% Accuracy Enabled with hitboxes shown above)

Please feel free to correct me if any of my information is incorrect

All of the fixes above have been implemented into a sourcemod plugin + another fix for WantsLagCompensationOnEntity. Latest DHooks + Detours is required to run this plugin. (Thanks to D34DSpy for helping!)
https://github.com/br69ks/Hit-Registration-Fix

You should also include these fixes on your server as they can both improve hit registration and other issues related to Surf Combat:
https://forums.alliedmods.net/showthread.php?t=315405
https://github.com/GAMMACASE/PushFixDE
Your plugin just re-creates the field of view check for wantslagcompensation function and does it in a very poor way, also increases the max teleport distance for lag comp. My plugin already does this (better) and many more things you are missing. Larger hitboxes are required in some scenarios to resolve the missing client interpolation issues. Don't tell people to remove plugins from thier servers created by someone else who actually knows what they are doing.
backwards is offline
brooks
Junior Member
Join Date: Oct 2020
Location: United States
Old 02-17-2022 , 08:35   Re: [Tutorial] Some Quality Changes & Improvements in Source Engine
Reply With Quote #7

Quote:
Originally Posted by backwards View Post
Your plugin just re-creates the field of view check for wantslagcompensation function and does it in a very poor way, also increases the max teleport distance for lag comp. My plugin already does this (better) and many more things you are missing. Larger hitboxes are required in some scenarios to resolve the missing client interpolation issues. Don't tell people to remove plugins from thier servers created by someone else who actually knows what they are doing.
From what I've seen your plugin just fixes the first issue, but none of the others. Maybe you've updated it since then, but many servers are still running the old version. The larger hitboxes don't fix any issues with interpolation, it just makes people think their shots are more accurate . It also breaks damage on shotguns and triggers on maps. Also you should know selling plugins and providing closed source plugins is a big nono .

What this looks like in-game: https://youtu.be/V3Zz-s2zqlE

Last edited by brooks; 02-17-2022 at 08:44.
brooks is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 02-17-2022 , 17:25   Re: [Tutorial] Some Quality Changes & Improvements in Source Engine
Reply With Quote #8

Quote:
Originally Posted by brooks View Post
From what I've seen your plugin just fixes the first issue, but none of the others. Maybe you've updated it since then, but many servers are still running the old version[/url]
Ever since the original version of the hit registry plugin i wrote it has fixed all the issues in your public release. It uses simpler logic to just always lag compensate all players, rather then trying to check if someone is visible within fov or far away based on being teleported. Which your plugin is trying to do but still will fail in situations and is just wasted cpu cycles.

Quote:
Originally Posted by brooks View Post
The larger hitboxes don't fix any issues with interpolation, it just makes people think their shots are more accurate .
You aren't even aware of the interoplation issues that mostly affect high velocity game play. When clients send user commands to the server they just include tick_count for the server to backtrack players to previous points in history. This information lacks frame data. If a server is running at 100 tickrate and the client has 300 fps then he will see 2 extra frames with interpolation of the enemys postion that never actually exist on a server side tick. Thus the server can't teleport the player to the correct frame out of the 3 and just uses the closest tick which leads to many missed shots.

This is what a server would see at 64 tick rate and a player flying at max velocity:


This is what a client would see with client side interpolation at 300 fps:


If you increase the tickrate on the server to 128 it would have double the accuracy but its still not good enough for players with higher fps then the servers tickrate:


The only real solution a dedicated server can use to solve this interpolation issue from the missing client attack frame is to account for all of the missing 2 frames out of 3 (from this examples 100 tick and 300fps):


Simply increasing the hitbox size with the players velocity dynamically will cover the missing gaps and help reduce the interpolation issue which is the only way possible without modifying client files.

Quote:
Originally Posted by brooks View Post
It also breaks damage on shotguns and triggers on maps.
Triggers wouldn't break as updating the hitbox between a OnStartLagCompensation and OnFinishLagCompensation would have no vphysics checks for triggers. Shotguns would work the same way as well.

Quote:
Originally Posted by brooks View Post
Also you should know selling plugins and providing closed source plugins is a big nono .
All plugins I'm commissioned for and sale always include full source code if it's written in source pawn or not. It appears you just like to make things up?

Quote:
Originally Posted by brooks View Post
What this looks like in-game: https://youtu.be/V3Zz-s2zqlE
This video appears to be someones plugin just trying to mimic my plugin with the same mindset you had. Just making extremely large hitboxs without accounting for velocity or distance from attacker to victim.

Not sure why you are spreading false information but you should worry about fixing your own plugins before calling out others while making assumptions. You are missing many things that can increase hit registry in csgo.
backwards is offline
brooks
Junior Member
Join Date: Oct 2020
Location: United States
Old 02-17-2022 , 18:31   Re: [Tutorial] Some Quality Changes & Improvements in Source Engine
Reply With Quote #9

Quote:
Originally Posted by backwards View Post
Ever since the original version of the hit registry plugin i wrote it has fixed all the issues in your public release. It uses simpler logic to just always lag compensate all players, rather then trying to check if someone is visible within fov or far away based on being teleported. Which your plugin is trying to do but still will fail in situations and is just wasted cpu cycles.
Right, always lag compensating all players every time will definitely be better for performance. Even if my modified function fails (which it shouldn't because I tested it), it will use the original code as a backup just in case that returns true.


Quote:
Originally Posted by backwards View Post
You aren't even aware of the interoplation issues that mostly affect high velocity game play. When clients send user commands to the server they just include tick_count for the server to backtrack players to previous points in history. This information lacks frame data. If a server is running at 100 tickrate and the client has 300 fps then he will see 2 extra frames with interpolation of the enemys postion that never actually exist on a server side tick. Thus the server can't teleport the player to the correct frame out of the 3 and just uses the closest tick which leads to many missed shots.
There are other solutions to improving some factors of interpolation, read the first post .


Quote:
Originally Posted by backwards View Post
Triggers wouldn't break as updating the hitbox between a OnStartLagCompensation and OnFinishLagCompensation would have no vphysics checks for triggers. Shotguns would work the same way as well.
You can test this on surf_greatriver_xdre4m, the bug was very well known, which allowed players to hit the trigger_teleport underneath of the jail when they were lag compensated (which they could easily do to themselves).
Also since the hitboxes are larger, more pellets will hit when they aren't supposed to, allowing sniping and more damage with shotguns.

Quote:
Originally Posted by backwards View Post
All plugins I'm commissioned for and sale always include full source code if it's written in source pawn or not. It appears you just like to make things up?
https://i.imgur.com/lo5vsvY.png
https://i.imgur.com/M66dk64.png > Proof that people have not been able to receive source code from you.
https://i.imgur.com/1Qlx0bm.png
https://i.imgur.com/aoP2T1J.png - Proof that the fix was made specifically for the server in the video and sold to other servers secondhand.


Quote:
Originally Posted by backwards View Post
This video appears to be someones plugin just trying to mimic my plugin with the same mindset you had. Just making extremely large hitboxs without accounting for velocity or distance from attacker to victim.
You were literally paid to be a full time developer for the server played on in the video... I don't think that someone else developed that plugin.

Last edited by brooks; 02-17-2022 at 19:02.
brooks is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 02-17-2022 , 19:54   Re: [Tutorial] Some Quality Changes & Improvements in Source Engine
Reply With Quote #10

Quote:
Originally Posted by brooks View Post
Right, always lag compensating all players every time will definitely be better for performance. Even if my modified function fails (which it shouldn't because I tested it), it will use the original code as a backup just in case that returns true.
The original code that checks for FOV is ment for low velocity gameplay and also is just as bad as your reproduction. What you really want is to lag compensate all enemy players all of the time. The performance would be negligible as it just restores variables for previous postions/rotation/animations ect. You creating a poor version of the already bad design for high velocity modes is just silly when you are trying to fix lag compensation.

Quote:
Originally Posted by brooks View Post
There are other solutions to improving some factors of interpolation, read the first post .
The 2 solutions you recommended by other people aren't aplicable. Push fix may help solve interpolation issues while on fast booster ramps, but that is a rare case to fix and isn't going to improve a whole lot. The 1 tick bullet displacement wont really matter if the tick_count method is still used without frametime data for when the player shot his weapon. You are you just going to move the player forwards and shift the problem that still exists. This patch also introduces horrible ghost knives that never hit the enemy player. These 2 will not solve the interpolation issues i explained in the post above. You should read it again.

Quote:
Originally Posted by brooks View Post
You can test this on surf_greatriver_xdre4m, the bug was very well known, which allowed players to hit the trigger_teleport underneath of the jail when they were lag compensated (which they could easily do to themselves).
Also since the hitboxes are larger, more pellets will hit when they aren't supposed to, allowing sniping and more damage with shotguns.
The bug you are refering to is when player models arent installed correctly on the server. So clients are seen as giant red and black error boxes and touch triggers they normally wouldn't. This would also explain what you showed in that old video. When server owners switch servers and forget to install the assets, this could happen.

Quote:
Originally Posted by brooks View Post
https://i.imgur.com/lo5vsvY.png
https://i.imgur.com/M66dk64.png > Proof that people have not been able to receive source code from you.
https://i.imgur.com/1Qlx0bm.png
https://i.imgur.com/aoP2T1J.png - Proof that the fix was made specifically for the server in the video and sold to other servers secondhand.
Two of these are the same guy. `Wunka` and `dark elmo` share the same dedicated box. So this is just 1 instance which isn't accurate as i just had access to the dedicated server and wrote plugins for free in my spare time and installed them on the servers. There was no purchase of this plugin nor did i distribute the plugin which required including source code. This was an actively development server i uploaded plugins to I was writing directly for testing.

The `case` guy didn't even buy the plugin from me. It appears he was just given the .smx file from someone else that bought it. That's why he has no source code and asks if you can just decompile the smx he sent you (which you also didn't pay for).

Quote:
Originally Posted by brooks View Post
You were literally paid to be a full time developer for the server played on in the video... I don't think that someone else developed that plugin.
I was never paid full time by any community though? It's amazing how you know more about me then I do. Almost like you are making things up ¯\_(ツ)_/¯

Last edited by backwards; 02-17-2022 at 20:36.
backwards 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 02:07.


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