Skip to content
Techniques & Technology

Ghost AI

Pac-Man's four personalities

The iconic AI system from Pac-Man where each ghost has distinct targeting behaviour, creating emergent gameplay through simple individual rules.

cross-platform aipac-mantargetingstate-machineemergent

Overview

Ghost AI refers to Pac-Man’s legendary artificial intelligence system where four ghosts with individual “personalities” create complex, emergent behaviour from simple rules. Each ghost targets differently, switching between chase, scatter, and frightened modes—a masterclass in designing engaging AI from minimal complexity.

Fast Facts

AspectDetail
GamePac-Man (1980)
DesignerToru Iwatani
GhostsBlinky, Pinky, Inky, Clyde
InsightPersonality through targeting

The Four Ghosts

GhostNameJapanesePersonality
RedBlinkyOikake (Chaser)Directly chases Pac-Man
PinkPinkyMachibuse (Ambusher)Targets ahead of Pac-Man
CyanInkyKimagure (Fickle)Complex, unpredictable
OrangeClydeOtoboke (Stupid)Alternates chase/retreat

Targeting Modes

ModeBehaviourTrigger
ChaseTarget based on personalityDefault
ScatterTarget home cornerTimer-based alternation
FrightenedRandom movementPower pellet

Individual Targeting Rules

Blinky (Red) - The Shadow

Target = Pac-Man's current tile

Simple, relentless pursuit. Gets faster as dots decrease (“Cruise Elroy” mode).

Pinky (Pink) - The Ambusher

Target = 4 tiles ahead of Pac-Man's facing direction

Tries to cut off Pac-Man. Bug: when Pac-Man faces up, targets 4 tiles up AND 4 tiles left.

Inky (Cyan) - The Fickle One

1. Draw vector from Blinky to 2 tiles ahead of Pac-Man
2. Double that vector
3. Target = endpoint

Uses Blinky’s position, creating unpredictable flanking.

Clyde (Orange) - The Feigner

If distance to Pac-Man > 8 tiles:
    Target = Pac-Man's current tile
Else:
    Target = Clyde's scatter corner

Approaches then retreats, creating a “shy” personality.

Scatter Corners

GhostCorner
BlinkyTop-right
PinkyTop-left
InkyBottom-right
ClydeBottom-left

During scatter mode, ghosts retreat to their corners, giving players breathing room.

Mode Timing (Level 1)

PhaseModeDuration
1Scatter7 seconds
2Chase20 seconds
3Scatter7 seconds
4Chase20 seconds
5Scatter5 seconds
6Chase20 seconds
7Scatter5 seconds
8ChaseForever

Why It Works

Design ChoiceEffect
Individual personalitiesDistinct threat types
Mode alternationTension and release
Simple rulesPredictable when learned
Emergent complexityGhosts interact unpredictably

Implementation Considerations

ChallengeSolution
PathfindingSimple: pick direction closest to target
ReversalsGhosts reverse on mode change
TunnelsGhosts slow down
No backtrackingCan’t reverse unless mode changes

Legacy

Ghost AI demonstrates that compelling game AI doesn’t require complexity—it requires personality. The same principles appear in countless games: distinct enemy types, behaviour modes, and emergent interaction from simple rules.

Modern Applications

GameGhost AI Influence
SpelunkyDistinct enemy behaviours
Pac-Man Championship EditionRefined original system
Any stealth gamePatrol/alert/chase modes

See Also