How do I get bots to work on my map?

Oct 15, 2018
249
132
I've been bored and I've always kind of wanted to make a bot v bot match on my map, but I don't really know how to make the bots work on custom maps. I've heard about something called a navigation mesh, but does anyone have a good guide on how to do it?


Thanks,
 

Bull

L4: Comfortable Member
Aug 30, 2011
193
144
You won't need too much for it to work - what I know is that the bots seem to work best when there's an actual objective (like KOTH, PL). After compiling your map, you want to load it up in TF2 and do the following:

  1. Join a team and select a class
  2. Aim at the floor beneath you, open the console and type: 'nav_mark_walkable'. This marks an area where bots can walk (and most areas connected to it). If you've got a very high place not easy reached, or only reached by a steep hill, run to that area and place another mark on the floor there.
  3. Next, type 'nav_generate' - TF2 will now compile a navigation mesh for you automatically. The map will reboot after the compiling of the nav is done.
  4. (Optional) After rebooting the map, you can check out the nav mesh by turning on cheats ('sv_cheats 1') and typing 'nav_edit 1' to see the mesh in place. 'nav_edit 0' disables the mesh again.
  5. To add bots, best way to do it is to type the following in the console: 'tf_bot_quota xx' - with XX being the number of bots you want (ex. 18 for a 9vs9 match).

Andd done, bots should now be hopping around in your map!
Remember that you'll need to redo the above commands if you update your map (new flanks for example) or save a new version (a1 > a2).

For more info, see: https://developer.valvesoftware.com/wiki/Navigation_Meshes

Hope this helps!
 
Oct 6, 2008
1,948
446
it's easier to do this:

sv_cheats = 1
nav_generate

map will calculate all spots where bots can go - then do the added stuff above to get the spots where the auto thing doesn't happen. Also bind keys to do the manual stuff i.e. bind [ < tie it to starting your draw and bind ] < to finish your drawing


if you want to do 16 vs 16 then it's

maxplayers - 32
tf_bot_quota 30
load map i.e. map pl_whatever

I forget off the top of my head butyou can also change the level of the bot accuracy - fighting ability - there's an expert level and very hard to play against them on that level
 
Oct 15, 2018
249
132
The bots were pretty good at pathfinding but they could never co-ordinate and capture the final point
 
Oct 6, 2008
1,948
446
Yep - the only type that I've seen them cap is payload where I guess the coding is 1. go to train 2. stay at train (for the blue team only) and because they're in the push zone they cap the point. You won't se red go for the train so much on payload or tug of war types of maps if they're near it and the cart moves fine but nce they're outside of the push zone they'll just satnd around and look at it.
 

henke37

aa
Sep 23, 2011
2,075
515
Bot stupidity can often be blamed on a bad nav mesh. If bots don't understand that a door is one way, I blame the navmesh first of all.