IPB

Welcome Guest ( Log In | Register )

> Using .cfg files to change bot setup
DNA.styx
post Mar 12 2024, 09:12 PM
Post #1


Member
**

Group: Members
Posts: 13
Joined: 15-December 23
Member No.: 2,660



Anyone try to do this on a dedicated server?

I would like to have the option to kick all bots, return the bots, make all bots snipers etc without having to restart the server, or even the map.

Default setup
my config.ini file includes
CODE
rcbot_addbottime 5
rcbot_bot_quota_interval 5
rcbotd config min_bots -1
rcbotd config max_bots 10


All the bot profiles have team = -1 but have their class set.

I've got a plugin that restarts the map when all real players leave in the hope that it will reset everything back to default when the next player joins - as I'm planning to have these .cfg files available to be voted for my non-admins.

I've created a vote_rcbot_kick_all.cfg that contains
CODE
rcbotd config min_bots -1
rcbotd config max_bots -1
rcbot_bot_quota_interval 0
sm_kick @bots


and a vote_rcbot_return_all.cfg that contains
CODE
rcbotd config min_bots -1
rcbotd config max_bots 10
rcbot_bot_quota_interval 5
sm_kick @bots


All the above seems to work well. So far so good.

The next option I wanted to create was a sniper only server. I was hoping a .cfg file like the below would work.

CODE
sm_kick @bots
rcbotd addbot 3 2
rcbotd addbot 3 3
rcbotd addbot 3 2
rcbotd addbot 3 3
rcbotd addbot 3 2
rcbotd addbot 3 3
rcbotd addbot 3 2
rcbotd addbot 3 3
rcbotd addbot 3 2
rcbotd addbot 3 3


But some non-sniper bots mange to sneak in before the rcbotd addbot command(s) do
Here's the console log when I run the above .cfg
https://pastebin.com/CRwqKHxP

I also note that restarting the map doesn't return the bots to thier 'default' profiles.

Anyone tried this before? Any obvious bugs in my setup/logic?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
INsane_dod
post Mar 15 2024, 10:25 PM
Post #2


Advanced Member
***

Group: Members
Posts: 74
Joined: 10-March 13
Member No.: 2,261



QUOTE(DNA.styx @ Mar 13 2024, 07:12 AM) *


<snip>

But some non-sniper bots mange to sneak in before the rcbotd addbot command(s) do
Here's the console log when I run the above .cfg
https://pastebin.com/CRwqKHxP

I also note that restarting the map doesn't return the bots to thier 'default' profiles.

Anyone tried this before? Any obvious bugs in my setup/logic?


On the non-sniper bots "sneaking in".

Look at the timing on how (when) your plugins load, RCBot2 will be one of the last.

I make my server to permanently turn off all bot loading or changing class.
CODE
rcbot_change_classes 0
rcbot_addbottime 5
rcbot_bot_quota_interval -1
rcbotd config min_bots -1
rcbotd config max_bots -1


I then use a plugin called "Delayed sm_execcfg"
https://forums.alliedmods.net/showthread.php?p=2638480

That plugin waits until RCBot2 loads, I place a 6 second delay on map start to manually add bots via a config file like you have.

RCBot2 is loading after you issue your config file could be the problem of bots "sneaking in".

I have found the only way to get RCBot2 to obey strict control over classes is to have rcbot_change_classes 0 and have no way for RCBot2 load at the map start (around 6-20 seconds) and control that loading with Delayed sm_execcfg.

I use a set of config files and on every map I use a default set to call the bots via the "Extended map configs" plugin.
https://forums.alliedmods.net/showthread.php?p=760501

You could also use a choice in the admin menus I suppose.

I have never released that set of files, only tested it on my local Lan dedicated server but it controls class in that I do not allow RCBot2 to have any choice to load bots at any time and the server loads bots using manual config files... controlled by the Extended map configs plugin that uses the Delayed sm_execcfg and some custom files to get what I want in class types and server amount of bots.

The below is what is in dod_anzio...

CODE
// **** RCBot2 load EXCACT bots MANUALLY option ****
// Change the file name 0-4 e.g, for 0 snipers, ".../sniper_0.cfg" , 4 snipers - "..../sniper_4.cfg"
//
// **** Snipers **** PER SIDE for this map?
sm_dexeccfg "/sourcemod/rcbot2class/sniper_2.cfg" 6     // loads 4 bots (2 per side) once 6 seconds has passed

// **** MG **** PER SIDE for this map?
sm_dexeccfg "/sourcemod/rcbot2class/mg_1.cfg" 8         // loads 2 bots (1 per side) once 8 seconds has passed

// **** Rocket **** PER SIDE for this map?
sm_dexeccfg "/sourcemod/rcbot2class/rocket_0.cfg" 12     // loads 0 bots (0 per side) once 12 seconds has passed

// **** Rifleman **** PER SIDE for this map?
sm_dexeccfg "/sourcemod/rcbot2class/rifleman_5.cfg" 18   // loads 10 bots (5 per side) once 18 seconds has passed

// **** Assault **** PER SIDE for this map?
sm_dexeccfg "/sourcemod/rcbot2class/assault_4.cfg" 22     // loads 8 bots (4 per side) once 22 seconds has passed

// **** Support **** PER SIDE for this map?
sm_dexeccfg "/sourcemod/rcbot2class/support_3.cfg" 24     // loads 6 bots (4 per side) once 24 seconds has passed

// add up your class changes - Total bots - 30 in this set.

// ** END ** RCBot2 load EXCACT bots MANUALLY option ****


Note I am calling a file called "/sourcemod/rcbot2class/sniper_2.cfg"

It loads 6 seconds after map start, after RCBot2 loads with no bots called.

That avoids RCBot2's auto class loading function.

The config file "sniper_2.cfg" is one of 4 files for that class. From 1 sniper per team to 4 per team.
It looks like this...

CODE
rcbot addbot 3 2; rcbot addbot 3 3
wait 500
rcbot addbot 3 2; rcbot addbot 3 3


You will also note in the Extended map configs plugin dod_anzio.cfg file, the classes have a different time to load, Snipers come in at 6 seconds, MG's are at 8 seconds and so on.

Although on a dedicated server on a local LAN or a listen server of any quality... you don't have any issues loading 30 bots all at once, it would be wise to space out loading 30 bots at the same time on a dedicated server.

Note I am using this as the only human on the server and I have 2 slots spare.
You can adjust that to suit either using a map config file or a command issued via a menu or admin.

I should release that set of files I suppose so others can look at them.

But... point is, RCBot2 is loading last in the plugin loading hierarchy (some say it is alphabetically sorted) and if your config at map load has "rcbotd config max_bots 10" set then RCBot2 is going to control the class selection of the first few bots as it loads after you issued your manual "all snipers" config file ?

Setting rcbotd config max_bots and rcbotd config min_bots permanently to -1 is the only way I have found to disable RCBot2 from selecting the class of bots.
The plugin seems to have a hardwired selection of 3 of every class when it starts up.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 8th August 2025 - 04:22 AM