How do Pac-Man's ghosts hunt you without being very smart?
Four ghosts seem to stalk you with cunning. Each one just heads for a single target square, and their Japanese nicknames include 'fickle' and 'playing dumb'.
▶ Start the storyPac-Man's ghosts seem to hunt you with cunning, but each one runs on a rule short enough to fit in a sentence. A ghost always has a target tile, the square of the maze it would like to occupy. It may not turn back on its own, and it looks only one tile ahead. At each junction it takes the exit whose next tile is closest to its target. That is the whole chase.
Blinky and Pinky
- Blinky targets Pac-Man's own tile
- Pinky targets four tiles ahead of Pac-Man
Inky and Clyde
- Inky doubles a line from Blinky to two tiles ahead of Pac-Man
- Clyde chases from afar but heads for his corner within eight tiles
What makes the four different is how each picks its target. Blinky, the red ghost, aims at Pac-Man's own tile, so he follows doggedly. Pinky aims four tiles ahead of where Pac-Man is heading, which is why it seems to cut you off, and Pinky and Blinky often seem to box you in together without any plan to do so. Inky draws a line from Blinky to a point two tiles ahead of Pac-Man and doubles it. Clyde chases like Blinky from afar, but within eight tiles he turns for his home corner. Their Japanese names describe the effect: chase, ambush, fickle and playing dumb.
Those personalities were a design decision, made to keep the game from becoming too boring or impossibly difficult. A timer adds rhythm: the ghosts alternate between chasing and scattering to their corners at set intervals.
The man behind them, Toru Iwatani, wanted a game that would attract women and younger players, particularly couples, at a time when most games were war games or Space Invaders clones. Namco's president wanted the ghosts all red, but when Iwatani surveyed his colleagues the result was 40 to 0 for multicoloured ghosts, and the president agreed.
This is how game AI often works: a few rules of thumb that create the illusion of intelligence. You feel hunted because the rules are well chosen, not because the ghosts understand anything.
Step 1: Pathfinding
Gets a character from point A to point B
Step 2: State machine
Switches between behaviours, such as chase and flee
Step 3: Behaviour tree
Organises choices; popular since Halo 2
Quiz me
0/3
Recap
Game AI is a handful of readable rules tuned for fun: a target for each ghost and a one-step choice at each junction, so the player feels hunted without the ghosts understanding anything.
💡 A trick to remember it · Four ghosts, four moods: the chaser, the ambusher, the fickle one and the one playing dumb.
Surprising fact · Namco's president wanted all ghosts red until a 40-to-0 staff survey changed his mind.
Connects to
- 🎚️ How do games stay hard enough to thrill but easy enough to finish?
- 🍄 How did Super Mario Bros. teach you to play without a single word?
- 🎁 Why is opening a loot box so hard to stop?
- 🔴 How did a checkers program teach itself to beat a checkers master?
- 🎮 How did a playing-card company become a video-game giant?
- Artificial neural network
- Procedural generation
Sources (4)
No source, no claim. Every fact in this lesson (28 claims) cites at least one of these.