Pac-Man had his first taste of ghosts forty years ago, now an AI has given the ravenous puck a new maze to chew his way through — without even going through the game code.

Pac-Man Patterns — Ghost Movement (Strategy Pattern) - DEV

AI has recreated the game without first being taught any of 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 making the model they call GameGAN watch about 50,000 Pac–Man episodes. After digesting the sample, it came out with a fully-functioning new version of the game.

Seung-Wook Kim, the lead author on the project said, “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!”

Nvidia said that it’s the first time that GANs have cloned an exact copy of a computer game engine.

What is GameGAN?

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. 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, the system created a brand new version of a game.

Kim said, “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.”