NVIDIA GameGAN Builds A Faithful Recreation Of Pac-Man With AI Generated Graphics And Maps

One of the first arcade games you may remember playing on an Atari 2600, what seems like a million years ago, was Pac-Man. However, this was not exactly a faithful recreation of the true classic co-op arcade version. Now, several decades later, NVIDIA trained an AI model called GameGAN to recreate a proper recreation, and what makes this so interesting is that there is no underlying game engine, whatsoever.

These days, the original Pac-Man arcade game is easy enough to recreate on virtually any modern platform, though this approach with NVIDIA machine learning is unique and far more challenging. GameGAN did not have the benefit of being programmed with the game's fundamental rules or mechanics. Instead, it 'watched' hours and hours of gameplay to figure out how to make a version of Pac-Man that could pass as the original.

"This is the first research to emulate a game engine using GAN-based neural networks," said Seung-Wook Kim, an NVIDIA researcher and lead author on the project. "We wanted to see whether the AI could learn the rules of an environment just by looking at the screenplay of an agent moving through the game. And it did."

A Generative Adversarial Network (GAN) is a type of machine learning that utilizes two competing networks. As NVIDIA explains in a separate blog post, a neural network learns to recognize photos of cats, for example, by analyzing tens of thousands of cat images. In order to train the network, a person has to carefully label what is represented in each photo.

GANs offer a distinct advantage over this approach over traditional training methods in this regard...

"Rather than train a single neural network to recognize pictures, researchers train two competing networks. Extending the cat example, a generator network tries to create pictures of fake cats that look like real cats. A discriminator network examines the cat pictures and tries to determine whether they’re real or fake," NVIDIA explains.

In this way, the two networks learn from each other. And in this case, GameGAN was trained on 50,000 episodes of Pac-Man, with the AI keeping track of the virtual world. NVIDIA used Quadro-powered DGX servers to train the neural networks, which was able to learn both simple and complex rules of the game (like not being able to move through maze walls).

"Since the model can disentangle the background from the moving characters, it’s possible to recast the game to take place in an outdoor hedge maze, or swap out Pac-Man for your favorite emoji. Developers could use this capability to experiment with new character ideas or game themes," NVIDIA says.

This also has implications that extend outside of gaming. NVIDIA points to autonomous robotic training and self-driving cars as areas where something like this could be beneficial.

"We could eventually have an AI that can learn to mimic the rules of driving, the laws of physics, just by watching videos and seeing agents take actions in an environment,” said Sanja Fidler, director of NVIDIA’s Toronto research lab. "GameGAN is the first step toward that."

Incidentally, Pac-Man hit the arcade scene 40 years ago, and yes, that makes me feel old.