agent-pathfinding mechanic sourced
Agent pathfinding
Agents compute routes through space using movement costs, and the routes they choose shape congestion, travel time, and access.
definition
Owns a traversal representation (tile grid, navmesh, or waypoint graph) with per-cell or per-edge movement costs and permissions, plus each agent's current path or a shared direction field. On request a search returns a least-cost route from position to goal; A* (Hart, Nilsson, and Raphael, 1968) expands nodes by cost so far plus an admissible heuristic. Paths are invalidated and recomputed when the map changes or agents block each other. Scale variants trade exactness for speed: Factorio (2019) abstracts each 32x32 chunk into terrain components and runs a reverse resumable A* over them to supply the heuristic for tile-level A*; Supreme Commander 2 searches a portal graph between 10x10 m sectors and shares flow fields so many units read one direction field instead of each searching. Inputs: terrain and floor costs, doors and allowed areas, other agents. Outputs: routes, travel times, and occupancy along routes that feed hauling, traffic, and defense.
player experience
The player notices pathfinding mostly through layout: where doors, stockpiles, and roads go decides how far agents walk. In defense play the player builds mazes that lengthen enemy routes; in colony sims the player winces as a colonist crosses the map for one item. Failures are visible and comic, so players learn the cost model by watching.
design levers
- movement cost per terrain, floor, road, or door type
- search method and hierarchy (grid A*, navmesh, hierarchical abstraction, flow fields) and per-tick search budget
- repath triggers and frequency when the map or obstacles change
- local avoidance between agents (none, steering, reservation) versus passing through each other
- agent map knowledge and permissions (full map, explored only, allowed areas, locked doors)
failure modes
- Agents take absurd detours or get stuck because the cost model or permissions disagree with what the player sees on screen.
- Repathing storms after map edits become a late-game slowdown on large colony and factory maps.
- Per-unit paths ignore other units and stall at chokepoints; Emerson describes Supreme Commander 2's earlier single-path system compounding collisions into stops.
- Deterministic pathing invites exploits such as mazes and wall-hugging layouts that trivialize threats.
dynamics
- Shortest-path choices concentrate trips on a few links, producing congestion that lowers throughput without any explicit traffic rule.
- Defenders shape attacker routes with walls and gaps, so layout itself becomes the defense mechanic.
- Travel time silently becomes the largest work cost, so compact bases and well-placed stockpiles dominate efficiency.
open questions
- Can learned crowd models or mean-field approximations replace per-agent search at city scale while preserving individual route choices?
- How much should paths reflect imperfect knowledge and preferences such as scenery or safety rather than shortest cost?
ratings
12 from named runs; stored scores are their lower medianoriginal score
Watching routes teaches the effects of doors, roads and distance, making the cost model mostly intuitive. Permissions, obstacles and detours cause surprises below 5; typical layout decisions need less than deliberate investigation (3).
original score
Routes concentrate traffic, constrain hauling throughput and reshape defense, creating frequent chains across systems. This exceeds occasional unplanned situations (3), but route search is not universally a primary engine of stories (5).
original score
Traversal and cost rules generate route variety from the existing map. New path outcomes need neither content tables for each route (2) nor bespoke route assets, matching trivial per-variety authoring.
original score
Many searches and map-edit repathing storms commonly cause late-game slowdown, above modest linear work (2). Hierarchies, shared fields and budgets often control it, so dominant scale-capping cost (4) is not assumed for every typical use.
original score
Small cost, permission or avoidance changes can create dominant mazes, crippling congestion or unreasonable detours. This exceeds routine interacting-parameter tuning (3), but known route and avoidance controls allow settling behavior below 5.
original score
Learned heuristics, crowd policies and adaptive routing can notably improve movement variety or practical scale beyond incremental tuning (2). The goal-to-route role remains intact, and substantially new forms (4) are not established by the packet.