This Computer Learned 'Super Mario' From Scratch — And Now It Can Kick Your Ass

Impact

A computer program just taught itself to play Super Mario World. Guess what? It's really, really good.

On Saturday, programmer SethBling introduced the world to MarI/O, a Machine Learning program he created to play video games. There was one important tweak: Instead of being programmed to run the course perfectly, MarI/O had to learn how to play from scratch. The first time it played, it knew nothing about the game; it didn't know to press the right-arrow button to move forward, for instance.

YouTube

How it learns: "MarI/O tries 300 genomes per generation, separated into species," SethBling writes on his Twitch TV page. "Each genome produces a neural network, the network's fitness is based on how far right it gets and how quickly it gets there. Only the most fit genomes are bred into the next generation."

Basically: The more MarI/O runs through the level, the more working moves it knows and those working moves get reused in the next try.

The map above Mario shows how the computer is interacting with the different obstacles in the game. The white boxes represent places Mario can stand, and the black boxes represent anything that can kill our hero.

YouTube

To be fair, MarI/O took a long time to learn the game. Probably longer than it takes most children, since its first stages were figuring out that the game involves more than just standing at the starting point. But as MarI/O started growing its neural network, picking up moves and learning to dodge those damn baseballs and Super Koopas, it got incredibly good and even had some finesse, like executing a medium-powered jump in order to slip between two enemies stacked on top of one another.

YouTube

The algorithm SethBling uses isn't his. It's called NEAT, or NeuroEvolution of Augmenting Topologies, from a paper by computer scientist Kenneth Stanley that describes how to use genetic algorithms to build neural networks from nothing — essentially what makes MarI/O tick.

Next level: Sure, a programmer created MarI/O to play video games. But think of the jobs, albeit simple ones, a computer programmed with NEAT could do. Machines that can learn tasks and improve gradually could become robotic auto mechanics and librarians, among other things. If the technology exists for simple things like playing Super Mario World, the possibilities for more vital applications are huge and exciting.

Not that kicking ass at Super Mario isn't the coolest thing ever.

Watch SethBling's video and explanation below, and watch MarI/O learning to beat the game in real time here.