PDA

View Full Version : COD2 core utilization problem



croat1986
16th November 2018, 19:09
Linux VPS COD2 core utilization problem

CPU core load in not equaly devided / utilized on all 3 cores.

That makes my server LAG and cause high PING when i have more than 20 players on server running COD2 eXtreme 2.9 mod.

https://i.imgur.com/3CFXvaE.png





On Ubuntu 14 and 16

I downloaded gcc 3.3 from here http://icculus.org/updates/cod/gcc3-libs.tar.bz2



First try: No 1.


Manualy installed - unpacked that file and puted it to location on VPS: /usr/lib

started COD2 wit this command
nice -n 0 ./cod2_lnxded +set dedicated 2 +set net_port 28960 +set fs_game extreme2.9 +set sv_punkbuster 0 +exec server.cfg




Second try: No 2.


Putted and extracted gcc 3.3 files to the same folder where i have cod2_lnxded

Started COD2 with this command
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./cod2_lnxded +set dedicated 2 +set net_port 28960 +set fs_game extreme2.9 +set sv_punkbuster 0 +exec server.cfg




Third try: No 3.



sudo dpkg --add-architecture i386

sudo apt-get update

sudo apt-get -y install libstdc++5:i386

COD2 starts but i always have same problem with cores:

... just 1 of 3 cores is utilized , second and third core is in iddle state, doing almost nothing..


On NFO VPS (OS: Debian 7 Arch: x86_64 (64bit) Kernel: 3.2.2-am64) https://www.nfoservers.com that i had before

it worked perfectly (all 3 cores had equal load on them), but now i can't make it work on new VPS.

https://i.imgur.com/UTuLUHO.png

kung foo man
16th November 2018, 19:21
Yes, every lnxded server only runs in 1 thread and there isn't much you can do about it (besides learning libcod and rewrite it for multithread support e.g.)

I'm not sure, but I guess the player-player-collision is what causes lots of CPU stress. The algorithm is totally stupid, like testing each player against every other player... might be possible to just deactivate player-player collision via libcod and tell us if that works.

Another possibility: optimize .gsc scripts... you could add another scripting engine running in a 2nd thread like Duktape/JavaScript.

Whatever you decide for, there is no easy road I guess, all takes some work to master.

croat1986
16th November 2018, 19:38
I tought that you ll say exactly that ...

COD 2 camed out 6 month after first dual (multi) - core CPU was made.

And as always software is always in delay with hardware ...

Even now may programs and games are using only 1 Core - Thread ... for example: Word of Warcraft


But how the f... hell it was working on NFO on their VPS on all cores ... ???

https://i.imgur.com/UTuLUHO.png


I recompiled vorons libcod form here https://github.com/voron00/libcod

But ... I don't know how to deactivate player-player collision via libcod ...

kung foo man
16th November 2018, 20:33
I don't know what voron did with this function, can't find in his repo, but in my repo you just use this function: https://github.com/kungfooman/libcod/blob/master/gsc.cpp#L255



disableGlobalPlayerCollision();

croat1986
16th November 2018, 20:48
How and where do i put that command ?

kung foo man
16th November 2018, 20:59
You just call it anywhere, as often as you like (just call in gametype init once e.g.)

There are also threads about it in the forum, just try google

https://www.google.com/search?q=disableGlobalPlayerCollision+site%3Akillt ube.org

Mitch
17th November 2018, 06:55
I don't know what voron did with this function, can't find in his repo, but in my repo you just use this function: https://github.com/kungfooman/libcod/blob/master/gsc.cpp#L255



disableGlobalPlayerCollision();


You can use it now via the cvar 'g_playerCollision' located in https://github.com/voron00/libcod/blob/master/libcod.cpp.