Back to Parent

Outcome


Of the most famous arcade games, Pac-Man features a remarkably elegant algorithm for movement. We took this hard-coded process and transformed it into a living game with emergent elements. Giving each player the role of Pac-Man or ghost, we simulated multiple games on an irregular playing field, the Number Garden.

We chose the Number Garden to help with our algorithm, as it it provides a gridded surface on to which we can move in 4 directions at any one time. We also hoped that the calculated, but ultimately emergent nature of our algorithm would be enhanced by the numerical but random layout of the Number Garden floor.

Pacman ghosts.thumb
Show Advanced Options

Each of the players was given a specific algorithm based on the characters in Pac-Man:

Pac-Man: try to get from his starting position to the target position while avoiding the ghosts.

Blinky: Take the shortest path to Pac-Man

Inky: Take the shortest path to 4 tiles in front of Pac-Man

Clyde: Move about “randomly” (this will be discussed further below)

Pseudo-code for the movement algorithms:

Show Advanced Options

Details of Clyde’s movement: Start on some random number. Let x be the tile he is standing on currently. If x < 9, then take the shortest path to the nearest tile with x+1. If x == 9, then take the shortest path to the nearest tile with a 0. Repeat until the game is over.

Over the course of 6 trials, we varied the starting and end positions for Pac-Man and the ghosts using a random number generator (the start and endpoints had to be on opposite sides of the field). In addition, we made slight modifications to the rules:

Trials 1-2: All ghosts and Pac-Man start at random numbered tiles.

Trials 3-4: All ghosts and Pac-Man start at random numbered tiles. In addition, Pac-Man is allowed to move from one edge of the field to the other (looping around, as in the actual game).

Trials 5-6: Pac-Man is allowed to loop around the playing field. All ghosts start in the center of the playing field, and leave the center after 5, 10, and 15 steps in the order of Clyde, Inky, and Blinky.

Show Advanced Options

The simple algorithm that each character had caused a different outcome to be played out each time. Our algorithm was also very vague in parts (e.g. "take the shortest path" does not give precise instructions on how to derive this shortest path) and this led to variances between the players, and between trials.

The algorithm felt mechanical at times, as the movement speed was fixed to tiles. In addition, the lack of obstacles led to a few straight-line chases, but this was reduced by the looping mechanic introduced in trial 3, as well as the curved shape of the Number Garden.

Overall, it was interesting to observe how a simple pre-programmed rule set could produce an elegant and emergent outcome.

Drop files here or click to select

You can upload files of up to 20MB using this form.