- Apr 19, 2009
- 4,460
- 1,724
http://www.teamfortress.com/post.php?id=3279Erectin a dispenser
December 21, 2009 - Mike Booth
With the success of the AI systems of Left 4 Dead, we've been continuing to develop these technologies to create new kinds of game experiences. Team Fortress 2 is an excellent "sandbox" for explorations of this sort, and we've been quietly doing so for much of this last year. Some of the results of these explorations are TF "bots" — AI-driven player proxies with simulated humanlike senses, reaction times, and tactics. Although the TFBots are not yet complete, they play a pretty decent game of King of the Hill.
We thought you might enjoy testing your skill against these work-in-progress digital killing machines.
We'd also like to hear your thoughts on how the bots are behaving. Although we have our list of behavior bugs to tackle (this is a beta after all), we're sure you'll discover issues we haven't yet seen. If you'd like to give us bot feedback, you can post your thoughts in our new Bot Feedback sub-forum, or send us an e-mail at tfbots@valvesoftware.com. In either case, please tell us the three things you hate most about the bots, and the three things you like best about them (as well as anything else you think we should know).
Since this is a beta test, the TFBots are only functional on these King of the Hill maps: koth_viaduct, koth_sawmill, and koth_nucleus. They don't understand the rules of multiple point capturing, cart pushing, or flag getting... yet. There's also no interface in the game to accessing them yet (we'll add one in an update shortly), so you'll need to access them manually.
To add bots to your game, use the console command tf_bot_add. This will drop a random bot onto a random team (assuming there is a free player slot). The tf_bot_add command can also take up to three optional arguments: <count>, <class>, and <team>, in any order. For example, tf_bot_add 10 will add 10 random bots to the game with auto-assigned teams. Typing tf_bot_add pyro blue will add a Pyro to the blue team. Entering tf_bot_add red 5 will add 5 random bots to the red team. The command tf_bot_add red 3 heavyweapons will add three heavies to the red team.
In order to put specific bots on specific teams (for a bots-vs-humans game, for example), you may want to disable automatic team balancing. To do this, enter mp_autoteambalance 0 followed by mp_teams_unbalance_limit 0.
To remove a bot, use the console command kick <bot name>. To remove all of the bots in the game, use the command tf_bot_kick all.
TFBots are "players", and take up player slots. They run the exact same code that human players do, moving and firing weapons by pressing "virtual buttons". The bots have simulated humanlike senses, and only know what they see, hear, and touch. They also have realistic reaction times and aiming limitations. They don't "cheat" or use omniscient knowledge of the server state to make their decisions.
If you're interested in the technical details, give this a read-through.
http://forums.steampowered.com/forums/showpost.php?p=12673281&postcount=9MikeBooth said:If you are going to generate your own nav files, make sure you set this cvar first:
Code:nav_max_view_distance 6000
Otherwise some valuable data will be missing from the nav file. We'll try to make sure that gets changed to the default behavior in future updates so you don't have to do that. But for now, you do.
Also, nav files usually need a bit of hand tuning after generation. Use:
Code:nav_edit 1
to enable nav mesh editing.
Finally, recall that the bots only "understand" the King of the Hill scenario at the moment, and likely will not act very intelligently in the other scenarios.
All that said, experiment and have fun!
Code:"tf_bot_force_class" = "" game - If set to a class name, all TFBots will respawn as that class "tf_bot_notice_gunfire_range" = "3000" game "tf_bot_sniper_personal_space_range" = "1000" game cheat - Enemies beyond this range don't worry the Sniper "tf_bot_add" game - Add a bot. "tf_bot_kick" game - Remove a TFBot by name, or all bots ("all"). "tf_bot_warp_team_to_me" game cheat "tf_bot_debug_seek_and_destroy" = "0" game cheat "tf_bot_path_lookahead_range" = "300" game "tf_bot_pyro_deflect_tolerance" = "0.5" game cheat "tf_bot_sniper_aim_error" = "0.01" game cheat "tf_bot_sniper_aim_steady_time" = "0.5" game cheat "tf_bot_sniper_aim_steady_rate" = "10" game cheat "tf_bot_debug_sniper" = "0" game cheat "tf_bot_keep_class_after_death" = "0" game "tf_bot_ammo_search_range" = "2000" game cheat - How far bots will search to find ammo around them "tf_bot_health_critical_ratio" = "0.3" game cheat "tf_bot_health_ok_ratio" = "0.8" game cheat "tf_bot_health_search_near_range" = "1000" game cheat "tf_bot_health_search_far_range" = "2000" game cheat "tf_bot_melee_attack_abandon_range" = "500" game cheat - If threat is farther away than this, bot will switch back to its primary weapon and attack "tf_bot_retreat_to_cover_range" = "1000" game cheat "tf_bot_debug_retreat_to_cover" = "0" game cheat "tf_bot_wait_in_cover_min_time" = "1" game cheat "tf_bot_wait_in_cover_max_time" = "2" game cheat "tf_bot_offense_must_push_time" = "60" game cheat - If timer is less than this, bots will push hard to cap "tf_bot_sniper_offense_push_time" = "60" game cheat - If timer is less than this, the Sniper will try to cap "tf_bot_min_travel_to_build_teleporter" = "4000" game cheat - How far away our goal needs to be before we try to build a teleporter "tf_bot_debug_sentry_placement" = "0" game cheat "tf_bot_medic_stop_follow_range" = "100" game cheat "tf_bot_medic_start_follow_range" = "300" game cheat "tf_bot_medic_max_heal_range" = "600" game cheat "tf_bot_medic_debug" = "0" game cheat "tf_bot_medic_cover_test_resolution" = "8" game cheat "tf_bot_sniper_flee_range" = "400" game cheat - If threat is closer than this, retreat "tf_bot_sniper_linger_time" = "5" game cheat - How long Sniper will wait around after losing his target before giving up "tf_bot_sniper_patience_duration" = "20" game cheat - How long a Sniper bot will wait without seeing an enemy before picking a new spot "tf_bot_min_setup_gate_defend_range" = "750" game cheat - How close from the setup gate(s) defending bots can take up positions. Areas closer than this will be in cover to ambush. "tf_bot_max_setup_gate_defend_range" = "2000" game cheat - How far from the setup gate(s) defending bots can take up positions "tf_bot_min_setup_gate_sniper_defend_range" = "1500" game cheat - How far from the setup gate(s) a defending sniper will take up position "tf_bot_max_point_defend_range" = "1250" game cheat - How far (in travel distance) from the point defending bots will take up positions "tf_bot_koth_sniper_spot_min_range" = "1000" game cheat "tf_bot_koth_sniper_spot_density" = "2" game cheat - How many sniper spots, on average, per 25x25 unit area "tf_bot_sniper_spot_max_count" = "100" game cheat - Stop searching for sniper spots when each side has found this many "tf_bot_show_sniper_spots" game cheat - Display the current set of sniper spots. "tf_bot_sniper_spot_epsilon" = "10" game cheat
How to use bots:
On official KOTH maps:
tf_bot_add
On non official KOTH maps:
sv_cheats 1
nav_max_view_distance 6000
nav_gererate
tf_bot_add
CP/KOTH/ARENA:
Bots work as intended on all but cp_steel
PL/PLR:
Busted, BLU will push the cart but RED will stay on the cap point.
A/D CTF/CTF:
Busted, teams stay in spawn and will not cap intel.
General notes:
tf_bot_add does allow optional class and team parameters. The command takes up to three arguments of <count> <class> <team>, which can appear in any order.
For example, tf_bot_add 5 red pyro would add 5 pyros to the red team.
tf_bot_force_class random for scouts and spies mixed in with the rest of the bots.
Bots will constantly get caught on clipping issues, as they follow very close to walls when walking.
The bots are actually very good in spawncamping
The bots do not allway avoid props, sometimes they just keep walking staight into a prop. They do avoid it after a few seconds.
They think a func_door brush is unpassible.
Class Notes:
Medic:
Medics will prioritize heavies over every class when healing, and occasionally they will appear to be spamming the fire button rather then constantly healing.
Medics will also fall off high ledges due to constant strafing, yet continue to attempt healing their previous target, even through a wall.
Engineer:
Engineers will build a Sentry and a Dispenser near an ammo kit and constantly return to the kit to build up their sentry.
Engineers prioritize their sentry when building, and level it up first.
Engineers build in a diagonal line, with the sentry in front and the dispenser behind.
When attacking, Engineers will primarily use their pistol, unless very close to the enemy.
Engineers, once their buildings are maxed, will stay crouched behind sentries and constantly hit them with their wench.
Engineers are more likely to build close to one another, however they do not appear (at the moment) to share metal with each other's dispensers
Engineer bots will build teleports if you set a tf_bot_min_travel_to_build_teleporter from 4000 to 0
Sniper:
Snipers will always headshot a class when zoomed in, however they occasionally will noscope.
Snipers (along with a few other classes) seem to huddle around dispensers.
Snipers will also fire on sight, rather then build up their shots. (When *searching* they will stay zoomed in however).
Heavy:
Heavies tend to play direct offense, they will consistently spin up their gun and walk into the heat of battle, even in the way of an enemy sentry.
I will add more info when I get the time to test these things more!
Special thanks to Jack Riguel, martijntje, Randdalf, Ravidge, and TheBladeRoden for the expanded notes.
Last edited: