Game Theory: Understanding the mechanics of Pacman

Well. I’ll never look at a game of Pacman in quite the same way again.

Its mysteries have been revealed by these two links – firstly the Pacman Dossier – basically a textbook on Pacman, and secondly, this study of the mechanics, and individual personalities, of the Pacman ghosts – which draws on material from the first.

The ghosts have three movement patterns, each individually calibrated. These patterns are determined by what mode they’re in – chase, scatter, or frightened. And these modes switch based on time cycles in each level. The modes determine what a ghost will do as it approaches an intersection.

“The diagram above shows a simplified representation of the maze layout. Decisions are only necessary at all when approaching “intersection” tiles, which are indicated in green on the diagram.

When a decision about which direction to turn is necessary, the choice is made based on which tile adjoining the intersection will put the ghost nearest to its target tile, measured in a straight line. The distance from every possibility to the target tile is measured, and whichever tile is closest to the target will be selected.”

Here’s what happens in Scatter mode:

Each ghost has a pre-defined, fixed target tile while in this mode, located just outside the corners of the maze. When Scatter mode begins, each ghost will head towards their “home” corner using their regular path-finding methods. However, since the actual target tiles are inaccessible and the ghosts cannot stop moving or reverse direction, they are forced to continue past the target, but will turn back towards it as soon as possible. This results in each ghost’s path eventually becoming a fixed loop in their corner. If left in Scatter mode, each ghost would remain in its loop indefinitely. In practice, the duration of Scatter mode is always quite short, so the ghosts often do not have time to even reach their corner or complete a circuit of their loop before reverting back to Chase mode.

The author

Nathan runs St Eutychus. He loves Jesus. His wife. His daughter. His son. His other daughter. His dog. Coffee. And the Internet. He is the campus pastor at Creek Road South Bank, a graduate of Queensland Theological College (M. Div) and the Queensland University of Technology (B. Journ). He spent a significant portion of his pre-ministry-as-a-full-time-job life working in Public Relations, and now loves promoting Jesus in Brisbane and online. He can't believe how great it is that people pay him to talk and think about Jesus.