Raised This Month: $51 Target: $400
 12% 

Prevent bots from changing team or spectating? (FoxBot for TFC)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pizzahut
Senior Member
Join Date: Oct 2004
Old 06-04-2017 , 07:34   Prevent bots from changing team or spectating? (FoxBot for TFC)
Reply With Quote #1

The problem with FoxBots is that they occasionally change team and do other weird things like they might be stuck in spectator mode or they sometimes don't select a class. I've written a plugin which corrects these mistakes after they happen.

Is there a way to block the random team changes / going into spectator mode? For humans I can just register the corresponding console commands and block them, but this doesn't work for bots.

Client commands are "jointeam (number)" and "spectate", e.g.

Code:
engclient_cmd(id, "jointeam", bot_team)

To join a class, the corresponding console command is the class name:

Code:
                case 1: engclient_cmd(id, "scout")                 case 2: engclient_cmd(id, "sniper")                 case 3: engclient_cmd(id, "soldier")                 case 4: engclient_cmd(id, "demoman")                 case 5: engclient_cmd(id, "medic")                 case 6: engclient_cmd(id, "hwguy")                 case 7: engclient_cmd(id, "pyro")                 case 8: engclient_cmd(id, "spy")                 case 9: engclient_cmd(id, "engineer")                 case 10: engclient_cmd(id, "randompc")
pizzahut is offline
Unzy
Junior Member
Join Date: Apr 2017
Old 06-04-2017 , 12:01   Re: Prevent bots from changing team or spectating? (FoxBot for TFC)
Reply With Quote #2

Hi Pizzahut,

I can provide you/moderators maybe with some more details

I am using your plugin on my server, the spectatormode on scoreboard bug is indeed frequently happening. I have to say that the bots showing in spectatormode are actually playing, even if it shows they are spectating! It also happen only on mapchange, during spawning. Once a bot show in spectator mode it stays on the scoreboard all map, eventho I can clearly see the bot actively playing.
Its also random numbers, sometimes only one bot, sometimes there's a bunch, like 4 or 5

I was thinking : Do they spawn too quickly, following each other too fast? Or is there a problem with speed? Sometimes i feel they are running way to fast

My spawn settings are set to 3 secs, server maxspeed is set at 320

The other bug that bot joins other team/random team changes, I don't have any trouble with that.

Greetings and thnx!
-X-
Unzy is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-04-2017 , 12:04   Re: Prevent bots from changing team or spectating? (FoxBot for TFC)
Reply With Quote #3

Check the plugin from my signature, the last buildv1.* , and add an is_user_bot() in your blockch() public..

Did you figure out how?
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
pizzahut
Senior Member
Join Date: Oct 2004
Old 06-04-2017 , 12:41   Re: Prevent bots from changing team or spectating? (FoxBot for TFC)
Reply With Quote #4

Thanks for the help Craxor. However as I mentioned, blocking client commands only works for human players.

Unzy if it only happens on map change, maybe try adding a delay. In the "foxbot.cfg", make sure that you first set the pause and bot_create_interval variables, and have the addbot commands at the end. So like this:

Code:
# Minimum bots in server (0 - 32 [-1 Turns this off])
# The number of bots on the server should never go below this value.
min_bots -1

# Maximum bots in server (0 - 32 [-1 Turns this off])
# The number of bots on the server should never go above this value.
# You should set this to 1 or 2 less than maxplayers, otherwise new human players
# will not be able to join your server.
max_bots -1

# bot_total_varies (0 - 3)
# When this setting is set to 1, 2, or 3 the number of bots on the server will
# fluctuate from min_bots to max_bots randomly(to simulate online play).
# The higher you set it the more often the numbers of bots playing will change.
bot_total_varies 0

# Bot team balance (0 off, 1 on)
# Turn this on to force the bots to try and keep the teams even.
# Turning this off will let the bots decide for themselves what teams they prefer.
bot_team_balance 0

# Bot to human balance (0 off, 1 on)
# Turn this on to balance the teams in a bot to human ratio (May be buggy)
# Note: This can force human players to change teams.
bot_bot_balance 0

# Bots celebrate xmas (off / on)
bot_xmas off

# bot_allow_moods (0 off, 1 on)
# If this is set to 1 any bots created will be given random personality traits
# and/or moods.  Set this to 0 if you want all the bots to have the same personality.
bot_allow_moods 0

# bot_allow_humour (0 off, 1 on)
# When this is set to 1 the bots will be allowed to go crazy occasionally and
# do stuff such as using melee weapons only, or go looking for walls to graffiti.
bot_allow_humour 0

# Seconds before bots join after a map has started (0 - 100)
# This will be overridden if any addbot commands are used in this file.
pause 10

# bot_create_interval (1 - 8)
# Time(measured in seconds) between auto-creating one bot and the next.
# Note: On slower machines and/or early versions of TFC setting this to 1 or 2
# might cause your server to crash(caused by a Half-Life bug).
# If this setting does cause crashing try setting it to 3 or higher.
bot_create_interval 3

# Here you can put addbot commands to create a default set of bots to play with.
# addbot <team> <class> <name> <skill>
# If you do not specify a class the spawned bot will be able to change
# classes when it wants to.
addbot 2 1 Mr.Tom 1
addbot 2 1 Mr.JD 1
addbot 2 2 Mr.Ghey 2
addbot 2 3 Mr.-X- 1
addbot 2 3 Mr.Galt 1
addbot 2 3 Mr.P4r4l4x 1
addbot 2 4 Mr.Dead 1
addbot 2 4 Mr.3vil 1
addbot 2 5 Mr.LoL 1
addbot 2 5 Mr.WSICM 1
addbot 2 5 Mr.3asy 1
addbot 2 6 Mr.Bruno 1
addbot 2 7 Mr.Mani 1
addbot 2 8 Mr.Cali 1
addbot 2 9 Mr.C4sc4 1
addbot 2 9 Ms.Piit 1

Last edited by pizzahut; 06-04-2017 at 12:41.
pizzahut is offline
Unzy
Junior Member
Join Date: Apr 2017
Old 06-04-2017 , 13:12   Re: Prevent bots from changing team or spectating? (FoxBot for TFC)
Reply With Quote #5

Pizzahut,

I have indeed my config like that.

What i noticed is :

It doesnt happen when there are no humans! My server is 32 slots, 16vs16, when theres no humans all 16 bots are nicely spawn and scoreboard gives all 16 playing with their scores correct

When I join and specced the bots spawning (keeping scoreboard key pressed), i see they all go for A SPLIT SECOND in spectatormode and then join team. Usually one stays stuck in spec mode , sometimes there's more

Just for info!

-X-
__________________
Unzy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-04-2017 , 13:33   Re: Prevent bots from changing team or spectating? (FoxBot for TFC)
Reply With Quote #6

It may be something weird in this bot code. Could someone attach their source so we can check?
__________________
HamletEagle is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 06-04-2017 , 15:01   Re: Prevent bots from changing team or spectating? (FoxBot for TFC)
Reply With Quote #7

I have an idea, maybe in addition to the jointeam command (via engclient_cmd) I should create a TeamInfo event, this might update the scoreboard?

Plugin source: http://rv.apg-clan.org/dlds/amxx_plu...s_humans_x.sma

It's a modified version of this: https://forums.alliedmods.net/showthread.php?t=197129

Difference is that it doesn't change bot count, so it's simplified for Unzy's needs.

Bot source code: https://apg-clan.org/vbdownloads.php...ownloadid=1107
pizzahut is offline
Unzy
Junior Member
Join Date: Apr 2017
Old 06-04-2017 , 15:35   Re: Prevent bots from changing team or spectating? (FoxBot for TFC)
Reply With Quote #8

I should also maybe mention my foxbot vesrion! I use an old one 0.701 (i have the source code if you want)

The newer versions the bots act weird on A/D maps like warpath and avanti, they dont cap the CP

Grtz and thnx!

-X-
__________________
Unzy is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 06-04-2017 , 16:00   Re: Prevent bots from changing team or spectating? (FoxBot for TFC)
Reply With Quote #9

Added this now, needs testing though.

Code:
new team_name[32] // new variable ... // old code get_pcvar_string(g_bvh_bot_team, bot_team, charsmax(bot_team)) engclient_cmd(id, "jointeam", bot_team) // added new code message_begin(MSG_ALL, get_user_msgid("TeamInfo")) write_byte(id) if (!team_name[0]) get_user_team(id, team_name, charsmax(team_name)) // only retrieve if not already set write_string(team_name) message_end()

http://rv.apg-clan.org/dlds/amxx_plu..._humans_x2.sma

Last edited by pizzahut; 06-04-2017 at 16:58.
pizzahut is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-04-2017 , 16:03   Re: Prevent bots from changing team or spectating? (FoxBot for TFC)
Reply With Quote #10

again, check my reply ... i know what i'm talking about and i have tested with podbot and working fine.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Reply



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


All times are GMT -4. The time now is 06:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode