Recently, Google’s DeepMind—an artificial intelligence firm acquired for over $400 million in 2013—has been widely featured for demonstrations of an algorithm that teaches itself to play video games. In a paper, the DeepMind team said the software had learned to play Atari Breakout, and some 48 other games, as well as any human gamer.

But DeepMind isn’t the only clever algorithm able to beat classic games. In a new YouTube video, Seth Bling explains the magic behind software he developed to learn how to play Nintendo’s Super Mario World.

“This program started out knowing absolutely nothing about Super Mario World or Super Nintendos,” Bling says. “In fact, it didn’t even know that pressing ‘right’ on the controller would make the player go towards the end of the level.”

Called MarI/O, the evolutionary algorithm learns by experience, playing the same level over and over with a simple goal (or fitness function)—getting as far to the right as it can as quickly possible.

This chart shows MarI/O's learning curve as each generation moves closer to beating the level.
This chart shows MarI/O’s learning curve as each generation moves closer to beating the level.

After each generation, it “breeds” the most successful approaches (even adding random mutations) and then tries again with the next generation of offspring. After about a day of learning and 34 generations, the algorithm was as good at completing the level as any speedy human gamer (see chart to the right).

That’s pretty cool. But there are a few other items of note too.

The algorithm is based on a 13-year-old evolutionary approach to neural networks outlined in a 2002 research paper.

Of course, though the approach itself is old, we now have a lot more computing power at our beck and call. What will neural networks be able to learn in a few more years of Moore’s Law?

Also, unlike DeepMind’s proprietary code, the code for the MarI/O program is available to anyone who wants to play too. And in theory, it should also work with other left-to-right platform games.

But the best part of the video? Bling explains what’s happening as a representation of the neural net is superimposed on each attempt at the level. Instead of simply being told you’re viewing a computer learning to play a video game—you get a much more informative (and fascinating) glimpse behind the curtain.

Image Credit: Seth Bling/YouTube

Jason is managing editor of Singularity Hub. He cut his teeth doing research and writing about finance and economics before moving on to science, technology, and the future. He is curious about pretty much everything, and sad he'll only ever know a tiny fraction of it all.