.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Enhancement Workshop > Metamod and metamod plugins
Metamod and metamod plugins Plugins and improvements for the metamod server-side mod

Reply
 
Thread Tools
Bug concerning "max_bots" in PODbot.cfg?
Old
  (#1)
>BKA< T Wrecks
Moderator [PBmm/Waypointing]& PODBot mm waypointer
 
>BKA< T Wrecks's Avatar
 
Status: Offline
Posts: 1,492
Join Date: Feb 2004
Location: C.C.A.A., Germania
Default Bug concerning "max_bots" in PODbot.cfg? - 17-02-2004

Hello Pierre-Marie; it's me again- boy, do I hate bothering you so much. I think it's about time for a new thread, because this time it's something totally different.
I just mailed the podbot_mm.dll etc. to my good friend and clanmate Rob, who tested it on a dedicated server.
He reported that the "max_bots" entry in his podbot.cfg is ignored by the PODBot dll. The rest of the podbot.cfg seems to work, but CS keeps trying to add a new bot until the server is full, totally disregarding the "max_bots" limit.
Now Rob has taken a look at the "dll.cpp" and found a suspicious entry: Most "for"-functions (or whatever you script experts call those thingies) are in brackets, but one that might be referring to the max_bots limit came without brackets. This is an excerpt from the original cpp:

// check if time to see if a bot needs to be created...
if (bot_check_time < gpGlobals->time)
{
int count = 0;

bot_check_time = gpGlobals->time + 5.0;

for (i = 0; i < 32; i++)
if (clients[i].pEntity != NULL)
count++;

// if there are currently less than the maximum number of
"players"
// then add another bot using the default skill level...
if ((count < max_bots) && (max_bots != -1))
BotCreate (NULL, NULL, NULL, NULL, NULL);
}

Now Rob suggested the code might have to look like this:

// check if time to see if a bot needs to be created...
if (bot_check_time < gpGlobals->time)
{
int count = 0;

bot_check_time = gpGlobals->time + 5.0;

for (i = 0; i < 32; i++)
{
if (clients[i].pEntity != NULL)
count++;
}

// if there are currently less than the maximum number of
"players"
// then add another bot using the default skill level...
if ((count < max_bots) && (max_bots != -1))
BotCreate (NULL, NULL, NULL, NULL, NULL);
}

Does that make sense to you or help in any way? If not, sorry for stealing your time...
  
Reply With Quote
Re: Bug concerning "max_bots" in PODbot.cfg?
Old
  (#2)
Terran
Member
 
Terran's Avatar
 
Status: Offline
Posts: 431
Join Date: Jan 2004
Default Re: Bug concerning "max_bots" in PODbot.cfg? - 17-02-2004

There is no functional difference. Brackets are only required if you want to handle multiple statements as one statement. But that's not the case here. You could write this as one single long line:

for (i = 0; i < 32; i++) if (clients[i].pEntity != NULL) count++;

Or you can write it like you might have learned at school:

for (i = 0; i < 32; i++) {
if (clients[i].pEntity != NULL) {
count++;
}
}

Sorry, but my english is too limited to explain it further at the moment and I'm out of cafe
  
Reply With Quote
Re: Bug concerning "max_bots" in PODbot.cfg?
Old
  (#3)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Bug concerning "max_bots" in PODbot.cfg? - 17-02-2004

I thought for the bot.cfg processing you should look at code there. There is a special function of that (BotProcessBotCFG ?). You should check if the max_bots variable is set. But you should also check if the max_bots variable is checked when adding bots and such.

I have seen in the HPB original template that this did not work 100%, so perhaps this is your problem. I totally rewrote parts to make it work.


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote
Re: Bug concerning "max_bots" in PODbot.cfg?
Old
  (#4)
>BKA< T Wrecks
Moderator [PBmm/Waypointing]& PODBot mm waypointer
 
>BKA< T Wrecks's Avatar
 
Status: Offline
Posts: 1,492
Join Date: Feb 2004
Location: C.C.A.A., Germania
Default Re: Bug concerning "max_bots" in PODbot.cfg? - 17-02-2004

Well, since I didn't try all that myself, I don't know how much Rob has already checked and how much not.
But he has some experience with scripts (albeit no C++ knowledge) and all the config stuff that's involved with server/client problems, mods and bots. So I don't think he has just forgotten to define a max_bots limit lower than the max. number of players. And if he did, I'll slap him!
Do I understand you correctly: There's other code that refers to the way the podbot dll processes the podbot.cfg? Yes, that may be...
Oh, and btw, how do you check if the max_bots entry is even checked on server startup? Is there some tool or function that monitors and logs all those cfg entries that are checked when a game is opened?
Man, I feel so stupid 'cause I don't know sh*t about all that scripting and coding stuff...
  
Reply With Quote
Re: Bug concerning "max_bots" in PODbot.cfg?
Old
  (#5)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Bug concerning "max_bots" in PODbot.cfg? - 17-02-2004

POD-bot does not do it this way. I just checked, the max_bots parsing is done correctly and the variable is filled with the right value. The problem might come from the function that counts the number of bots.

I've found the bug. It came that in the metamod plugin version, the metamod-specific call to MDLL_ClientPutInServer() we do in BotCreate() does NOT make our own ClientPutInServer() callback be called by metamod. Stefan, you should check this too in Realbot if you do something in ClientPutInServer() that affects your bots.

It's fixed. I also added code to make the bots use and buy the new weapons (Galil/Famas), and fix the CurWeapon network message STEAM-related issue. Austin just sent me his improved waypoint editor ; I will try to merge it with this podbot once I find time and soon you'll be able to get Markus' bot running around and shooting stuff in your STEAM servers once again.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Bug concerning "max_bots" in PODbot.cfg?
Old
  (#6)
>BKA< T Wrecks
Moderator [PBmm/Waypointing]& PODBot mm waypointer
 
>BKA< T Wrecks's Avatar
 
Status: Offline
Posts: 1,492
Join Date: Feb 2004
Location: C.C.A.A., Germania
Default Re: Bug concerning "max_bots" in PODbot.cfg? - 18-02-2004

Wow, that sounds great! A WP editor would save me the effort of changing between PB 2.5 and the metamod plugin to make / test waypoints!
Will this new version you're working at still support CS 1.5, though?
  
Reply With Quote
Re: Bug concerning "max_bots" in PODbot.cfg?
Old
  (#7)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Bug concerning "max_bots" in PODbot.cfg? - 18-02-2004

I'm testing it on CS 1.5 so I dare to believe there might be a very slight chance that it also works on CS 1.5, see



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Bug concerning "max_bots" in PODbot.cfg?
Old
  (#8)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Bug concerning "max_bots" in PODbot.cfg? - 20-02-2004

ooookay, finally I've merged Austin's famous waypoint editor in this podbot plugin, and I've fixed the remaining bugs you told me about. Is there anything else you need before I publish this thing ?

Perhaps I could also merge Wei Mingzhi's shield code...



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com