Skip to content
Techniques & Technology

Unit Pathfinding

Navigation intelligence

Unit pathfinding algorithms determine how game units navigate terrain, with RTS games demanding solutions that scale to hundreds of units finding optimal routes simultaneously.

pcAmigasega-mega-drive programmingairts 1992–present

Overview

Getting from A to B, intelligently. Pathfinding seems simple until hundreds of units need simultaneous routes through dynamic terrain while avoiding each other. RTS games pushed pathfinding algorithms to their limits—A* became industry standard, flow fields handled mass movement, and hierarchical approaches managed computational cost. Bad pathfinding ruins otherwise excellent games.

Fast facts

  • Core algorithm: A* (A-star).
  • Challenge: Scale and performance.
  • Modern approach: Flow fields, hierarchical.
  • Failure mode: Units stuck, wrong routes.

A* algorithm

ComponentFunction
Open listNodes to evaluate
Closed listEvaluated nodes
HeuristicDistance estimation
Cost functionPath optimisation

RTS challenges

ProblemDifficulty
Unit countHundreds simultaneously
Dynamic obstaclesMoving units
Terrain variationDifferent costs
Formation keepingGroup movement

Flow fields

AdvantageApplication
Shared calculationMass movement
ScalabilityAny unit count
Smooth pathsNatural movement
Pre-computationPerformance gain

Hierarchical pathfinding

LevelFunction
StrategicRegion navigation
TacticalLocal movement
ReactiveImmediate avoidance

Common failures

IssuePlayer experience
Stuck unitsFrustration
Suboptimal routesInefficiency
Traffic jamsBottlenecks
Formation breakingTactical loss

Notable implementations

GameAchievement
Age of Empires IISmooth group movement
StarCraft IIResponsive micro
Supreme CommanderThousands of units

See also