View Full Version : DoD Shrikebot Disabler
TooLz
03-25-2007, 12:21 AM
In my endless search for the Shrikebot code to fix that horrible loop that tears my CPU usage up in my server, I decided to make this plugin to just stop the loop myself.
Description:
Disables the loop in Shrikebot by checking max_bots itself and sets it to 0 if the number of clients is greater than or equal to the number of your max_bots.
CVAR:
Currently set to 6, you can set it to whatever your max_bots are.
dod_shrikebot_maxbots
UPDATE 3-26-07:
1. Removed PLUGIN_HANDLED as it could cause problems with other plugins
possbily.
Cya
Stixsmaster
03-25-2007, 01:03 PM
nice job this seems very very nice as I said and well I shall give it a try and well yea thx for it...
---Stixsmaster
diamond-optic
03-25-2007, 08:31 PM
whats this loop your talking about?
i run shrikebot and dont notice any problems..
*edit*
i would suggest changing the return's from PLUGIN_HANDLED to PLUGIN_CONTINUE as if there are other plugins that need to do stuff in the authorize or disconnect (that are underneath this plugin).. they wont get called if this plugin sends the handled return...
i noticed you do:
PlayerCount++but then you do
PlayerCount -= 1why not just do PlayerCount-- ?? lol of course it doesnt really matter..
also.. simple suggestion but again not important really.. a pcvar could be added to the dod_shrikebot_maxbots cvar
TooLz
03-26-2007, 07:59 AM
Thanks, I'll fix those tonight and reupload. The problem with Shrikebot is that there is a loop, constantly checking to see if the max_bots has been met, even if there are 10 people in the server, and I have my max_bots set to 6, it still runs that loop every 10 seconds to see if it should bring in bots yet, so I made it easier, turn the loop off with a plugin until it needs to be turned back on.. Simple.. My server has higher CPU usage with 6 bots now than it did with 6 real people. lol
EDIT: Reuploaded. I've just had problems with pcvar's with my other mod so I have just been using cvars.
Cya
diamond-optic
03-26-2007, 11:33 AM
ahh ok...
hmm funny thing with my server.. i turned shrikebot completely off (unloaded completely) and i didnt notice any change in CPU usage over a couple days.. i was really amazed lol.. i totally expected an improvement..
also changing that shr cvar doesnt cause any problems on map change? whenever ive changed any of the shrikebot cvars mid-game thru rcon.. my server always crashed on the next mapchange...
TooLz
03-26-2007, 12:30 PM
Mines been running fine since I released it with it on it. Not sure why that would happen with yours :\
Also with whatever version of Linux my main server is running, it has 20-30% CPU Used with 6 bots.. I do shr max_bots 0, and instantly goes down to 0.01%.. When my server hits 6 players and turns bots off, it goes from 20-30% to about 6% - so it is worth it for servers like mine I guess.
Cya
diamond-optic
03-26-2007, 12:43 PM
damnit..
i just had a full server, and cpu usage was about 60% (thru rcon stats.. and thats usually what it is when its full)
so i typed shr max_bots 0 to see if it changed any..
made my server crash lol.. really pisses me off.. not often i have a full server in the morning during a weekday lol
TooLz
03-26-2007, 12:45 PM
Ouch, good reason for that though.
shr "max_bots 0"
Must have quotes, or it WILL crash the server.. lol - Shoulda gotta then to ya sooner, lol.
Cya
diamond-optic
03-26-2007, 12:48 PM
ohhh sob i knew that too lol crap...
i thought maybe it had to do with the way i run it..
i dont have it added thru the command line.. i have this:
localinfo mm_gamedll shrikebot/dlls/shrikebot_i386.so
in my autoexec.cfg file.. thought maybe loading it that way was making it act wierd
TooLz
03-26-2007, 12:57 PM
Thats how I run mine too, pretty much the only way to if you're running metamod with it.. lol
Cya
=|[76AD]|= TatsuSaisei
04-01-2007, 07:30 AM
Thanx for this idea... I never thought of the loop that checks the player count and with that in mind and you idea... things are a bit smoother now !! Thanx
TooLz
04-01-2007, 07:34 AM
No problem, I see a nice performance difference in my servers when running this plugin, guess its just good for the systems health when running bots to have, lol..
Cya
blazz
12-11-2007, 08:34 PM
The plugin is running, and bot shut down
but bots dont kick back on after server players go lower then 6?
any ideas on y?
blazz
12-11-2007, 09:06 PM
It seems to be working, but bots did not kick in untill there was only 3 players
but kicks off at 6, is there a delay for this?
TooLz
12-16-2007, 08:01 AM
There may be a slight delay, shouldn't be too much of one though.
Cya
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.