Forty years after Pac-Man had his first taste of ghosts, an AI has given the ravenous puck a new maze to chew his way through — without studying the game code.
That means it recreated the game without first being taught the rules. Instead, the AI mimics a computer game engine to create a new version of the arcade classic.
Researchers at GPU giant Nvidia recreated the game by feeding a model they call GameGAN 50,000 Pac–Man episodes. After digesting the sample, it spat out a fully-functioning new version of the game.
The system uses generative adversarial networks (GANs), which Facebook Chief AI Scientist Yann LeCun called “the most interesting idea in the last 10 years in ML.”
GANs create new content — such as photos of faces that don’t exist — by pitting two neural networks against each other: a generator that creates samples and a discriminator that examines the designs to work out whether they’re real.
GAN inventor Ian Goodfellow, a machine learning director at Apple, compares the process to a competition between counterfeiters and cops.
“Counterfeiters want to make fake money and have it look real, and police want to look at any particular bill and determine if it’s fake, ” he said.
The two networks learn from each other to create new fakes that could pass as the real thing — like a convincing Picasso forgery. Or in this case, a brand new version of a game.
Nvidia says that it’s the first time that GANs have mimicked a computer game engine.
“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,” said Seung-Wook Kim, the lead author on the project. “And it did.”
From Pac-Man to self-driving cars
AI has a long history of playing video games, such as the DeepMind system that mastered StarCraft II. But Nvidia‘s research shows that it can also recreate them.
The company’s system learned to visually imitate Pac-Man by ingesting screenplay and keyboard actions from past gameplay. When the artificial agent presses a key, GameGAN generates new frames of the game environment in real-time until it’s created a new layout.
The model can generate both the static maze shape and the moving elements of Pac-Man and his hated ghosts. It also learns all of the game‘s rules, from sticking within the maze’s walls to avoiding ghosts until he munches a Power Pellet.
Nvidia says game developers could use the system to automatically generate new levels, characters, and even entirely new games. It can also separate the background from the characters so they can change the settings and the cast. If Pac-Man’s suffering from indigestion, maybe Mario could take this place and chase mushrooms around an outdoor labyrinth.
The system currently is limited to 2D games, but Nvidia plans to make it work on more complex games and simulators.
Ultimately, the company envisions using the system beyond the world of gaming. They expect that it could create simulated environments for developing warehouse robots or autonomous vehicles.
“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, the director of Nvidia‘s Toronto research lab. “GameGAN is the first step toward that.”
Even if that never happens, GameGAN has at least given Pac-Man a memorable gift for his 40th birthday. And Nvidia has invited everyone to his party on a date TBC later this year, when the game will be made available on the company’s AI Playground.