IPB

Welcome Guest ( Log In | Register )

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


Newbie
*

Group: Members
Posts: 8
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
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
DNA.styx
post Mar 16 2024, 07:55 PM
Post #3


Newbie
*

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



Thanks for the info INsane. Has given me loads to work through and get my head around. Leave it with me.

This is the admin menu/vote plugin (1) I'm testing. Appears to work well. (image below)

IPB Image

(1) https://forums.alliedmods.net/showthread.php?p=2097623
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
INsane_dod
post Mar 16 2024, 09:54 PM
Post #4


Advanced Member
***

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



QUOTE(DNA.styx @ Mar 17 2024, 05:55 AM) *

Thanks for the info INsane. Has given me loads to work through and get my head around. Leave it with me.


Here is another angle on class - RCBot2 - fun modes. Just in case you wanted another headache smile.gif

Another way to control RCBot2 class "on the fly" or per map is to change weapons, not the class.
The RCBot2 class issues workarounds I explored had 2 noticeable actions, bots don't mind being kicked and bots don't mind having weapons stripped at spawn.

So we alter weapons of each class...not the class itself.

Two weapon plugin's work fine on dod:s.

1. [DoD:S] Gun Menu https://forums.alliedmods.net/showthread.php?p=1781776

That one is fine and fun but shouldn't be used with the next one. It has some small issues with RCBot2 but works fine.

2. DoDs Equipment (various versions) ... https://forums.alliedmods.net/showthread.php?p=654354

Now that is version 0.0.6 in the link, version 0.0.7 is in a further link, both had issues.
I reworked a couple of items and made a version 0.8 for testing. It just needed a small compatibility edit.

It's here as a download...
https://www.dodbits.com/dods/index.php/down...quipment-plugin

It was part of my download for a dedicated server on a home LAN. I see no reason why it wouldn't work in a online server.

This is explained here....
https://www.dodbits.com/dods/index.php/dods...ot2#dodeqipment

So, again integrating this on a RCBot2 server, the dod equipment plugin can deliver a standard set up (at server start) that all players can get the old "dod 1.3" weapons load out, like the various dod pistols plugin but... you have near total control of weapons and ammo in every class.

You can also "change on the fly", make every class a sniper load out.
Then you can also call the file in a map config file.

So... it is a bit of a Swiss army knife when you look at what it can control.

Its more work (my examples reduce that workload) in config files but unlike the [DoD:S] Gun Menu this can do a lot more.

The main work is making the config's and getting them working without conflicts.

I know [DoD:S] Gun Menu is very popular but DoDs Equipment if set up opens up a whole range of possible fun modes for a mixed RCBot2 and Human fun server.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
DNA.styx
post Mar 16 2024, 11:43 PM
Post #5


Newbie
*

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



Currently running these .cfgs, seem pretty robust with me just playing - let see what happens with a couple of other players join.

.cfg that is run by the Sniper vote:
vote_rcbot_all_snipers.cfg
CODE
rcbotd config min_bots -1
rcbotd config max_bots -1
rcbot_bot_quota_interval 0
rcbot_dontcapture 1
sm_kick @bots
sm_dexeccfg "sourcemod/vote_rcbot_all_snipers_add.cfg" 5  


vote_rcbot_all_snipers_add.cfg
CODE
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
rcbotd config min_bots -1
rcbotd config max_bots 10
rcbot_bot_quota_interval 5


rcbot_dontcapture doesn't seem to be respected by the bots. Have confirmed via the console that it's set. But that's an issue for elsewhere.

Have changed the 'restart on empty' plugin to restart the server rather than just the map when players leave, that seems to force the 'default' bot settings if someone tried the custom setup and doesn't like it and just leaves.

Will add the two plugins to the list of things to look at.

When I first spun up my server I added gun menu, but all the bots seemed to be forced with the random gun menu option, which I didn't want as I wanted to try to control the number of Snipers (two), MG (two) and rockets (zero - they just don't rocket good!) (Line 138 of the .sp file says ' (IsFakeClient(client)) ? RANDOM_WEAPON' tried to remove the code without success). But adding your modified DoDs Equipment plugin into the mix looks like an interesting way forward. Thanks again.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
INsane_dod
post Mar 17 2024, 09:27 AM
Post #6


Advanced Member
***

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



QUOTE(DNA.styx @ Mar 17 2024, 09:43 AM) *


rcbot_dontcapture doesn't seem to be respected by the bots. Have confirmed via the console that it's set. But that's an issue for elsewhere.


I found that too, not tested that a lot myself, RCBot2 has a few quirks like that.

Have fun with DoDs Equipment!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
DNA.styx
post Mar 18 2024, 11:03 PM
Post #7


Newbie
*

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



DoDs Equipment wasn't too tough....spent more time tidying up the default .cfg file and using that as a template. Works very well. Have spun up a default, sniper and rifleman only .CFGs , added them to a custom vote menu...now let's see if anyone uses them. smile.gif

BTW some of my RCBOT .CFGs above were bad which was causing strange results, I was using min_bots /max_bots and rcbot_bot_quota_interval .
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
INsane_dod
post Mar 25 2024, 01:30 AM
Post #8


Advanced Member
***

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



QUOTE(DNA.styx @ Mar 19 2024, 09:03 AM) *

DoDs Equipment wasn't too tough....spent more time tidying up the default .cfg file and using that as a template. Works very well. Have spun up a default, sniper and rifleman only .CFGs , added them to a custom vote menu...now let's see if anyone uses them. smile.gif


I found that too, made my own default sets
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

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: 9th November 2024 - 07:24 AM