Up nextNext guide
How to Write YouTube Video Scripts with AI
Applications
Applications GUIDE
Game AI controls non-player characters (NPCs) so they navigate, fight, and react believably.
Listen to this guideAI-narrated · ~2 min
It blends decades-old techniques like state machines with new generative models that let characters talk and improvise.
NPC behavior is one of the oldest applied-AI fields, but most 'game AI' is not machine learning at all. Classic enemies use finite state machines (idle, patrol, chase, attack) and behavior trees, which designers handcraft for predictable, tunable fun. Pathfinding leans on the A* algorithm to navigate maps. Landmark examples include F.E.A.R.'s goal-oriented action planning (GOAP), which made soldiers flank and coordinate, and the Halo series' layered behavior systems. Game AI is often intentionally 'dumbed down' so it feels fair and beatable rather than ruthlessly optimal. More recently, studios are experimenting with large language models to power dynamic dialogue, letting NPCs respond to open-ended player speech instead of fixed dialogue trees, as seen in tech demos from NVIDIA and Ubisoft.
F.E.A.R.'s soldiers using goal-oriented action planning to flank, take cover, and coordinate assaults
The Halo series' enemies retreating, regrouping, and reacting to grenades via layered behavior systems
A* pathfinding letting NPCs in countless games navigate around obstacles to reach the player
NVIDIA ACE and Ubisoft demos using LLMs to let NPCs hold unscripted spoken conversations with players
LLM-driven NPCs promise truly open conversations and emergent personalities, but face hurdles: latency, cost, hallucinated lore, and the risk of breaking carefully written narratives. Expect hybrids where designers constrain generative models with guardrails and lore databases. Reinforcement learning may produce more adaptive opponents, while on-device small models keep dialogue responsive and private. The craft challenge remains making NPCs fun, not merely smart.
Free newsletter
One short email each weekday with the three AI stories that actually matter. Free forever, no ads.
One email each weekday. Unsubscribe in one click. We never sell or share your address.
Test yourself
Instant feedback on every answer, and a shareable certificate with a verifiable ID once you pass a course.
Support free AI education. AI Understanding is a 501(c)(3) nonprofit — no ads, no paywall, ever. Make a donation
Game AI controls non-player characters (NPCs) so they navigate, fight, and react believably. It blends decades-old techniques like state machines with new generative models that let characters talk and improvise.
A* is the classic pathfinding algorithm, using actual cost plus a heuristic estimate to find efficient routes across a navigation mesh.
Designers handcraft state machines and behavior trees for predictable, tunable behavior, not machine learning, in most classic games.
F.E.A.R.'s soldiers used GOAP, planning action sequences from goals at runtime, which produced impressively tactical, coordinated behavior.
Designers tune AI to be fun and fair; a perfectly optimal opponent would usually be frustrating and unenjoyable to play against.
LLMs can invent incorrect lore or say things that contradict the story, plus issues like latency and cost, so guardrails are needed.
Keep learning
More guides picked for this topic
Up nextNext guide
How to Write YouTube Video Scripts with AI
Applications