survivor_bot

From Valve Developer Community
Jump to navigation Jump to search
Edit Tabs

Stub

This article or section is a stub. You can help by expanding it.

Icon-NotInFGD.png
This entity is not in the FGD by default.
It should not be put directly in a map because it can only be configured through code.
Recycle-warning.png
This is a preserved entity.
If the game has round restart mechanics this entity may not behave as expected.
C++ Class hierarchy
SurvivorBot
NextBotPlayer
CTerrorPlayer
CCSPlayer
CBaseMultiplayerPlayer
CBasePlayer
CBaseCombatCharacter
CBaseFlex
CBaseAnimatingOverlay
CBaseAnimating
CBaseEntity

survivor_bot is a model entity available in Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series.

Warning.pngWarning:Trying to spawn survivor_bot using SpawnEntityFromTable script function or by placing him directly in a map will crash the game
Icon-Important.pngImportant:Survivor_bot's classname is changed to player upon spawning
Note.pngNote:survivor_bot classname in-game can be observed on removed bots added back to game with sb_add while they are in their death state before spawning
Note.pngNote:All Keyvalues / Inputs / Outputs are same as player.

NetProps (DT_SurvivorBot)

m_humanSpectatorEntIndex <integer>
Entity index of the idle human player that owns this bot
m_humanSpectatorUserID <integer>
User ID of the idle human player that owns this bot

ConVars

Cvar/Command Parameters or default value Descriptor Effect
sb_all_bot_game 0 Allow a server of nothing but bots
sb_allow_leading 0 If nonzero, SurvivorBots can take the lead and won't always wait behind the lead human player
sb_allow_shoot_through_survivors 1 Allow SurvivorBots to shoot through fellow survivors
sb_battlestation_give_up_range_from_human 1500
sb_battlestation_human_hold_time 4 How long the nearest human must hold their place before SurvivorBots will re-evaluate their Battlestations
sb_close_checkpoint_door_interval 2
sb_close_threat_range 200
sb_combat_saccade_speed 1000
sb_crouch 0 Forces survivor bots to crouch
sb_debug_apoproach_wait_time 5 How long a SurvivorBot waits once it reaches its debug move-to spot
sb_debug_buddy 0
sb_debug_locomotion 0
sb_debug_retreat 0
sb_debug_team_avoidance 0
sb_dont_bash 0 Force SurvivorBots to not bash
sb_dont_shoot 0 Force SurvivorBots to not fire their weapons
sb_enforce_proximity_lookat_timeout 10
sb_enforce_proximity_range 1500
sb_escort 0
sb_far_hearing_range 1500
sb_flashlight 0 Forces survivor bots to use flashlights (-1 to force off)
sb_follow_stress_factor 0.5
sb_friend_immobilized_reaction_time_expert 0.5 How quickly a SurvivorBot realizes a friend has been Pounced or Tongued
sb_friend_immobilized_reaction_time_hard 1.0 How quickly a SurvivorBot realizes a friend has been Pounced or Tongued
sb_friend_immobilized_reaction_time_normal 2.0 How quickly a SurvivorBot realizes a friend has been Pounced or Tongued
sb_friend_immobilized_reaction_time_vs 0.5 How quickly a SurvivorBot realizes a friend has been Pounced or Tongued
sb_friendlyfire 0 **Should SurvivorBot bullets hurt other survivors?
sb_hindrance_range 150
sb_hold_position 0 Force SurvivorBots to stand still
sb_l4d1_survivor_behavior 1
sb_locomotion_wait_threshold 10
sb_max_battlestation_range_from_human 750
sb_max_scavenge_separation 750 SurvivorBots won't scavenge items farther away from the group than this
sb_max_team_melee_weapons 0 The total number of melee weapons allowed on the team. 0 = bots never use melee
sb_melee_approach_victim 0
sb_min_attention_notice_time 0.5 If someone looks at me longer than this, I'll notice
sb_min_orphan_time_to_cover 1
sb_minigun_distance 30.0
sb_move 1 Stop all SurvivorBots from moving
sb_narrow_corridor_width 100
sb_near_hearing_range 500
sb_neighbor_range 300 How close a friend needs to be to feel safe
sb_normal_saccade_speed 350
sb_open_fire 0 Forces survivor bots to fire continuously
sb_path_lookahead_range 200
sb_perf_collect 1 Collect perf for Steam stats
sb_perf_crawl 0 If true, survivor bot will be doing a perf-crawl walk through the map
sb_perf_crawl_ang 5 Rotation angles at perf-crawl snapshots in the map
sb_perf_crawl_dist 128 Distance between perf-crawl snapshots in the map
sb_perf_crawl_time 1.0 How much time is spent at each perf-crawl spot/ang in the map
sb_perf_dump 0 If true, low perf places will be dumped
sb_perf_dump_bots namvet, girl, biker, manager
sb_perf_dump_low 40 Low perf threshold
sb_perf_dump_low_dist 64 Dump low perf points at least this distance apart
sb_pushscale 1.0
sb_reachability_cache_lifetime 3
sb_reachable_cache_paranoia 0
sb_replacement_interval 0 Force SurvivorBots to be replaced after this many seconds for stress testing
sb_rescue_vehicle_loading_range 300 How close to the arrival point of the rescue vehicle SurvivorBots try to get
sb_revive_friend_distance 125.0
sb_separation_danger_max_range 600 A Survivor teammate this far away needs to be gathered back into the group
sb_separation_danger_min_range 200 A Survivor teammate this far away is straying from the group
sb_separation_range 200 Desired distance between Survivors
sb_show_threat_areas 0
sb_sidestep_for_horde 0 Allow sidestepping left/right to acquire common infected targets
sb_skill survivor
sb_stop 0 Forces survivor bots to stand still
sb_temp_health_consider_factor 0.5 Temporary health is multiplied by this when SurvivorBots consider who needs healing
sb_threat_close_range 150 Very close range for threats
sb_threat_exposure_stop 200000
sb_threat_exposure_walk 50000
sb_threat_far_range 600 Close enough to be a threat if near several other threats
sb_threat_medium_range 300 Too close for comfort, even when neutral
sb_threat_very_close_range 150
sb_threat_very_far_range 1500 Too far to be a threat, even for boss infected
sb_toughness_buffer 15 How much more SurvivorBots must be hurt to conider themselves equally valid as a healing target
sb_transition 1 If true, survivor bots will be used as placeholders for survivors who are still changing levels
sb_unstick 1
sb_use_button_range 1000
sb_use_upgrades 1
sb_vomit_blind_time 5 How long Boomer vomit/explosion gore blinds us

ConCommands

Cvar/Command Parameters or default value Descriptor Effect
sb_add Add a Survivor Bot.
sb_force_max_intensity Force intensity of selected SurvivorBot to maximum level.
sb_give Give an item to each Survivor bot
sb_give_random_weapon Give a random weapon to each Survivor bot
sb_move_to_cursor Sends survivor bots to cursor target
sb_takecontrol Take control of a bot.

Actions

Survivor Bots internally utilize Intention (HFSM + Stack) to manage the execution of their own internal behaviors, and they feature two concurrent internal behavior systems: Main and Leg.

Main: Primary decision making, attention, target selection and attack
Legs: Slaved to Main, responsible for staying near team unless otherwise directed

Among these, Leg employs the A* algorithm combined with NavMesh for pathfinding and navigation.

Main and Leg
Main and Leg
Note.pngNote:These actions can all be viewed with the console command nb_debug BEHAVIOR. Prior to this, it is recommended that you first use sv_cheat 1 and nb_debug_filter <the bot's entity index> to target a single bot for its behavior debug info — otherwise, debug data for Special Infected bots, Common Infected bots and Survivor bots will all be spammed to the console at once! Additionally, adding the -dev launch option will let you see extra debug information for this command in the console.
  • L4D1SurvivorBehavior
  • L4D1SurvivorLegsBattleStations
  • L4D1SurvivorMinigunAttack
survivors spawned from info_l4d1_survivor_spawn if sb_l4d1_survivor_behavior cvar is 1
  • SurvivorApproachMinigun
  • SurvivorAttack
  • SurvivorAttractAndGiveItem
  • SurvivorAttractForItemGive
  • SurvivorBehavior
  • SurvivorCheckpointLeaving
  • SurvivorCheckpointReached
  • SurvivorCloseDoor
  • SurvivorDebugApproach
  • SurvivorDispatchEnemy
  • SurvivorElevatorEnter
  • SurvivorElevatorRide
  • SurvivorEngageTheEnemy
  • SurvivorEscapeFlames
  • SurvivorEscapeLadderAmbush
  • SurvivorEscapeSpit
  • SurvivorFinale
  • SurvivorFinaleBattle
  • SurvivorFinaleEscapeToVehicle
  • SurvivorFinaleInitiate
  • SurvivorFinalePreparation
  • SurvivorFinaleRideVehicleAway
  • SurvivorGiveItem
  • SurvivorHealFriend
  • SurvivorHealSelf
  • SurvivorHelpChokingFriend
  • SurvivorHelpPouncedFriend
  • SurvivorLegsApproach
  • SurvivorLegsApproachElevator
  • SurvivorLegsBattleStations
  • SurvivorLegsCoverFriendInCombat
  • SurvivorLegsCoverOrphan
  • SurvivorLegsEnterRescueVehicle
  • SurvivorLegsMeetRescueVehicleArrival
  • SurvivorLegsMoveOn
  • SurvivorLegsMoveToVantagePoint
  • SurvivorLegsMoveUp
  • SurvivorLegsRegroup
  • SurvivorLegsRetreat
  • SurvivorLegsStayClose
  • SurvivorLegsWait
  • SurvivorLiberateBesiegedFriend
  • SurvivorReactToTongueGrab
  • SurvivorReactToVomitOnFriend
  • SurvivorReactToVomitOnMe
  • SurvivorTakePills
  • SurvivorTankAttacking
  • SurvivorWitchAttacking
  • SurvivorUseObject
⮤SurvivorAmbushBoomer
⮤SurvivorCollectObject
⮤SurvivorDislodgeVictim
⮤SurvivorGivePillsToFriend
⮤SurvivorRescueBarricadedFriend
⮤SurvivorReviveFriend

Action Converter

Note.pngNote:These Behavior Converters can also be viewed with the nb_debug BEHAVIOR command.
They are responsible for performing atomic transformations on the internal behaviors of the bot.
  • CHANGE_TO
  • DONE
  • ENDING
  • RESUME
  • START/STARTING
  • ... to SUSPEND_FOR ... caused ...

Events

These events are forwarded to Locomotion, Body, Vision and Intention. In the Intention subsystem, events are:

-First handled by the innermost child Action
-If child has no response, event is sent to buried Action
-If no buried Actions have a response, event is sent to parent

Event Propagation inside Survivor Bots
Event Propagation inside Survivor Bots


Note.pngNote:These events can be retrieved with nb_debug EVENTS.
Todo: Can these events be hooked via reverse engineering?
  • OnLeaveGround
  • OnLandOnGround
  • OnContact
  • OnMoveToSuccess
  • OnMoveToFailure
  • OnStuck
  • OnUnStuck
  • OnPostureChanged
  • OnAnimationActivityComplete
  • OnAnimationActivityInterrupted
  • OnAnimationEvent
  • OnInjured
  • OnKilled
  • OnOtherKilled
  • OnSight
  • OnLostSight
  • OnThreatChanged
  • OnSound
  • OnSpokeConcept
  • OnNavAreaChanged
  • OnModelChanged
  • OnPickUp
  • OnDrop
  • OnShoved
  • OnBlinded
  • OnEnteredSpit
  • OnHitByVomitJar
Confirm:Will OnCommandAttack, OnCommandAssault, OnCommandApproach, OnCommandRetreat,
OnCommandPause, and OnCommandResume all be triggered when the corresponding BOT_CMD
commands of the vscript function CommandABot() are executed?
  • OnCommandAttack
  • OnCommandAssault
  • OnCommandApproach
  • OnCommandRetreat
  • OnCommandPause
  • OnCommandResume
  • OnCommandString
OnCommandString is triggered when the command nb_command <arbitrary string> is executed. Its function is to send the given arbitrary string, for the purpose of testing whether the event can reach the inside of the behavior and be accepted by the internal behavior. The content of the string itself has no practical meaning and is used solely for debugging.

See also