![]() |
explanation on the changelevel issue
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. |
Re: explanation on the changelevel issue
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?? |
Re: explanation on the changelevel issue
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.
|
Re: explanation on the changelevel issue
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. |
Re: explanation on the changelevel issue
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) |
Re: explanation on the changelevel issue
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. |
Re: explanation on the changelevel issue
Quote:
|
Re: explanation on the changelevel issue
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. |
Re: explanation on the changelevel issue
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 thishttp://forums.bots-united.com/images/icons/icon4.gif? |
Re: explanation on the changelevel issue
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. |
All times are GMT +2. The time now is 20:49. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.