AI Via Super Mario Evolution

Can Super Mario teach you to think? That’s the idea behind using a simple version of the game to teach artificial intelligence. [Oddball] calls this The Mario Genome and wrote at program that can take on the level with just two controls, right and jump. He gave the script 1000 Marios to run through the level. It then eliminates the 500 least successful and procreates back to 1000 using the 500 most successful. In this way the program completed the level in 1935 generations and completed it in the quickest possible time in 7705 generations. He’s posted the script for download so that you can try it yourself. It’s an interesting exercise we’d love to see applied to more random games, like Ms. Pac-Man.

[via Reddit]

25 thoughts on “AI Via Super Mario Evolution

  1. “Technically, this is not Artificial Intelligence, but Genetic Algorithm.”

    Genetic and evolutionary algorithms are a subset of the field of artificial intelligence. Sure, they’re more towards the optimization end of the spectrum in comparison with things like dynamic programming, supervised learning, or reinforcement learning, but they’re perfectly valid examples of artificial intelligence nonetheless.

  2. Nice little toy. I was wondering why he does not jumpstart the process using initial population of 1000 random Marios? The random Marios seem to be doing much better for the initial 100 or so generations. By using more diverse initial population the recombination and mutations should yield faster optimization of genetic mario movements.

    @Julien In fact GAs are widely used in many specialized AI tasks to make the AI algorithms adaptive (kind of meta intelligence). GAs are especially useful in tasks where the problem is not well known “black-box”.

  3. There was a mod way back in Counter-Strike’s hayday that worked just like this. You’d set the AI to run around and learn the map and it’d pick up learning from humans too.

    Fastest way to have them learn the map was set a few on each side to run around the map with no weapons. I liked to stick them into knife fight mode so they wouldn’t get stuck on each other in no-weapons.

    So putting this into a 2D non-interactive side scroller is baby farts compared to playable AI in Counter-Strike.

  4. @ CGross, you downloaded and ran a mod on Counter-Strike? You’re so cool! That doesn’t smell like baby farts at all compared to writing an algorithm designed to learn optimized level completion limited to only two controls (right and jump).

  5. @Gregory

    Let’s say you wanted a robot to solve a maze. You wouldn’t physically put the robot in the maze a million times. Instead, you would model the maze on a computer, apply a genetic algorithm to the maze-solving algorithm, and allow the populations of maze-solvers to run the maze until they evolve a satisfactory performance. Finally, you would implement the computer model’s best-performing solution onto the real robot and hope it can solve the real maze.

  6. “Genetic and evolutionary algorithms are a subset of the field of artificial intelligence.”

    Genetic and evolutionary algorithms don’t necessarily involve artificial intelligence, no. As it is now, this program just generates a sequence of key presses

Leave a Reply to bluechipCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.