View Single Post
Modest Suggestion
Old
  (#1)
lewcamino
Guest
 
Status:
Posts: n/a
Default Modest Suggestion - 24-11-2004

First i want to say that i dont know anything about writing or even modifying bots. So take what you can from this post.

I noticed that when using reserved slots in admin-mod there is a bug in the code that calculates when to vacate a slot based on quota and maxplayers. Here is the section of code I think is causing the bug.

Code:
if (g_bBotAutoVacate)
{
if (botcount < g_iBotQuota && count < gpGlobals->maxClients - 1)
BotCreate(NULL, NULL, NULL, NULL, NULL, NULL);

if (count >= gpGlobals->maxClients)
UserKickRandomBot();
}
else
{
if (botcount < g_iBotQuota && count < gpGlobals->maxClients)
BotCreate(NULL, NULL, NULL, NULL, NULL, NULL);
}
The problem occures in a situation simalar to the following;
I have an 9 player server with 1 reserved slot. Thus 8 public slots. If quota is set to 6 and 2 humans connect,
count (now is still less than maxplayers (technically 9.) Ergo the server is full of 6 bots and 2 humans and will remain full until 1 human disconnects.
I dont know exactly how to write this but here is an example;

Code:
   
 if (g_bBotAutoVacate)
{
if (botcount < g_iBotQuota && count < gpGlobals->maxClients - (1 + admin_reserved_slots))
BotCreate(NULL, NULL, NULL, NULL, NULL, NULL);

if (count >= gpGlobals->maxClients - admin_reserved_slots)
UserKickRandomBot();
}
else
{
if (botcount < g_iBotQuota && count < gpGlobals->maxClients - admin_reserved_slots)
BotCreate(NULL, NULL, NULL, NULL, NULL, NULL);
}
I hope that helps, please let me know if that was helpful or if i just dont know enough to help.
Later; Lew
  
Reply With Quote