Game AI: sources and measurements

The research behind the game-ai skill and the C# example's Ai/ classes, gathered on 2026-10-21. It draws on Game AI Pro chapters, GDC papers, Reynolds' steering paper and the Godot 4.7.2 source. Measurements ran headless on 4.7.2 mono and .NET 8.

Sources

Source What it gave
Game AI Pro ch. 4, "Behavior Selection Algorithms" When state machines explode; hierarchical machines with history states; GOAP and HTN compared
Damian Isla, "Handling Complexity in the Halo 2 AI", GDC 2005 10 to 20 children per combat behaviour; float priorities "almost impossible" beyond twenty, so relevance became yes or no; a bonus against dithering; stimulus behaviours for 1 to 2 seconds
Champandard and Dunstan, "The Behavior Tree Starter Kit" The active selector that re-checks and aborts the running child; abort side effects
Rez Graham, "An Introduction to Utility Theory"; Kevin Dill, "Dual-Utility Reasoning"; Mike Lewis, "Choosing Effective Utility-Based Considerations" Response curves, inertia against frantic switching, ranks and weights, multiplied considerations, cooldowns
Jeff Orkin, "Three States and a Plan: The AI of F.E.A.R." (GDC 2006) and "Agent Architecture Considerations for Real-Time Planning in Games" (AIIDE 2005) Three states plus a planner; action costs and A*; procedural preconditions; 4 to 8 enemies; one active goal; replanning on events
Higley, Conway and Jacopin, "Goal-Oriented Action Planning: Ten Years of AI Programming" (GDC panel, about 2015): notes Situational costs (melee 1 + walk 20 loses to ranged 10 + walk 1); plans of one or two actions in F.E.A.R., Shadow of Mordor and Rise of the Tomb Raider; about 40 exclusive flags folded into one enum; up to 50 plans per frame; roles handed out by a separate system
"Beyond Framerate: Taming Your Timeslice Through Asynchrony" (Ben, Havok AI; GDC, year not stated): notes Deliberation is slow but infrequent, so spread it over frames under a fixed budget; background threads give no guaranteed CPU; check the clock every few steps; re-check the world after a pause
Troy Humphreys, "Exploring HTN Planners through Example" Method traversal records; replanning on the plan's own effects cancels deliberate steps
"A House Built on Sand: Engineering Stable and Reliable AI" (GDC, speaker and year not in the transcript): notes Checks that must agree (arrived and in range; squad turns) disagree under rounding, worse far from the origin; decide once per squad; test at the largest coordinates
GDC AI Summit talks folded in: "AI Arborist", "Nuts and Bolts: Modular AI", "Knowledge is Power", "The Simplest AI Trick in the Book", "Designing Utility AI with Curvature", "AI Disaster Stories": notes A state machine above small behaviour trees; retry and cooldown rules; per-consideration utility logs and stalls; loud disabled data; reaction delays, richer target records and sensor stale times (pitfalls.md, perception.md)
Craig Reynolds, "Steering Behaviors For Autonomous Characters" (GDC 1999) Seek, flee, arrive, pursuit, evasion, wander, separation, cohesion, alignment; combining behaviours
Lars Lidén, "Artificial Stupidity: The Art of Intentional Mistakes", AI Game Programming Wisdom 2 (2003), read through Trazzi and Yampolskiy, arXiv 1808.03644, and Mick West, "Intelligent Mistakes" (2009); the chapter itself was out of reach Move before firing, miss the first time, and the commonly summarised rest as testable rules (mistakes.md); no quote from the chapter
Chris Stark, "Math for Game Programmers: Predictable Projectiles" (notes) Exact lead by a quadratic, ballistic throws from designer knobs, miss cones with tilt; Ai/Aim.cs and its hit rates
Andrew Fray, "Context Steering" Where summed steering fails when players watch closely
Malte Skarupke, "Automated AI Testing"; David Young, "Debugging AI with Instant In-Game Scrubbing" Unit tests under 10 ms; scenario tests that wait on conditions with a time-out; recording decisions to a ring buffer
Eric Martel, "Can You See Me Now? Building Robust AI Sensory Systems" (GDC; notes) Shape and range before any ray; several sample points per target; modifiers as a stack that only reduces; the C# example's Ai/Perception.cs
Godot 4.7.2 navigation documentation and source The API, project settings and defaults below
LimboAI v1.8.1, Beehave v2.9.3 (both MIT) LimboAI's C# support needs its engine-module build; Beehave is GDScript only

Measurements

What Result
Two utility actions at 0.5 with ±10% noise, 1000 ticks 502 switches with no momentum, 293 at 5%, 157 at 10%, 0 at 25%
Forward GOAP search, six-step plan among cheap irrelevant actions 13 actions: 13 ms; 16: no plan within 2000 states (45 ms); the C# example's test with 20: about 110 ms and no plan
Backward GOAP search, the same problems 63 µs for six steps among 20 irrelevant actions; 151 µs for ten among 50
Navigation region added in _Ready, default settings, first non-empty path Physics frame 6 or 7, varying between identical runs; frame 3 with either asynchronous iteration off; frame 2 with both off
The documentation's "await one physics frame" Not enough on 4.7.2 defaults; MapGetIterationId > 0 not enough; MapForceUpdate obsolete and no help; waiting for another MapChanged hangs with asynchronous iterations off
A path query on an unsynchronised map Empty path, IsNavigationFinished() false, the agent's own position as the next point: it stands still with no error
MapGetPath on a 312-polygon 2D mesh About 40 µs per query; reusing query objects was not faster; MapGetClosestPoint about 4 µs
Baking 2000 × 2000 with 64 obstacles 16 to 22 ms synchronously
Two avoiding agents, two runs with --fixed-fps 60 Identical final positions

Not confirmed