How Computers Learned to Play Nintendo

Super Mario World is a great test for artificial intelligence

MarI/O - Machine Learning for Video Games

As far as video games go, Nintendo's classic Mario games are pretty simple: Mario runs to the right, stomps on enemies, collects coins and jumps over pits. But in this YouTube video, there's no human behind the controls: it's a computer program, aptly named "MarI/O." Created by YouTube personality SethBling, MarI/O is run by an artificial neural network that mimics evolution. In the video, Bling demonstrates how the program taught itself to beat the first level of Super Mario World.

MarI/O isn't the first artificial intelligence to take on Nintendo's flagship character: Mario has been a guinea pig for programmers playing with artificial intelligence for years. One group sponsored an annual Mario AI competition, Jordan Pearson reports for Motherboard, and a pair of Georgia Tech computer scientists named Mark Riedl and Matthew Guzdial have even built an AI that can design Super Mario Bros. levels from scratch.

So why is Mario such a good test subject for AI? As any good speedrunner will tell you, Nintendo's earliest games are all about pattern recognition and figuring out how to turn those patterns to your advantage – a balance between logic and creativity that presents interesting challenges for AI.

"It is a bit more fast-paced and dynamic than the Atari games that many are currently using to test AI," Riedl and Guzdial tell Pearson. "The side-scrolling nature of the game means a lot of the game is unobservable to the AI, whereas many simpler arcade games have all information on screen at once."

Mario games force the AI to adapt to new challenges, whether it's a pit to jump over, a horde of Goombas to stomp, or Chain Chomps to avoid. As Aaron Souppouris writes for Engadget, its a trial-and-error process that forces the AI to devise a solution:

Mirroring actual evolution, MarI/O didn't actually change its behavior with any forethought. Every generation introduced new ideas, but it was simply trying different things, not doing what it "thought" would work. When an idea was a success, it was remembered, when it wasn't, it was discarded and learned from. Over the course of 34 evolutionary steps, MarI/O ended up working out jumping though the entire level would do the trick. If its creator Seth Bling were to run it again, the AI would almost certainly find a different, but no less successful path through the level.

Super Mario Bros. is far from the only video game of its kind, but as New York University computer science professor Julian Togelius tells Pearson, the game's popularity also makes it a hotbed for AI research. After all, the best way to judge how well a computer guides Mario through a level is if you've played that level yourself. "Most people have an idea of what it looks like to play Super Mario," Togelius tells Pearson. "Humans do things like stop and think, which an AI would never do. The ability to compare with yourself is very powerful."

Artificial intelligence has a long way to go before it becomes anything as sophisticated as human intelligence, but in the meantime, beating up Bowser isn't too shabby. For more Mario-based AI projects, make sure to check out the rest of Pearson's story.

Get the latest stories in your inbox every weekday.