SP Lags?

All other Source.Python topics and issues.
DJiSer
Junior Member
Posts: 20
Joined: Sat May 10, 2014 2:44 pm

SP Lags?

Postby DJiSer » Tue Mar 01, 2016 5:07 pm

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/
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Tue Mar 01, 2016 5:27 pm

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.
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

Postby D3CEPTION » Tue Mar 01, 2016 8:31 pm

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?
DJiSer
Junior Member
Posts: 20
Joined: Sat May 10, 2014 2:44 pm

Postby DJiSer » Wed Mar 02, 2016 4:05 am

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
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

Postby D3CEPTION » Wed Mar 02, 2016 7:45 am

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.
MrMalina
Member
Posts: 53
Joined: Mon Apr 08, 2013 2:40 pm
Location: Russian Federation

Postby MrMalina » Wed Mar 02, 2016 3:18 pm

Hello, I'm also have this problem. Here it is some video about this issue:
Attachments
Скриншот 2016-03-02 18.31.47.jpg
MrMalina
Member
Posts: 53
Joined: Mon Apr 08, 2013 2:40 pm
Location: Russian Federation

Postby MrMalina » Wed Mar 02, 2016 3:19 pm

Second video:
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Wed Mar 02, 2016 5:52 pm

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.
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Wed Mar 02, 2016 6:32 pm

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.
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Wed Mar 02, 2016 8:47 pm

I have implemented a few tweaks. With the new version (268 -- it's currently compiling) it should run much smoother.
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

Postby D3CEPTION » Wed Mar 02, 2016 9:28 pm

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.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Thu Mar 03, 2016 3:14 am

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.
Image
DJiSer
Junior Member
Posts: 20
Joined: Sat May 10, 2014 2:44 pm

Postby DJiSer » Thu Mar 03, 2016 4:07 am

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

Return to “General Discussion”

Who is online

Users browsing this forum: Bing [Bot] and 34 guests