top of page
Writer's pictureAtul Gothe

Pac-Man recreated with AI!!

Updated: Oct 26, 2020

On the occasion of the 40th anniversary of Pac-Man, NVIDIA announced that their Artificial Intelligence networks, GameGAN have recreated the dot munching classic Pac-Man by watching it for 50,000 hours. Pac-Man has always been a focus of research on Artificial Intelligence worldwide. What makes the Pac-Man special when it seems just as random as any other game from its era?

Pac-Man is a maze arcade game developed and released by Namco in 1980. The gameplay is rather simple - the player controls “Pac-Man”, who moves around in a maze eating dots, while four ghosts chase him. If the ghosts catch him, the game is over. Eating large flashing dots makes the ghosts blue and vulnerable, allowing the Pac-Man to eat them in this state. It enables him to gain extra points while collecting all the small dots ends the level.


The game development began in 1979 during the height of the cold war and the technological advancements that came with it. One of the improvements was in the field of Artificial Intelligence and its application to video games. One of the most overlooked facts is that Pac-Man was one of the games which made full use of this. Each of the four ghosts has a name and a distinct AI which guides them to catch Pac-Man. The ghosts have three different modes that dictate how they move, namely, the Chase Mode, the Scatter Mode, and the Frightened Mode.


In the Chase mode, the ghosts have the most complex pattern. “Blinky” the red ghost gives direct chase to Pac-Man, it targets the tile which Pac-Man currently occupies. The pink ghost - known as “Pinky”- tries to land 16 pixels (2 tiles) in front of Pac-Man. The third ghost, “Inky” or the blue ghost has the most complicated AI and the most erratic behavior among the four ghosts. Inky will try to move to a tile that is calculated by taking the tile two spaces ahead of Pac-Man and doubling the distance Blinky is away from it. As for the final, orange ghost, known as Clyde, his movements are based on how far away he currently is from Pac-Man. Whenever Clyde is more than 8 tiles away from Pac-Man, his movements are identical to that of Blinky’s, in that he will actively attempt to move towards whichever tile Pac-Man occupies at present. However, as soon as Clyde comes within 8 tiles of the circular hero, he will endeavor to flee to the bottom left portion of the screen and hide there.

In the Scatter mode, the ghosts individually target one of the corners of the maze and move endlessly in circles. As for the Frightened mode, it is triggered when Pac-Man eats one of the large flashing dots. Upon entering the Frightened mode, the ghosts reverse their direction and go for a corner. After reaching there, a random number generator dictates the direction in which the ghosts go.


This simple logic makes Pac-Man an excellent tool for training AI. Given the intuitive environment of Pac-Man, it is used as an introduction to AI programming to students in many courses worldwide.





A note about the author:


Atul is a 3rd year physics major studying for the BS-MS degree in IISER Kolkata. He loves mathematics and is quite a passionate gamer.



98 views0 comments

Recent Posts

See All

Comments


bottom of page