Pac-Manis one of the most well-known and popular arcade games of all-time. When it was first released in 1980, the public was enamored with its graphics and fun gameplay. But that gameplay proved to have enough challenge and depth to ensure that Pac-Man, along with its many sequels and spin-offs, has remained popular to this day. That challenging gameplay is largely a result of the behavior of the ghosts who chase the titular character throughout the different stages. To celebrate the 40th anniversary of Pac-Man’s release, NVIDIA researchers have recreated that gameplay using artificial intelligence.
While the behavior the ghost enemies in Pac-Man may seem intelligent, the truth is that they’re just following a handful of pre-programmed rules. Those ghosts each have their own unique behavior, which helps to facilitate the illusion of artificial intelligence. Pinky and Inky, the pink and cyan ghosts, try to put themselves ahead of Pac-Man. Blinky, the red ghost, will simply chase Pac-Man. Clyde, the orange ghost, will alternate between running away from Pac-Man and following after him. Skilled players are able to take those unique behaviors into account in order to successfully complete each stage. Reprogramming that behavior directly would be easy enough, but the NVIDIA researchers instead used neural networks to reverse-engineer and replicate the classic Pac-Man gameplay.
That was accomplished with generative adversarial networks (GANs), which work by pitting two neural networks against each other — one as a generator and one as a discriminator. The system, called NVIDIA GameGAN, was trained on 50,000 episodes of the game. By watching those, the system was able to essentially deduce the rules of the game. For example, it came to the conclusion that neither Pac-Man nor the ghosts can ever cross the blue lines that make up the edges of the maze, and that the pellets disappear when Pac-Man touches them. In this way, GameGAN is able to play the game against itself (or a human) while adhering to the original game rules the entire time. No actual game engine is running here, and GameGAN is rendering the frames based entirely on what it learned from watching original gameplay. Outside of gaming, this technology would be very useful in all kinds of autonomous robot applications.