Ghost AI
Pac-Man's four personalities
Pac-Man's four ghosts each hunt by a different rule so the pack comes from all directions. Toru Iwatani's own account of why, the chase-and-disperse waves, the power-pellet reversal, and the pattern play the rules made possible.
Ghost AI is the name given to the way Pac-Man’s four ghosts each pursue the player by a different rule, so that four simple hunters feel like a pack. The designer’s own account, given in 1998 and 2010, is that he built it so the ghosts would not follow each other “like a string of beads”.
Fast facts
- Game: Pac-Man (Namco, 1980).
- Designer: Toru Iwatani.
- Ghosts: Blinky, Pinky, Inky and Clyde in the West; Akabei, Pinky, Aosuke and Guzuta in the Japanese release, per Retro Gamer.
- The rule, as Iwatani gives it: Blinky chases; Pinky aims just in front of Pac-Man; Inky and Clyde move “more random[ly]”.
- The reversal: a power pellet turns the pursued into the pursuer — an addition made during development, not in the plan.
Why four ghosts
Iwatani told Edge in 1998 that the game began with eating, and that the enemies and the maze came after: “After that, I decided to add the element of four ghosts as enemies. Just moving around an open field would be too much freedom and no fun, so I set up a maze environment.” He did not think of the ghosts as scenery: “the ghosts play an equally important role. All of the ghosts have different AI algorithms that reflect their comical personalities. It’s sort of like asking whether Tom or Jerry is the star of the ‘Tom and Jerry’ cartoons.”
A string of beads
The reason for giving each ghost its own rule is in his 2010 account to Retro Gamer:
Had the programming been such that the four ghosts constantly attacked Pac-Man’s present location according to the same algorithm, the ghosts would look like a string of beads. Where’s the thrill in that? So I introduced AI-type algorithms that had the ghosts coming at Pac-Man from all directions.
The same article gives the division of labour as Iwatani “has in the past stated” it: “Blinky is designed to chase Pac-Man, but that Pinky’s goal is to aim just in front of Pac-Man, hence why the two often seem to ‘sandwich’ the hero. The movement of Inky and Clyde is more random, the end result being that Pac-Man is pursued in a natural way, rather than in a robotic, pre-defined manner.” It also records that the ghosts “attack in waves, before dispersing and attacking again, which gives the player some regular breathing space” — the alternation later players called chase and scatter — and adds that “gamers often disagree with exactly how the algorithms work in practice.”
The exact targeting rules (how far ahead Pinky aims, what Inky’s target is built from, when Clyde turns away) have been reconstructed from the arcade code by later players; none of the sources held here describe them, so this entry does not.
The reversal
The power pellet, Iwatani said in 1998, is what makes the design work: “by eating a power pellet, Pac transforms himself from being pursued to being the pursuer. This change in the flow of action makes the game much more dynamic.” In 2010 he added where it came from and when: “The inspiration for the power pellet was the spinach in the TV cartoon Popeye. The power pellets didn’t exist in the planning stages at all - they emerged during the development stage as a feature for turning the game around, and made the game vastly more interesting.”
Patterns
Because the ghosts follow rules rather than dice, players could memorise routes. By February 1983 Electronic Games was explaining score differences by whether “Players vary their ‘pattern’ strategies in some cases to maximize bonus points while, on the opposite side of the spectrum, other gamers base their tactics on avoidance, eating only those ghosts they happen to meet while in the energized state.” The same reply took it as read that the screen “‘breaks down’ after 250 keys” — the board-256 failure was common knowledge among players within three years.
The names
The US names were merchandise by mid-1982. Electronic Games reported Fleer’s sticker cards showing the ghosts as “Speedy, Bashful, Pokey, and Shadow (aka ‘Blinky’, ‘Pinky’, ‘Inky’ and ‘Clyde’)”. The magazine’s order pairs Speedy with Blinky; the cabinet’s roster pairs Shadow with Blinky, so the pairing there is the magazine’s.