Page 1 of 1

SP Lags?

Posted: Tue Mar 01, 2016 5:07 pm
by DJiSer
CS:GO Windows, SP Build #265(Clear SP - no plugins), SM 1.7 - build 5298


When i stay on 30+ weapons, server got heavy lags.
http://images.akamai.steamusercontent.com/ugc/548682046894335610/5CA88DA551548D1361F2E6E12A5AC8512940C799/


It's all ok with 90+ weapons without sp:
http://images.akamai.steamusercontent.com/ugc/548682046894335035/0791DBA01AD486F8DF65CD2A87644463EFC67149/

Posted: Tue Mar 01, 2016 5:27 pm
by Ayuto
My first guess would be that a bump_weapon hook causes the lags. But you are saying no plugins are loaded and SP doesn't hook bump_weapon (currently).
Currently, SP only hooks 4 functions, but all of them don't get triggered by standing on a weapon.

Posted: Tue Mar 01, 2016 8:31 pm
by D3CEPTION
DJiSer wrote:When i stay on 30+ weapons, server got heavy lags.


did you spawn the same entity type? if you say, you spawned without sp, how did you spawn them?

Posted: Wed Mar 02, 2016 4:05 am
by DJiSer
Same on Linux Server, If my server online 20+, var start jumping beetwen 2-50.
Someone can test?

D3CEPTION wrote:did you spawn the same entity type? if you say, you spawned without sp, how did you spawn them?

sv_cheats 1
give weapon_m4a1

Posted: Wed Mar 02, 2016 7:45 am
by D3CEPTION
your problem has nothing to do with sp, its engine bound.

calculating the player location causes lags, when its bounding box is touching too many collision faces.
if you drop weapon entities under your player entity the calculation for vphysics will get slower with every addition.

if you use a local server, the lag only happens a little later, because faster data transmission compensates the lag, as client and server are basically the same then.

Posted: Wed Mar 02, 2016 3:18 pm
by MrMalina
Hello, I'm also have this problem. Here it is some video about this issue:

Posted: Wed Mar 02, 2016 3:19 pm
by MrMalina
Second video:

Posted: Wed Mar 02, 2016 5:52 pm
by Ayuto
D3CEPTION wrote:your problem has nothing to do with sp, its engine bound.

calculating the player location causes lags, when its bounding box is touching too many collision faces.
if you drop weapon entities under your player entity the calculation for vphysics will get slower with every addition.

if you use a local server, the lag only happens a little later, because faster data transmission compensates the lag, as client and server are basically the same then.

While it's true that more calculations require more resources, it's not true that SP isn't at fault here. DJiSer said everything is working fine without SP being loaded. So, it likely has something to do with SP.

I will do some tests on my own to figure out what's wrong here and get back to you.

Posted: Wed Mar 02, 2016 6:32 pm
by Ayuto
Okay, I have narrowed down the issue. It is caused by one of our hooks. When standing on a weapon the entity output "OnCacheInteraction" is getting fired. So, if you are not using the OnEntityOutput listener, you can disable the hook for now by simply commenting out/removing this line:
https://github.com/Source-Python-Dev-Team/Source.Python/blob/a228817cc60dad36674562a08c278ad6f304c994/addons/source-python/packages/source-python/listeners/_entity_output.py#L40

This will temporarily fix the performance issues until we have implemented a better solution.

Posted: Wed Mar 02, 2016 8:47 pm
by Ayuto
I have implemented a few tweaks. With the new version (268 -- it's currently compiling) it should run much smoother.

Posted: Wed Mar 02, 2016 9:28 pm
by D3CEPTION
there are two issues here and the collisionlags are definately not due to sp, even though ayuto said they are xD
Ayuto wrote:While it's true that more calculations require more resources, it's not true that SP isn't at fault here.


Ayuto wrote:When standing on a weapon the entity output "OnCacheInteraction" is getting fired

to avoid performanceleaks with "OnCacheInteraction" a dev could modify the hook to disable for slots that the caller already carries through "itempickup" and "itemdrop" event.

Posted: Thu Mar 03, 2016 3:14 am
by satoon101
Those fixes certainly seem to be working for my testing. Awesome work, Ayuto!! Please verify and let us know if they work for you, DJiSer and MrMalina.

Posted: Thu Mar 03, 2016 4:07 am
by DJiSer
satoon101 wrote:Those fixes certainly seem to be working for my testing. Awesome work, Ayuto!! Please verify and let us know if they work for you, DJiSer and MrMalina.

New build works fine.
Ayuto wrote:I have implemented a few tweaks. With the new version (268 -- it's currently compiling) it should run much smoother.

Thank you very much for fixing this issue :cool: .