Bots

From TF2 Wiki

Share/Save/Bookmark
Jump to: navigation, search

There are two types of Bots in TF2:

  • The first type has sophisticated AI code, based upon the Infected AI in Left 4 Dead.[1] They are intelligent enough to replace human players in most cases. They do not require the server to have cheats enabled, therefore human players can gain achievements while playing with them.
  • The second type has no AI code – they are simply puppets which you can spawn and order to do things, such as follow you around and fire their weapons. They are useful for testing or for indulging antisocial fantasies. They require the server to have cheats enabled, therefore human players cannot gain achievements while playing with them.

Contents

AI Bots

AI Bots can take the place of human players. They can only be spawned; they cannot be directly controlled. In addition, you cannot choose the name of the bot to spawn – they are randomly chosen by the game.

However, Bots as certain classes can be somewhat indirectly controlled, to a certain extent: a Bot Medic will heal you if you press the "Medic!" voice command. (Default key is "E" on a PC.) If a Medic Bot is healing you and has an ÜberCharge ready, use the voice commands "Go go go!" (default keys are Z, then 3 on a PC) or "Activate Charge!" (default keys are X, then 7 on a PC) to force the Bot to activate his currently unused ÜberCharge!

As of this writing:

  • Bots are usable on the 2010 Halloween map, cp_manor_event. This is because the Horseless Headless Horsemann required a pathing grid to move around. Although they did not attack the Horseless Headless Horsemann, they still capped points.
  • They are still in beta testing.
  • They work out-of-the-box for most official King of the Hill (KOTH) maps (other than both koth_harvest variants), Payload (PL) maps, and cp_dustbowl. For these maps, they do not require cheats to be enabled; they are used in Offline Practice mode. Currently, achievements can't be earned, though random drops occur.
  • Due to a recent update, all classes are represented by Bot users, including Spies, though only a few times will a Bot spawn as one.

AI Bot commands

To use AI Bots on supported maps, the server administrator simply opens a console and types in the following command:

Command Description

tf_bot_add

This command will create one or more AI Bots of random classes on random teams. They will also be assigned amusing human-like names.

Syntax
tf_bot_add [<count>] [<class>] [<team>] [<difficulty>]
Parameters
<count>
Specifies the number of bots to spawn. If omitted, one bot is spawned.
As of this writing, specifying a number greater than the maximum number of players, including any human players, causes the bots to freeze. Thus if you have a 24 player server (the default), and one human player, do not spawn more than 23 bots.
<class>
The classname of the class can be Demoman, Engineer, HeavyWeapons, Medic, Pyro, Scout, Soldier, Sniper, or Spy
<team>
Specifies the team name to assign the bot, where team can be red or blue
<difficulty>
Sets the difficulty level for the bot, where difficulty can be easy, normal, or hard.
Example
tf_bot_add red 3 heavyweapons easy will add three heavies to the red team at the easy skill level.

tf_bot_difficulty

Defines the skill of Bots joining the game.

Syntax
tf_bot_difficulty <level>
Parameters
<level>
Sets the difficulty level for the bots. Values are: 0=easy, 1=normal, 2=hard, 3=expert. Default is "Normal" (1).
Example
tf_bot_difficulty 2 will set all bots created after this command to "Hard" difficulty.

tf_bot_force_class

If set to a class name, all TF2 Bots will respawn as that class.

Syntax
tf_bot_force_class <class>
Parameters
<class>
The classname of the class can be Demoman, Engineer, HeavyWeapons, Medic, Pyro, Scout, Soldier, Sniper, or Spy. Default is "" (aka blank).
Example
tf_bot_force_class medic will make all TFbots respawn as Medic.

tf_bot_join_after_player

If nonzero, Bots will wait until a player joins before entering the game themselves.

Syntax
tf_bot_join_after_player <integer>
Parameters
<integer>
Either 1 or 0. Default is 1 (enabled).
Example
tf_bot_join_after_player 0 will make TFBots join the game when added even if no players are on a team.

tf_bot_keep_class_after_death

If zero, Bots will always respawn as a different class.

Syntax
tf_bot_keep_class_after_death <integer>
Parameters
<integer>
Either 1 or 0. Default is 0 (disabled).
Example
tf_bot_keep_class_after_death 1 will prevent TFBots from changing class.

tf_bot_kick

This command will remove one or all AI Bots.

Syntax
tf_bot_kick <name/all>
Parameters
<name/all>
Specifies the name of bot to remove or all.
Example
tf_bot_kick CEDA will kick the TFbot named "CEDA" if one exists.

tf_bot_prefix_name_with_difficulty

If nonzero, append the skill level of the Bot to the Bot's name

Syntax
tf_bot_prefix_name_with_difficulty <integer>
Parameters
<integer>
Either 1 or 0. Default is 0 (disabled).
Example
tf_bot_prefix_name_with_difficulty 1 will cause added bots to have names like "1 Aimbot" (normal) and "3 Saxton Hale" (expert).

tf_bot_quota

Determines the total number of TF2 Bots in the game. Only has effect is "tf_bot_quota_mode" = "fill" or "match".

Syntax
tf_bot_quota <integer>
Parameters
<integer>
Whole number between 0 and how many players the server can hold. Default is 0.
Example
tf_bot_quota 2, if tf_bot_quota_mode = match, will add two bots to the server for every one human.

tf_bot_quota_mode

Determines the type of quota.

Syntax
tf_bot_quota_mode<normal/fill/match>
Parameters
normal/fill/match
If 'normal', the server will never add/remove TFbots without explicit commands and bot_quota has no effect.
If 'fill', the server will adjust bots to keep N players in the game, where N is bot_quota.
If 'match', the server will maintain a 1:N ratio of humans to bots, where N is bot_quota.
Example
tf_bot_quota_mode fill will always keep (bot_quota - # of human players) bots in the game.


It is possible to use AI Bots on non-supported maps, but results will vary. First, the server must have cheats enabled (which means human players cannot gain achievements), second, you must generate Bot pathing which causes the map to restart, and third, this pathing generally does not work well after all that. However, if you still wish to use Bots on unsupported maps, here is how:

1) Type sv_cheats 1
2) Type nav_generate
3) Wait a few minutes while the game works out where and how to use the bots
4) Map will exit and reload (navigation is saved, so no need to repeat previous step)
5) Open console and type tf_bot_add <number> as above

Bot names

The AI Bots are programmed to have different names. A lot of their names are references to many of Valve's works, such as, but not limited to, Portal, Left 4 Dead and its sequel, and Half-Life. They also include some references to Team Fortress and fandom as well. Many of these names have been requested on the Steam forums.

Puppet Bots

Puppet Bots have no AI code and so cannot replace human players. They do not move or act on their own. You can use them like puppets though, manipulating them to do things such as follow you around and fire their weapons.

They are mainly useful for testing. They are also good for the sheer fun of watching an army of perfect soldiers firing their rockets in unison, or gibbing a dozen helpless enemies at once with pipebombs.

Because they require the server to have cheats enabled, human players cannot gain achievements while using these Bots.

Puppet Bot commands

Some of these commands work and some don't. For clarity, the complete list is included. Note that for all commands, entering the command without any options will display the command's current setting and a brief (one line) help.

Command Description

Bot

This command will create a Bot on the given team with the specified class and name. If team or name is omitted, they will be assigned randomly.

Syntax
bot -team <teamname/number> -class <classname> -name <botname>
Parameters
-team teamname/number
Specifies the team name or number to assign the bot. Where name/number can be RED or 1, BLU or 0
-class classname
The classname of the class can be Demoman, Engineer, HeavyWeapons, Medic, Pyro, Scout, Soldier, Sniper, or Spy
-name botname
botname can be anything. If there is already someone with the same name, an incremental number (starting at 1) surrounded with parenthesis will be added to the beginning of the name. For example, joe, (1)joe, (2)joe, etc. If no name is given then the name will be "bot" followed by a number starting with 01; for example, the first bot will be bot01, the next bot02, and so on.
Example
bot -team red -class Engineer -name joe

bot_changeclass

Force all Bots to change to the specified class. Does not seem to be implemented, nothing happens.

bot_changeteams

Make all Bots change teams. This forces all the Bots to switch teams. If a Bot was on the RED team, then it will now be on the BLU team and vice versa.

bot_command

Sends specified command on behalf of specified Bot.

Syntax
bot_command <botname> <console command>
botname is the name or id of the bot to send the command to.
console command can be any of the ones listed in Scripting#Console_Commands.
Example 1
bot_command bot01 "voicemenu 0 0"
Example 2
bot_command bot01 "taunt"

bot_defend

Set to a team number, and that team will all keep their combat shields raised. For instance, heavies will spin their miniguns.

bot_dontmove

Bots are allowed or prevented from moving. When set to 1 the bots cannot move but they can still turn and jump. Note, with a combination of this command and bot_mimic you can move Bots to where you want them and leave them there.

Syntax
bot_dontmove <0/1>
Bot is allowed to move, or not.
Example
bot_dontmove 1

bot_forceattack

This will make all the Bots automatically fire whatever weapon they currently have selected. If bot_forceattack2 is set to 0, then the Bots will execute primary_fire. If bot_forceattack2 is set to 1, then the Bots will execute secondary_fire.

Note this does nothing if bot_mimic is active (set to 1).

Syntax
bot_forceattack <0/1>
Bot will not fire if set to 0 and fire repeatedly if set to 1.
Example
bot_forceattack 1

bot_forceattack2

This will make all the Bots execute secondary_fire on whatever weapon they currently have selected when bot_forceattack is set to 1.

Syntax
bot_forceattack2 <0/1>
Bot will use its weapon's secondary_fire when set to 1, primary_fire when set to 0
Example
bot_forceattack2 1

bot_forceattack_down

When firing, don't tap fire, hold it down. If this is set to 0 then the Bot will act like they are continuously tapping the fire button (useful for the Pistol, but not for the Heavy's Minigun). If this is set to 1, then the Bot will act as if it is holding down the fire button (useful for the Heavy).

Syntax
bot_forceattack_down <0/1>
On when set to 1, off when set to 0
Example
bot_forceattack_down 1

bot_forcefireweapon

Force Bots with the specified weapon to fire. Does not seem to be implemented, nothing happens.

bot_kick

Removes the specified Bot from the server.

Syntax
bot_kick <bot name>
Makes the specified bot leave the server.
Example
bot_kick bot01

bot_kill

Kills the specified Bot.

Syntax
bot_kill <bot name>
Makes the specified bot commit suicide.
Example
bot_kill bot01

bot_mimic

Bot uses usercmd of player by index. The Bot will execute all keystrokes issued by a player, mimicking movements, turns, jumps, fire, etc.

Note this overrides bot_forceattack but does not override bot_dontmove.

Syntax
bot_mimic <0/1>
On when set to 1, off when set to 0
Example
bot_mimic 1

bot_mimic_yaw_offset

Offsets the Bots' yaw. The Bots will face in a direction this angle from the player. By default this is set to 180 so that all Bots will face the player. Setting this to 0 will face the Bots in the same direction as the player.

Syntax
bot_mimic_yaw_offset <0-360>
Set the direction by specifying angle in degrees
Example
bot_mimic_yaw_offset 180

bot_randomnames

This will add text to Bot names, apparently used for testing during development. Some examples: "Yet more Bot names, medium size", "Another Bot", "This is a medium Bot", "This is a super long Bot name"

Syntax
bot_randomnames <0/1>
On when set to 1, off when set to 0
Example
bot_randomnames 1

bot_refill

Refills all Bots' Ammo counts, including Metal for Engineers.

Syntax: bot_refill

bot_saveme

This makes all the Bots call for a Medic, equivalent to issuing bot_command <botname> "voicemenu 0 0" to every Bot. Syntax: bot_saveme <0/1>

On when set to 1, off when set to 0

bot_selectweaponslot

This makes the first Bot select weapon in specified weapon slot. 0 = primary; 1 = secondary; 2 = melee; 3 = special Note, this only works for the first Bot spawned. There doesn't seem to be a way to specify other Bots.

Syntax
bot_selectweaponslot <n>
Set n to weapon slot that bots should switch to.
Example
bot_selectweaponslot 2

bot_teleport

Teleports a specified Bot to a given coordinate. Map coordinates of where you are standing can be found by typing Status in the console.

Syntax
bot_teleport <botname> <X> <Y> <Z> <Pitch> <Yaw> <Roll>
Where botname is the bot name or id to teleport.
X Y Z are the map coordinates.
Pitch Yaw Roll is the direction the bot should face.
Example
bot_teleport bot01 -4815 1385 -447 0 0 0

bot_whack

Deliver lethal damage from player to specified Bot. This basically kills the Bot with the currently selected weapon, probably used for testing during development.

Syntax
bot_whack <botname>
Where botname is the name of bot to "whack".
Example
bot_whack bot109


Useful aliases and binds

sv_lan 1

sv_cheats 1

mp_teams_unbalance_limit 0

alias +bot_shoot_primary "bot_selectweaponslot 0; bot_forceattack 1"

alias -bot_shoot_primary "bot_selectweaponslot 0; bot_forceattack 0"

alias +bot_shoot_secondary "bot_selectweaponslot 1; bot_forceattack 1"

alias -bot_shoot_secondary "bot_selectweaponslot 1; bot_forceattack 0"

bind n +bot_shoot_primary

bind m +bot_shoot_secondary

Pressing n will cause the Bot to switch to its primary weapon and fire once. Pressing m will cause the Bot to switch to its secondary weapon and fire once. Press each key repeatedly to fire repeatedly. If you want to use secondary fire for a particular weapon (e.g. detonate Demoman Sticky Bombs or bat a ball from the Sandman), type in bot_forceattack2 1 in the console to enable secondary fire, then press the bound key, and then bot_forceattack2 0 to switch back to primary fire. Of course, you could also bind these to a key.

Example scripts

  1. Create a server and load a map (Gravelpit works well as a map since there is just the one respawn room, or the achievement maps with the open spawn areas).
  2. Join as a BLU Engineer and stay in the respawn room.
  3. Bring down console and type:
    sv_cheats 1
    mp_teams_unbalance_limit 0
    bot -class Engineer
    bot_mimic_yaw_offset 0
    bot_mimic 1
    This will spawn a BLU Engineer Bot by the name of "bot01" which will do what you do, including walking around and selecting/firing weapons. However, it will not build anything if you build it. You can make it select the build menu, but cannot actually select a menu item when you do. Thankfully, there is the BUILD command and the bot_command that can make the Bot issue commands.
  4. Bring down console and type:
    bot_command bot01 "build 3"
    This will start the build process with the Engineer holding his toolbox, the bot should be seeing the blueprint now.
  5. Close the console and press your fire button - this will start the Sentry building. Keep pressing the fire button to make the bot hit the Sentry with his Wrench to build it faster, and if you want add Metal to it. If you want to increase the Sentry's level then you need to give the Bot more Metal with the bot_refill console command.

Other examples

  1. The following will create a RED Medic and a RED Soldier who fire continously until they are out of ammo. The Medic ends up with a medigun set to heal any other player who passes them or an enemy spy. The Soldier ends up bashing away with his melee weapon unless they end up above a supply of ammunition, in which case they will continually fire rockets (good for deflection practice).
sv_cheats 1
mp_teams_unbalance_limit 0
bot -team red -class medic
bot -team red -class soldier
bot_mimic 0
bot_forceattack 1
bot_selectweaponslot 1
sv_cheats 0
retry
  1. The following will create a RED Sniper who continously scopes in and a RED Spy who cloaks and decloaks. The retry after turning sv_cheats off gives you a clean session.
sv_cheats 1
mp_teams_unbalance_limit 0
bot -team red -class sniper
bot -team red -class spy
bot_selectweaponslot 1
bot_mimic 0
bot_forceattack 1
bot_forceattack2 1
sv_cheats 0
retry
  1. The following gives you three RED Scouts and three RED Heavies.
sv_cheats 1
mp_teams_unbalance_limit 0
bot -team red -class scout
bot -team red -class scout
bot -team red -class scout
bot -team red -class heavyweapons
bot -team red -class heavyweapons
bot -team red -class heavyweapons
sv_cheats 0
retry
Languages Languages: 

English  • русский


Cite error: <ref> tags exist, but no <references/> tag was found



Personal tools