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]
very neat to try on my machine. i don’t know much about this stuff, but it’s fun to watch all them little marios!
Was the Mario AI ( http://julian.togelius.com/mariocompetition2009/ ) competition posted? It’s done now, but I think it’s pretty interesting too. You don’t have to use a learning algorithm, obviously, but it’d be a good place to put your effort in learning it.
Here’s the 2010 competition
http://www.marioai.org/
re: pacman
There is no actual AI here and the DSL is all in french, but it’s a start: https://github.com/soundrabbit/pacman
It’d be more impressive if they set it to learn to beat the actual game.
This would be a wild screensaver…
The only winning move is not to play. How about a nice game of chess?
Has anyone given any thought as to what happens if these super-evolved Super Marios decide that they don’t need us any more?
@NatureTM- it won’t happen. they will always keep coming back for more shrooms
Technically, this is not Artificial Intelligence, but Genetic Algorithm.
Nice one :)
Loves me some neural network AI!
The pac-man thing is sort of being done
http://www-inst.eecs.berkeley.edu/~cs188/fa10/announcements.html
“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.
Using the program he posted mine finished the level at 405 generations. Is that because I just got better random results?
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”.
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.
@ 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).
Wow! Just can’t believe it! Amazing work! Nice clear!
24hs straigt on a sempron 2800 with 2gb ram running the app = CRASH
even the keyboard leds stoped working haha.
crappy pc i have.
I think having a human player going at the same time might be an idea to try, see if the AI can learn from people.
I’m curious as to how genetic and evolutionary algorithms could be used in a real-world situation, such as a robot… In real-life you only get one shot in a situation. This type of approach seems to assume you get thousands.
@Gregory Strike if the robot was able to run simulations of events before trying it then it could work.
@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.
“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
Cool.
But I think to start getting really interesting AI’s the level itself should be random each time.
So they are learning to read the level and respond to it, rather then just time the jumps.
@Thomas Wrobel you could put the same code into a mario fangame called infinate mario, the levels change every time they are played.