Team Fortress 2

Team Fortress 2

302 ratings
Playing Alone with Bots
By RainingMetal
Almost every public player is an idiot. They don't listen, they don't play as the class your team needs, and they're always cannon fodder for the enemy team. Bots are slightly better, and can be controlled. This is a guide on handy console commands and a few easy tricks to make creating a bot-filled game more quickly and effectively.

Note: This isn't regarding the plague of aimbot players out to grief players that have affected public servers as of late. This is solely about playing in a solo server.
   
Award
Favorite
Favorited
Unfavorite
Offline Practice
Yes, there's an Offline Practice mode in the training tab which you can use to play with bots immediately. However, that method has very limited options when it comes to customizing your game, and your stats won't be tracked. You also won't be able to get achievements this way.
Where do bots work the best?
These artificial players are far from perfect; they won't work at all in certain game modes. It's usually said that the simpler the game mode, the more likely it is to be compatible with bots.

Game Modes that support bots well
  • Assault (Attack/Defend)
  • Payload
  • King of the Hill

Game Modes that support bots decently
  • Control Points
  • Capture the Flag

Game Modes that don't support bots
  • Payload Race
  • Arena
  • Special Delivery
  • Mann vs Machine
  • Mannpower
  • PASS Time
  • Player Destruction

Individual Maps that don't support bots
  • Cactus Canyon
  • Snowycoast

Certain maps such as Dustbowl come with a nav mesh needed for bot functionality already installed. However, for any map, here's a list of steps to make bots (more or less) compatible with any map that uses a game mode that's compatible.

Load the map and open up the console
Start a server and press "~" (the key to the left of 1) to open up the console (enable the console through the options menu). Type the following commands in the console.

sv_cheats 1
nav_generate


This will automatically generate a nav mesh for the map, for which bots can use to move around and fight. It's not perfect, but it does in a pinch.
Console Commands
Here are some console commands that will help customize your bot-filled server.

tf_bot_add [number] [team] [class] [difficulty] [name]
Adds a bot with the specified parameters.

"tf_bot_add 3 red sniper 1 ROBOT" will add 3 red Snipers at the normal difficulty level named "ROBOT". For Heavies, use the word "heavyweapons"

tf_bot_keep_class_after_death [0/1]
Whether or not bots will change their class after dying.

"tf_bot_keep_class_after_death 1" will always have the bots use the class they've selected at the start of the game. Perfect for making your dream team!

tf_bot_taunt_victim_chance [0-100]
How often a bot will taunt upon killing a human victim.

"tf_bot_taunt_victim_chance 0" means that bots won't taunt victims.

tf_bot_difficulty [0-3]
The default difficulty of bots created. The higher the number, the more difficult the bot.

"tf_bot_difficulty 3" will make every bot spawned after this command at expert difficulty

tf_bot_force_class [class]
Forces all bots to play as the specified class.

"tf_bot_force_class scout" will make all bots scouts

tf_bot_melee_only [0/1]
Whether or not bots can only use melee weapons.

"tf_bot_melee_only 1" will force all bots to use melee weapons. It's gonna be a rough fight!

tf_bot_kick all
Kicks all the bots from your server.

mp_autoteambalance [0/1] and mp_teams_unbalance_limit [0/1]
Determines whether or not autobalance is in play, and if players can join any team regardless of the teams' sizes.

"mp_autoteambalance 0; mp_teams_unbalance_limit 0" will remove that pesky autobalance from your server.
Quick Bind for making a server
For those of us who like to play alone from time to time, inputting these commands over and over gets tiresome. Luckily one can make key binds to execute many of these commands at once. Here's a setup I like to use:

bind [key #1] "tf_bot_keep_class_after_death 1; tf_bot_taunt_victim_chance 0; mp_autoteambalance 0; mp_teams_unbalance_limit 0"

bind [key #2] "tf_bot_add 1 red heavyweapons; tf_bot_add 1 red medic; tf_bot_add 1 red soldier; tf_bot_add 1 red pyro; tf_bot_add 1 red sniper; tf_bot_add 1 red demoman; tf_bot_add 1 red spy; tf_bot_add 1 red engineer; tf_bot_add 1 red scout"

bind [key #3] "tf_bot_add 1 blue heavyweapons; tf_bot_add 1 blue medic; tf_bot_add 1 blue soldier; tf_bot_add 1 blue pyro; tf_bot_add 1 blue demoman; tf_bot_add 1 blue sniper; tf_bot_add 1 blue spy; tf_bot_add 1 blue engineer; tf_bot_add 1 blue scout"

From this point on, all you need to do when you start a game is to press those three keys in sequence. You'll have two teams of nine players, all different classes.

Note: You can achieve the same effects with a config file and bind them to a single key.
Trivia
  • During setup time bots will taunt when stared at long enough.
  • Bots can also be interacted with via group taunts. It's possible to get taunt-specific achievements provided that you have the taunt yourself.
  • Medics will use their Ubercharge when using the voice command "Go!" or "Activate Charge!".
Common Issues
Engineers not relocating their structures when control points change hands/the payload advances past a checkpoint

This didn't happen at first; Engineers often simply detonated their structures once a team advances past a point (since they can't actually move their structures). This sadly no longer happens, and has made them broken for the longest time.

A handy solution is to kick all bots and spawn them all again. Sure, it resets all their points, but who's keeping score?

Bots getting stuck in corners
There's a piece in the nav mesh that the bot is mistaking for a way through, usually through a one-way passage. Try going into nav editing mode and deleting the offending element. That often works.
Outro
Feel free to leave constructive comments below, and don't hesitate to mention anything I've missed. Trolling/harassment comments will be removed.
91 Comments
Fish. 12 Aug, 2024 @ 6:07am 
whenever i add the bots they just automatically get kicked, can someone help?
lil 2baer * 10 Jul, 2024 @ 1:17pm 
The TF bots are for TF2
🐭 13 Mar, 2024 @ 4:28pm 
Command "tf_bot_add" not found.

Is there another way to do this with older source engine versions?
Sn3akyWheel 11 Jul, 2023 @ 10:23am 
Note: A type of bot has been infiltrating Pass Time. I've nailed down a strategy for District, however I'm having trouble winning on a map I forgot the name of.
RainingMetal  [author] 3 Dec, 2021 @ 9:48am 
@Seong Gi-Hun The map will need a nav mesh in order for the bots to function, and they don't work on all game modes.
averagejimmymain 3 Dec, 2021 @ 2:58am 
The bots aren't moving
oog 12 Jun, 2021 @ 10:49pm 
type in the console tf_bot_quota 0 to remove them
Cocopowder 24 Sep, 2020 @ 9:11pm 
whenever i go to kick all the bots in the game they just rejoin can somone help?
Xx_LAS4GNA_xX 18 Sep, 2020 @ 4:42am 
also, you can download the Bot Overhaul mod that makes playing with bots a whole Singleplayer mode
Snowy 4 Aug, 2019 @ 11:20pm 
For anyone having problems with bots trying to change their class, go to the console and type "sv_cheats 1" then "tf_bot_reevaluate_class_in_spawnroom 0" this will turn it off and have them play as the class you set them to without changing it.