tf_bot

From Valve Developer Community
Revision as of 17:12, 29 August 2021 by Amicdict (talk | contribs) (Properly format page title.)
Jump to navigation Jump to search
English (en)Translate (Translate)

Team Fortress 2 tf_bot is a point entity available in Team Fortress 2 Team Fortress 2.

C++ In code, it is represented by theCTFBotclass, defined in thetf_bot.cppfile.

Entity Description

A NextBot entity for TF2 that acts as a player. They are used for bots in Team Fortress 2, which are mainly used in the Training and Mann Vs. Machine gamemodes, and are created automatically by the game when creating a listenserver through the training option. This entity can be created through tf_bot_add, which when used will randomly select a bot name out of a hardcoded list of bot names.

Icon-Bug.pngBug:Creating the entity through ent_create will crash the game.  [todo tested in ?]
Icon-Bug.pngBug:This entity will not move in Capture The Flag (and by proxy MvM) if there is no flag for that entity's team.  [todo tested in ?]

ConVars/ConCommands

Cvar/Command Parameters or default value Descriptor Effect
tf_bot_add [count|name] [class] [team] [skill] ["noquota"] strings (processed without order) Creates a bot with specified parameters. This entity will borrow from tf_bot_difficulty if skill is omitted..
tf_bot_always_full_reload 0 0 disables, 1 enables Determines whether bots perform full reloads before firing.
tf_bot_ammo_search_range 5000 Hammer units How far bots will search to find ammo around them.
tf_bot_arrow_elevation_rate 0.0001 Arbitrary float When firing arrows at far away targets, this is the degree/range slope to raise our aim.
tf_bot_auto_vacate 1 0 disables, 1 enables Whether bots will automatically leave to make room for human players.
tf_bot_ballistic_elevation_rate 0.01 arbitrary float When lobbing grenades at far away targets, this is the degree/range slope to raise our aim.
tf_bot_capture_seek_and_destroy_max_duration 30 arbitrary float If a capturing bot decides to go hunting, this is the max duration he will hunt for before reconsidering.
tf_bot_capture_seek_and_destroy_min_duration 15 arbitrary float If a capturing bot decides to go hunting, this is the min duration he will hunt for before reconsidering.
tf_bot_cart_push_radius 60 Hammer units Maximum distance in which bots will stay within near the payload to push it.
tf_bot_choose_target_interval 0.3f Seconds (float) How often a bot can reselect his target
tf_bot_debug_ammo_scavenging 0 0 disables, 1 enables Draws debug informaton for bot ammo-information.
tf_bot_debug_destroy_enemy_sentry 0 0 disables, 1 enables Draw debug info for bots trying to destroy sentries.
tf_bot_debug_payload_guard_vantage_points 0 0 disables, 1 enables Draw vantage points for guarding the payload.
tf_bot_debug_retreat_to_cover 0 0 disables, 1 enables Draw debug info for bots retreating to cover.
tf_bot_debug_seek_and_destroy 0 0 disables, 1 enables Draw bot seek-and-destroy debug info.
tf_bot_debug_sentry_placement 0 0 disables, 1 enables Draw bot engineer sentry placement debug info.
tf_bot_debug_sniper 0 0 disables, 1 enables Draw Sniper bot debug information.
tf_bot_debug_spy 0 0 disables, 1 enables Draw Spy bot debug information.
tf_bot_debug_stuck_log Given a server logfile visually display bot stuck locations.
tf_bot_debug_stuck_log_clear Clear currently loaded bot stuck data.
tf_bot_debug_tags 0 0 disables, 1 enables ent_text will only show tags on bots.
tf_bot_defend_owned_point_percent 0.5 arbitrary float Stay on the contested point we own until enemy cap percent falls below this value.
tf_bot_defense_debug 0 0 disables, 1 enables Draw defense areas.
tf_bot_defense_must_defend_time 300 arbitrary float If timer is less than this value, bots will stay near point and guard.
tf_bot_difficulty 1 integer Sets default skill value.
tf_bot_engineer_building_health_multiplier 2 unknown type Unused.
tf_bot_engineer_exit_near_sentry_range 2500 Hammer units Maximum travel distance between a bot's Sentry gun and its Teleporter Exit
tf_bot_engineer_max_sentry_travel_distance_to_point 2500 Hammer units Maximum travel distance between a bot's Sentry gun and the currently contested point
tf_bot_engineer_mvm_hint_min_distance_from_bomb 1300 Hammer units Bot engineers will move if the bomb is within this range.
tf_bot_engineer_mvm_sentry_hint_bomb_backward_range 3000 Hammer units How far the MvM bot engineer can build backward.
tf_bot_engineer_mvm_sentry_hint_bomb_forward_range 0 Hammer units How far the MvM bot engineer can build forwards.
tf_bot_engineer_retaliate_range 750 Hammer units Engineer bots will attack if the attacker who destroyed sentry closer than this, otherwise the engineer bot will retreat.
tf_bot_escort_range 300 Hammer units Bots will escort anyone within this range if there are no enemies.
tf_bot_fetch_lost_flag_time 10 arbitrary float How long busy bots will ignore the dropped flag before they give up what they are doing and go after it
tf_bot_fire_weapon_allowed 1 0 disables, 1 enables If zero bots will not pull the trigger of their weapons (but will act like they did).
tf_bot_fire_weapon_min_time 1 arbitrary integer Minimum time bots will fire their weapon.
tf_bot_flag_escort_give_up_range 1000 Hammer units Bots will give up escorts at this range.
tf_bot_flag_escort_max_count 4 arbitrary integer Maximum amount of escorters allowed.
tf_bot_flag_escort_range 500 Hammer units Bots will escort the flag carrier within this range.
tf_bot_flag_kill_on_touch 0 0 disables, 1 enables If nonzero, any bot that picks up the flag dies. For testing.
tf_bot_force_class [blank by default] string If set to a class name, all bots will respawn as that class.
tf_bot_force_jump 0 0 disables, 1 enables Force bots to continuously jump.
tf_bot_formation_debug 0 0 disables, 1 enables Draw bot-formation debug info.
tf_bot_health_critical_ratio 0.3 arbitrary float Health ratio in which bots are "critically injured".
tf_bot_health_ok_ratio 0.8 arbitrary float Health ratio in which bots are considered "ok".
tf_bot_health_search_far_range 2000 Hammer units Critically-hurt bots will search for health within this range.
tf_bot_health_search_near_range 1000 Hammer units Uncritically-hurt bots will search for health within this range.
tf_bot_hitscan_range_limit 1800 Hammer units Maximum range in which bots will try to hit targets with hitscan.
tf_bot_join_after_player 1 0 disables, 1 enables If nonzero, bots wait until a player joins before entering the game.
tf_bot_keep_class_after_death 0 0 disables, 1 enables If zero bots will change class upon death, except in MvM.
tf_bot_kick [name|"red"|"blue"|"all"|"moveToSpectatorTeam"] string Kicks bots based on name and team, or all of them. Will instead move bots to spectator mode if moveToSpectatorTeam is added.
tf_bot_kill [name|"red"|"blue"|"all"] string Kills bots based on name and team, or all of them.
tf_bot_max_grenade_launch_at_sentry_range 1500 Hammer units Demoman bots will try to launch grenades at sentries in this range.
tf_bot_max_point_defend_range 1250 Hammer units How far (in travel distance) from the point defending bots will take up positions.
tf_bot_max_setup_gate_defend_range 2000 Hammer units An unused ConVar that would have determined how far from the setup gate(s) defending bots can take up positions.
tf_bot_max_sticky_launch_at_sentry_range 1500 Hammer units Demoman bots will try to launch stickies at sentries in this range.
tf_bot_max_teleport_entrance_travel 1500 Hammer units Don't plant teleport entrances farther than this travel distance from our spawn room
tf_bot_max_teleport_exit_travel_to_point 2500 Hammer units If an offensive engineer bot's tele exit is farther from the point than this, then destroy it.
tf_bot_medic_cover_test_resolution 8 arbitrary float Determines the angular increment when scanning for players to heal.
tf_bot_medic_debug 0 0 disables, 1 enables Draw debug info for medic bots.
tf_bot_medic_max_call_response_range 1000 Hammer units Calls for medic within this range will be heard.
tf_bot_medic_max_heal_range 600 Hammer units Bot medics will heal anyone within this range.
tf_bot_medic_start_follow_range 250 Hammer units Medics will start following their patients when in this range.
tf_bot_medic_stop_follow_range 75 Hammer units Medics will stop following their patients when in this range.
tf_bot_melee_attack_abandon_range 500 Hammer units If threat is farther away than this, bot will switch back to its primary weapon and attack
tf_bot_melee_only 0 0 disables, 1 enables If nonzero, bots will only use melee weapons
tf_bot_min_setup_gate_defend_range 750 Hammer units An unused ConVar that is supposed to determine how close from the setup gate(s) defending bots can take up positions and what areas would have been determined to be "in cover".
tf_bot_min_setup_gate_sniper_defend_range 1500 Hammer units An unused ConVar that supposedly would determine the distance from the setup gate(s) a defending sniper would go to "take up position".
tf_bot_min_teleport_travel 3000 Hammer units Minimum travel distance between teleporter entrance and exit before engineer bot will build one.
tf_bot_mvm_show_engineer_hint_region Show the nav areas MvM engineer bots will consider when selecting sentry and teleporter hints.
Note.pngNote:Is a cheat command.
tf_bot_near_point_travel_distance 750 Hammer units Range in which bots are considered to be "near" the point.
tf_bot_notice_backstab_chance 25 arbitrary integer Chance for bots to notice backstabs.
tf_bot_notice_backstab_max_range 750 Hammer units Maximum range in which bots will notice backstabs.
tf_bot_notice_backstab_min_range 100 Hammer units Minimum range in which bots will notice backstabs.
tf_bot_notice_gunfire_range 3000 Hammer units The range in which gunshots are noticed by bots.
tf_bot_notice_quiet_gunfire_range 500 Hammer units The range in which quiet gunshots are noticed by bots.
tf_bot_npc_archer_arrow_damage 75 arbitrary float Determines the arrow damage of NPC archer arrows.
tf_bot_npc_archer_health 100 arbitrary integer Determines the health of NPC archer bots.
tf_bot_npc_archer_shoot_interval 2 arbitrary float Determines the interval at which NPC archer bots fire.
tf_bot_npc_archer_speed 100 arbitrary integer Unused.
tf_bot_offense_must_push_time 120 arbitrary float If timer is less than this, bots will push hard to cap
tf_bot_offline_practice 0 arbitrary integer Tells the server that it is in offline practice mode.
tf_bot_path_lookahead_range 300 Hammer units How far a bot should look ahead.
tf_bot_payload_guard_range 1000 Hammer units Guard the payload within this range.
tf_bot_prefix_name_with_difficulty 0 0 disables, 1 enables Append the skill level of the bot to the bot's name
tf_bot_pyro_always_reflect 0 0 disables, 1 enables Pyro bots will always reflect projectiles fired at them. For tesing/debugging purposes.
tf_bot_pyro_deflect_tolerance 0.5 Radian (float) Defines the visible range in which Pyro bots can airblast projectiles.

Technically speaking Pyro TFBots will not airblast if the dot product between their normalized vector and a projectile's normalized vector is higher than the negative of this value.
tf_bot_pyro_shove_away_range 250 Hammer units If a Pyro bot's target is closer than this, then compression blast them away
tf_bot_quota 0 arbitrary integer Determines the total number of tf bots in the game.
tf_bot_quota_mode normal string Determines the type of quota. Allowed values: 'normal', 'fill', and 'match'. 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.
tf_bot_reevaluate_class_in_spawnroom 1 0 disables, 1 enables If set bots will opportunistically switch class while in spawnrooms if their current class is no longer their first choice.
tf_bot_retreat_to_cover_range 1000 Hammer units How far to search for cover.
tf_bot_sniper_aim_error 0 Hammer units Margin of error in sniper aim radius.
tf_bot_sniper_aim_steady_rate 10 aribtrary float Determines the angle rate at which the bot aim becomes steady.
tf_bot_sniper_allow_opportunistic 1 0 disables, 1 enables If set, Sniper bots will stop on their way to their preferred lurking spot to snipe at opportunistic targets.
tf_bot_sniper_choose_target_interval 3 Seconds (float) How often a zoomed-in Sniper can reselect his target.
Note.pngNote:Currently unused.
tf_bot_sniper_flee_range 400 Hammer units Sniper bots retreat if their threat is closer than this range.
tf_bot_sniper_goal_entity_move_tolerance 500 Hammer units How far a sniper spot can be from the point before being ignored.
tf_bot_sniper_linger_time 5 arbitrary float How long Sniper will wait around after losing his target before giving up.
tf_bot_sniper_melee_range 200 Hammer units Sniper bots will attack with melee if their threat is closer than this range.
tf_bot_sniper_patience_duration 10 arbitrary float How long a Sniper bot will wait without seeing an enemy before picking a new spot.
tf_bot_sniper_personal_space_range 1000 Hammer units Enemies beyond this range don't worry Sniper bots.
tf_bot_sniper_spot_epsilon 100 Hammer units Maximum distance between sniper spots to consider them one spot.
tf_bot_sniper_spot_max_count 10 arbitrary integer Stop searching for sniper spots when each side has found this many.
tf_bot_sniper_spot_min_range 1000 Hammer units Minimum length for a sightline to be considered usable.
tf_bot_sniper_spot_point_tolerance 750 Hammer units The range in which a sniper can stand near a vantage point.
tf_bot_sniper_spot_search_count 10 arbitrary integer Search this many times per behavior update frame.
tf_bot_sniper_target_linger_duration 2 arbitrary float How long a Sniper bot will keep toward at a target it just lost sight of.
tf_bot_spawn_use_preset_roster 1 unknown Bot will choose class from a preset class table.
tf_bot_spy_change_target_range_threshold 300 Hammer units Spy bots will change to newer targets if their current target is further than this range.
tf_bot_spy_knife_range 300 Hammer units Spy Bots will prefer their knife if their threat is closer than this range.
tf_bot_squad_escort_range 500 Hammer units If a bot is using a melee weapon, close and attack with it while staying near the leader with in this range.
tf_bot_sticky_base_range 800 arbitrary integer Demoman bots will charge their stickies if their target sentry is further than this range.
tf_bot_sticky_charge_rate 0.01 arbitrary float Seconds of charge per unit range beyond base.
tf_bot_stickybomb_density 0 arbitrary integer Number of stickies to place per square inch.
tf_bot_suicide_bomb_friendly_fire 1 0 disables, 1 enables Sentry Busters can kill ally bots on its team.
tf_bot_suicide_bomb_range 300 Hammer units Sentry Busters will kill players in this range and start detonation in a third of this value.
tf_bot_suspect_spy_forget_cooldown 5 arbitrary integer How long to consider a suspicious spy as suspicious.
tf_bot_suspect_spy_touch_interval 5 ticks (integer) How many ticks back to look for touches against suspicious spies.
tf_bot_taunt_victim_chance 20 arbitrary float 1/value chance for a bot to taunt after killing a bot.
tf_bot_teleport_build_surface_normal_limit 0 Hammer units If the ground normal Z component is less that this value, Engineer bots won't place their entrance teleporter.
tf_bot_wait_in_cover_max_time 2 arbitrary float Maximum time bots will hide in cover.
tf_bot_wait_in_cover_min_time 1 arbitrary float Minimum time bots will hide in cover.
tf_bot_warp_team_to_me Teleports all ally bots to !activator.
tf_mvm_bot_flag_carrier_interval_to_1st_upgrade 5 Seconds (float) The time before the bomb carrier performs the 1st upgrade.
tf_mvm_bot_flag_carrier_interval_to_2nd_upgrade 15 Seconds (float) The time before the bomb carrier performs the 2nd upgrade.
tf_mvm_bot_flag_carrier_interval_to_3rd_upgrade 15 Seconds (float) The time before the bomb carrier performs the 3rd upgrade.

Keyvalues

TeamNum:
Initial Team (TeamNum) <choices>
Which Team the entity belongs / is assigned to on spawn
  • 0: None
  • 1: Spectator/Halloween Souls Team Fortress 2
  • 2: RED Team Fortress 2
  • 3: BLU/Robots Team Fortress 2
  • 5: Halloween Bosses (only in Team Fortress 2) !FGD
Note.pngNote:Content moved to Rendering and studio model related KIO/Keyvalues for continuation of page history


Inputs

IgnitePlayer <integerRedirectInput/integer>
Team Fortress 2 Ignites the entity with a specified lifetime and causes a reaction (sound and speech).
ExtinguishPlayer
Team Fortress 2 Extinguishes the entity.
BleedPlayer <integerRedirectInput/integer>
Team Fortress 2 Bleeds the entity with a specified length.
RollRareSpell
Team Fortress 2 Forces the entity to roll a rare spell. Only available if spells are enabled on the map.
SetCustomModel <stringRedirectInput/string>
Team Fortress 2 Set a custom entity model without animations.
SetCustomModelOffset <vectorRedirectInput/Vector>
Team Fortress 2 Set a custom model position on the entity.
SetCustomModelRotation <vectorRedirectInput/Vector>
Team Fortress 2 Set a custom model rotation on the entity.
ClearCustomModelRotation
Team Fortress 2 Clears the custom model rotation.
SetCustomModelRotates <booleanRedirectInput/boolean>
Team Fortress 2 Set if the custom model rotates or not to the entity's angles.
SetCustomModelVisibleToSelf <booleanRedirectInput/boolean>
Team Fortress 2 Set if the custom model is visible to the entity, in thirdperson.
SetForcedTauntCam <booleanRedirectInput/boolean>
Team Fortress 2 Forces the player into thirdperson mode.
SpeakResponseConcept <stringRedirectInput/string>
Team Fortress 2 Forces the player to speak the specified response concept, an example being halloweenlongfall.
TriggerLootIslandAchievement
Team Fortress 2 [Todo].
TriggerLootIslandAchievement2
Team Fortress 2 [Todo].
RoundSpawn
Team Fortress 2 [Todo].
SetTeam <integerRedirectInput/integer>
Changes the entity's team.

CBaseCombatCharacter:

KilledNPC  !FGD
Tells the entity it killed something. Despite the name, this can include a player. This input will be automatically sent by the victim when they die.
physdamagescale <floatRedirectInput/float>
Scales damage energy when this character is hit by a physics object. With a value of 0 the NPC will take no damage from physics.
Note.pngNote:Content moved to Rendering and studio model related KIO/Inputs for continuation of page history


Outputs

Note.pngNote:Content moved to Rendering and studio model related KIO/Outputs for continuation of page history


See Also