.:: 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 ::. > Cyborg Factory > POD-Bot mm > Bug Reports
Bug Reports Post any bug you experience with the latest release of this bot here

Reply
 
Thread Tools
explanation on the changelevel issue
Old
  (#1)
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 explanation on the changelevel issue - 26-04-2004

OK, from what I've read in some other thread I believe an explanation on the "changelevel" command issue with bots is needed.

"changelevel" is an engine command.

When you type it into the console, it goes DIRECTLY to the engine. It does NOT pass through the bot DLL and the bot DLL has NO means to know that this command has been entered.

Since the engine kicks all the bots automatically before each "changelevel", the bot DLL must then "prepare" the bots to be respawned on the next round. That's because if players are respawned automatically, bots are not. It's a different code inside the engine.

But SINCE the bot DLL has no means to know when a "changelevel" command is issued, the bot DLL can't prepare the bots to be respawned when they get kicked by the engine.

That's why the bots don't respawn in the next map when you use the "changelevel" command.

On the other hand, the "map" command does not go directly to the engine, it passes through the bot DLL first. Hence the bot DLL *KNOWS* when you're about to change level using the "map" command.

That's why the bots respawn in the next map correctly when you use the "map" command.

On the other hand it appears that the "map" command make external players disconnect when you change levels. That's because the "map" commands cleanly shuts down and restarts the server, COMPLETELY, whereas the "changelevel" command does NOT reset everything in order to allow players to stay connected. This is unclean, but that's unfortunately what all the dedicated server admins do to force a level change.

Get it right : Changelevel WORKS, but it's an UNCLEAN and UNSAFE command.
The more you use it, the more chances you get that your server crashes randomly after some time.

I've just been hacking around the bot again to try to make the bot "guess" when a changelevel command has been entered, but it's a NASTY, WICKED, KLUDGEY, UGLY hack. I don't even know if it works. I'll probably update the bot DLL today again.

Keep in mind that despite the fact that every server admin uses it happily on a daily basis, changelevel was meant originally to be a SINGLE-PLAYER command.



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: explanation on the changelevel issue
Old
  (#2)
SoUlFaThEr
Moderator
 
SoUlFaThEr's Avatar
 
Status: Offline
Posts: 860
Join Date: Mar 2004
Default Re: explanation on the changelevel issue - 26-04-2004

i dont understand why people have a problem using our BOT menu commands for fill server with bots.......after a changelevel command

why does it HAVE TO replace all the bots automatically anyway??


  
Reply With Quote
Re: explanation on the changelevel issue
Old
  (#3)
>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: explanation on the changelevel issue - 27-04-2004

Yes, that's a good example of how things that are totally unimportant to oneself can be so important for others... I even removed all addbot lines from the cfg and ALWAYS added bots via the menu. But hey, if it's one of those little things that makes some fellows happy and increases the popularity of this bot... Others may wonder what all the fuss about the WP editor is about, although it's very important to you and me.



Roses are #FF0000, violets are #0000FF // all my base, are belong to you.

  
Reply With Quote
Re: explanation on the changelevel issue
Old
  (#4)
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: explanation on the changelevel issue - 27-04-2004

Mainly people who run bots on a DEDICATED server may be interested in this feature.

I've updated the bot again. I've put in a hack to make the bots be added from the config file after a changelevel command. But I don't guarantee this command will not cause problems in the future ! In short: if it works, fine. If it doesn't, don't complain.

I've also modified the way the addbot code works so that bot skills are displayed when you enter the bot names manually. I had to change a few things. I hope it will make KWo happy at last.



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: explanation on the changelevel issue
Old
  (#5)
[NvT]_KaszpiR_
Member
 
[NvT]_KaszpiR_'s Avatar
 
Status: Offline
Posts: 322
Join Date: Apr 2004
Default Re: explanation on the changelevel issue - 28-04-2004

okay, interesting and helpful explanation.
Then, what happends when the timelimit is reached?
because i have noticed that making mp_timelimit 1 is sometimes better than changelevel command
(of course in server.cfg i got mp_timelimit 20)
  
Reply With Quote
Re: explanation on the changelevel issue
Old
  (#6)
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: explanation on the changelevel issue - 28-04-2004

when the time limit is reached it's the GAME DLL which decides of the level change, not the engine. The game DLL thus tells the engine about the level change, by calling ServerDeactivate() properly, followed by a new ServerActivate(). Then the engine executes the level change, *upon GameDLL command* (and not by itself). Since the game DLL calls them in the engine, our bot DLL can hook them.

Were it the engine only, that decided to change maps, not only the server would be shutdown abruptly (because the game DLL wouldn't even be told), but we couldn't even hook it since nothing from the process passes through the bot DLL.



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: explanation on the changelevel issue
Old
  (#7)
Huntkillaz
Member
 
Huntkillaz's Avatar
 
Status: Offline
Posts: 594
Join Date: Mar 2004
Location: Middle Earth (New Zealand)
Default Re: explanation on the changelevel issue - 28-04-2004

Quote:
Originally Posted by SoUlFaThEr
i dont understand why people have a problem using our BOT menu commands for fill server with bots.......after a changelevel command

why does it HAVE TO replace all the bots automatically anyway??
is there a way to dectect a level has been changed..ie not through the dll but maybe a diffrence in the map or a restart in the map?


●_•

Last edited by Huntkillaz; 28-04-2004 at 22:58..
  
Reply With Quote
Re: explanation on the changelevel issue
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: explanation on the changelevel issue - 29-04-2004

yes, we CAN detect that a level has been changed, and this without problems ; however the tricky part is to recall WHICH bots were on the server before the map change occured.

It would be much more simple if the server was telling us that it's bringing the map down. Then we save the bots for next time, load the new map, and slap the bots back in. Just like what we do when it's the game DLL and not the engine that decides a level change.

We could eventually save all of the bot's parms each frame in a backup structure, preventively, but that would be ugly.



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: explanation on the changelevel issue
Old
  (#9)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: explanation on the changelevel issue - 29-04-2004

PMB - I'm not a coder, so maybe my suggestion is stupid, but maybe is the way to find solution...

What I can see in my log files (on listenserver) after changelevel commands:

L 04/29/2004 - 01:44:01: [STATSME] "KWo<1><4294967295><CT>" triggered "latency" (ping "37")
L 04/29/2004 - 01:44:01: [STATSME] "KWo<1><4294967295><CT>" triggered "time" (Time "0:33")
L 04/29/2004 - 01:44:01: [STATSME] Saving statsme rank (file "cstrike\addons\statsme\statsme.log") (game "cstrike") (version "14")

L 04/29/2004 - 01:44:02: [META] ini: Begin re-reading plugins list: d:/cs/cstrike/addons/metamod/plugins.ini
L 04/29/2004 - 01:44:02: [META] ini: Read plugin config for: ClanMod
L 04/29/2004 - 01:44:02: [META] ini: Read plugin config for: STATSME
L 04/29/2004 - 01:44:02: [META] ini: Read plugin config for: POD-Bot
L 04/29/2004 - 01:44:02: [META] ini: Read plugin config for: BotAim
L 04/29/2004 - 01:44:02: [META] ini: Finished reading plugins list: d:/cs/cstrike/addons/metamod/plugins.ini; Found 4 plugins
L 04/29/2004 - 01:44:02: [META] dll: Updating plugins...
L 04/29/2004 - 01:44:02: [META] dll: Finished updating 4 plugins; kept 4, loaded 0, unloaded 0, reloaded 0, delayed 0
L 04/29/2004 - 01:44:02: "KWo<1><4294967295><CT>" disconnected
L 04/29/2004 - 01:44:02: World triggered "Round_Draw" (CT "0") (T "0")
L 04/29/2004 - 01:44:02: World triggered "Round_End"
L 04/29/2004 - 01:44:02: Log file closed

L 04/29/2004 - 01:44:02: Log file started (file "D:\CS\cstrike\logs\L0429001.log") (game "cstrike") (version "46/1.1.1.0/2056")
L 04/29/2004 - 01:44:02: Loading map "de_bridge"
L 04/29/2004 - 01:44:02: Server cvars start
L 04/29/2004 - 01:44:02: Server cvar "mp_logfile" = "1"
L 04/29/2004 - 01:44:02: Server cvar "deathmatch" = "1"
L 04/29/2004 - 01:44:02: Server cvar "coop" = "0"

In the first part I can see re-reading plugins list by metamod - it means metamod knows this, that the changelevel command is executed. So maybe it's possible take this information from metamod or simply trigger this meta re-reading to start the procedure of clearing all before map change?
In the second part I can see this Loading map - maybe You can trigger this?
  
Reply With Quote
Re: explanation on the changelevel issue
Old
  (#10)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: explanation on the changelevel issue - 29-04-2004

I think what PMB is saying is..
He can detect when a new map starts after a changelevel command but he cannot detect when the map ends due to a changelevel command..
as you can see metamod only detects when it's starting new level after it has already kicked all the bots..
So he has no way of getting the bots from the last map to continue in the new map.

Last edited by sPlOrYgOn; 29-04-2004 at 05:33..
  
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