AI in Video Games: NPCs and Procedural Worlds cover
AI Literacy · Unit 7: AI in Daily Life (Hidden in Plain Sight) · Reading Comprehension Worksheet

AI in Video Games: NPCs and Procedural Worlds

Quality reviewed September 2026

Facts verified September 20, 2026

Quick facts
Subject
Career & Life Skills
Grades
Grades 9-12
Length
9-page student worksheet
Time
About one 50-minute class period
Great for
Sub plans and independent work
Includes
Reading passage, comprehension questions + full answer key
Format
Print-and-go PDF
Jump to download ↓
Fits: AI Literacy ยท Career & Life Skills

What students do

  • Sort five terms, from finite state machine to reinforcement learning, against their correct definitions
  • Three blanks pull No Man's Sky's planet count, DeepMind's Go playing system, and the field reinforcement learning also trains from the text
  • Three multiple choice questions cover finite state machines, AlphaGo's significance, and why LLM driven NPCs are not widespread yet
  • Explain why the Covenant guard was not actually learning from Tyrell even though it seemed to adapt

What it covers

  • Seven passages on NPC behavior trees, procedural generation, machine learning in games, and real world spillover
  • A key info table on Pac-Man's ghosts, No Man's Sky, AlphaGo, and Unity and Unreal's ML toolkits
  • Tyrell's forum post about a guard that would not stay fooled, plus a PDF answer key

Start reading this worksheet

the opening sections, straight from the download

The Other Players You've Always Ignored

In nearly every video game you've ever played, there is a hidden layer of artificial intelligence operating constantly in the background. Non-player characters (the shopkeeper who offers you supplies, the guard who patrols the castle, the enemy soldier who takes cover when you open fire) are all controlled by game AI. This form of AI is older than most people realize: the ghosts in Pac-Man (1980) each had individual behavior rules that made them behave differently from each other. Pac-Man's AI is primitive by modern standards, but the design principle it embodies (programming distinct, responsive behavior into game characters) is still at the heart of every major game release today. Game AI is a discipline separate from the broader AI development happening at companies like Google and Anthropic. Game developers don't need their NPCs to be genuinely intelligent; they need them to appear intelligent and behave in ways that make the game fun and challenging. That distinction matters, because it means game AI is often built from tricks and clever illusions rather than genuine machine learning.

How NPC Behavior Is Built

The most common tool for creating NPC behavior is the finite state machine (FSM). An FSM defines a set of states a character can be in (patrolling, investigating, attacking, fleeing, idle) and a set of rules that trigger transitions between states. A guard NPC might: patrol a route (state 1) until it detects the player (transition trigger), then switch to alert mode (state 2), then attack (state 3) if the player gets within a certain range, then switch to fleeing (state 4) if health drops below 20%. More sophisticated games use behavior trees, which are hierarchical structures that let designers build complex, layered decision logic. A behavior tree might define a soldier NPC that first checks if it has ammo, then if it has cover nearby, then if allies are present, and makes different decisions based on the answers to all three questions. Modern shooters like the Halo series, The Last of Us, and games in the Far Cry franchise have used behavior trees to create enemies that seem to communicate with each other, use flanking maneuvers, and adapt to the player's tactics: behaviors that feel remarkably intelligent even though no machine learning is involved.

Procedural Generation: When AI Builds the World

A separate and increasingly important form of game AI is procedural generation, using algorithms to create game content automatically rather than designing it by hand. The most famous modern example is No Man's Sky (2016), a space exploration game in which 18 quintillion unique planets exist, each with its own terrain, weather, plant life, and fauna. No human designed any of these planets. They are all generated by algorithms that combine parameters (temperature, gravity, atmospheric density) to produce coherent, explorable worlds. Minecraft is another landmark example. Its terrain generation algorithm creates an infinite world with mountains, caves, oceans, deserts, and forests that feel natural rather than random. Dungeons & Dragons-style games like Hades, Dead Cells, and Spelunky use procedural generation for level layouts, enemy placement, and item drops. This ensures that no two playthroughs are identical. This technique reduces development cost (you don't need to hand-design every room) while dramatically extending replayability.

Like what you read? The full reading, the case study, and every question set are in the free download below, along with the answer key.

Why this matters

Nearly every student in this class has spent hundreds of hours around game AI without ever being asked to think about how it works, which makes gaming one of the most accessible entry points into real AI literacy available to a teenager. The reinforcement learning technique that lets DeepMind's AlphaGo beat world champions is the same family of technique used to train robots and fine-tune the language models students already use, so a game mechanic they have taken for granted turns out to be a direct line into technology reshaping work far outside gaming.

From one teacher to another

Every ghost in the original 1980 Pac-Man had its own individual behavior rules, which makes it one of the oldest examples of game AI still recognizable today. This reading traces that idea forward through finite state machines and behavior trees, the tricks that make a Far Cry soldier seem to flank and communicate, into procedural generation, the algorithms behind No Man's Sky's 18 quintillion planets, and finally into real machine learning, where DeepMind's AlphaGo beat the world's best Go players. Tyrell's case study catches the exact moment a player confuses a guard NPC adapting to a flag with a guard genuinely learning, a distinction a veteran player untangles for him on a forum.

What you get

2 files

Download

The student worksheet and its answer key each have their own page below, with the download on it. Nothing to unzip and no account to make.
Fact-checked and print-tested before it went on the shelf. How we verify →

Every lesson on this site is free to download and use. If one of them saved you a prep period, you can chip in a few bucks toward my three kids' daycare fund. That's genuinely where tips go.

Tip jar