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."
|