AI Metrics

From Valve Developer Community
Jump to: navigation, search

The majority of this information is for the Half-Life 2 ai.

Introduction

The NPCs in Half-Life 2 have a variety of constraints influencing how they behave and interact. This includes everything from cover search distance to jump height, and as a level designer this information can be quite handy when constructing an encounter. All the distances listed are in Hammer editor units.

Default Metrics

These are the default metrics for the NPCs; information such as jump height can change between different classes.

Squads

  • Max number of squad members = 16

Jumping

This information applies to jump hint nodes as well.

  • Max Jump Drop = 192
  • Max Jump Up = 80
  • Max Jump Distance = 250

Cover and Line-Of-Sight Acquisition

  • Crouching eye height (used to test low cover) = 40
  • Standing eye height = 64
  • Max cover search distance from NPC = 784
  • Max Line-Of-Sight search distance from target = 1024
  • Distance between lateral checks (used for navigation off node graph) = 48
  • Number of lateral checks (used for navigation off node graph) = 5

Weapon Metrics

This is the information the NPCs use when handling weapons. Minimum and maximum ranges are the distances that the NPC will actually fire the weapon, this can be modified by the long range spawn flag, and sometimes change depending on the running behavior. The accuracy cones for different NPCs are listed here as well,

AR2

  • Minimum range = 65
  • Maximum range = 2048
  • NPC damage = 3
  • Alt fire decay distance = 2000
  • NPC alt fire damage to player = 20
  • Accuracy:

Pistol

  • Minimum range = 24
  • Maximum range = 1500
  • NPC damage = 3
  • Accuracy:
    • Default = 5 degrees
    • metrocop = 12.5 degrees

RPG

  • Minimum range = 480
  • Maximum range = 6000

Shotgun

  • Minimum range = 0
  • Maximum range = 500
  • Number of pellets = 8
  • NPC damage per pellet = 3 (24 damage total)
  • Accuracy:
    • Default = 10 degrees
    • Alyx = 3 degrees

SMG1

  • Minimum range = 0
  • Maximum range = 1400
  • Maximum range for allies = 3000
  • NPC damage = 3
  • Accuracy:

NPC Specific Metrics

These are specific metrics for NPCs, such as Antlion jump metrics and Combine Soldier grenade distances.

APC Driver

  • Minimum machine gun range = 0
  • Maximum machine gun range = 1250
  • Minimum rocket range = 1250
  • Maximum rocket range = 5200

Antlion

  • Max Jump Drop = 512
  • Max Jump Up = 512
  • Min Jump Distance = 128
  • Max Jump Distance = 1024
  • Worker Eye Height = 96
  • Worker Minimum Range Attack = 240
  • Worker Maximum Range Attack = 1800

Antlion Guard

  • Minimum Charge Distance = 256
  • Maximum Charge Distance = 2048
  • Maximum Melee Range = 156
  • Time Inbetween Charges = 4
  • Max Possible Summon Distance = 264

Combine Soldier

  • Height of Shotgun = 36
  • Minimum grenade distance = 128
  • Maximum grenade distance = 1024
  • If an enemy has moved farther than this after taking cover, then don't grenade = 256
  • Minimum AR2 alt fire distance = 128
  • Distance at which to ignore squad slots when advancing = 3000
  • Distance at which tactical variant "Pressure until within 30ft, then normal" switches = 360

Gunship

  • Minimum attack distance (relative to ground) = 512
  • Inner navigation distance (radius from path_track path) = 400
  • Outer navigation distance (radius from path_track path) = 800
PlacementTip.gifPlacement Tip:Make sure you keep these distances in mind, to avoid the large gunship from clipping into buildings or props surroundings its path.

Headcrab

  • Minimum attack distance = 48
  • Maximum attack distance = 256

Hunter

  • Max Jump Drop = 384
  • Max Jump Up = 220
  • Max Jump Distance = 512
  • Min flechette range = 100
  • Max flechette range = 1200
  • Min charge distance = 256
  • Max charge distance = 1024

Metropolice

  • Mid attack range (use spawn flag) = 3500
  • If armed with a pistol, the metrocop will stop advancing at this distance = 300

Fast Zombie

  • Minimum leap attack range = 200
  • Maximum leap attack range = 300
  • Maximum leap attack range z-axis = 128
  • Max Jump Drop = 384
  • Max Jump Up = 220
  • Max Jump Distance = 512

Poison Zombie

  • Maximum headcrab throw range = 800
  • Minimum headcrab throw range = 250
  • Maximum headcrab leap range = 256
  • Minimum headcrab leap range = 12

Scanner

  • Minimum distance to dive bomb (length) = 360
  • Minimum distance to dive bomb (vertical) = 120
  • Default follow distance = 128
  • Maximum distance to flash attack (2D) = 350
  • Minimum time between flash attacks = 8
  • Maximum time between flash attacks = 12
  • Minimum distance to come in high for an attack (2D) = 300

Strider

  • Maximum distance to stab someone (from bottom) = 260

Sniper

  • If laser view cone, distance from laser player must be to be seen = 35

See also