MarduINO - My First AI Project in Freshman Year

MarduINO - My First AI Project in Freshman Year

2020, Oct 14    

MarduINO - AI learns to play on an NES

In my first year at university, still figuring out Python and Arduino, I stumbled upon a video of Mario playing with a genetic algorithm by Sethbling. Inspired, I decided to dive into my own project – MarduINO.

Marduino

Getting Started

MarduINO isn’t just about an AI playing Super Mario Bros.; it’s a testament to my early coding days. Fresh from a semester of Calculus, armed with minimal Python skills, I set out to create my own version of an AI gaming bot.

Tackling the Unknown

With no machine learning knowledge, I faced challenges head-on, learning on the fly. MarduINO wasn’t just about creating an efficient algorithm; it was about getting hands-on with artificial intelligence.

Making it Work

MarduINO’s learning process was a journey of trial and error. Through a tweaked NES controller, MarduINO found the perfect sequence of inputs to conquer each level, learning and evolving with every attempt.

I just defined a efficiency function that takes into account the distance traveled, the time taken, and the number of lives. Finding the best sequence of inputs was a matter of finding the best possible combination of inputs that maximized the efficiency function over time, a simple optimization problem.

But, what can you do with my limited knowledge of Calculus? Well, I just search the first point where the efficiency function stops increasing, then keep the sequence of inputs that led to that point, and randomly generate new sequences of inputs to keep searching for the best one. With this simple brute force approach, I was able to find the best sequence of inputs for achieving the goal of this project, beating the first level of Super Mario Bros.

The following graph shows the evolution of the algorithm’s efficiency over time.

efficiency.png

Meet the Real Player

To bring MarduINO into the real world, I modified an NES controller, bridging the virtual and physical. The inputs’ performance translated into Arduino language, interfacing with NES’s controller chip (4021). Meet my bridge between the virtual and the tangible.

4021.png

M1.png M1_top.png

Watch MarduINO in Action

Sadly, I don’t have any code from this project, but I have some videos of the project in action. Immerse yourself in the journey of MarduINO through these videos:

Video 1

Video 2

Video 3

Project Updates

Explore the evolution of the MarduINO project through these links, they are in Spanish.

Reflecting on the Journey

MarduINO isn’t just about creating an AI that plays games; it’s a reflection of my growth as a programmer. Looking back, it’s a reminder of the power of curiosity and the joy of turning challenges into opportunities. The adventure with MarduINO continues, just like my exploration into the world of artificial intelligence and computer vision.