Making a Mario AI with Python🐍

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys what's up it's alex from health potion studios recently i wanted to create an ai to play an old nintendo game the first part of this video is how i got the ai working and the second half is just the ai doing its stuff i started doing my research my first plan was a program called nin taco nin taco unlike a regular taco is an nas emulator that allows you to control a game with lua scripting i found a website talking about all the steps needed to create a castlevania bot ah geez dude nintako is rough my biggest issue was that everything needed to be read directly from the game's memory this included all the sprites on screen all the level data and even the player's position within the screen ok so nintako is out my next plan was a program called pi boy pi boy is a gameboy emulator written in python i figured i could work with it because it could split up the game into multiple screens stuff like the background data sprite data the window layer or tiles and memory could be displayed on their own screen this unfortunately wasn't a great option either i did not realize that level collision is not a specific screen there's no standard tile that i could reference in order to easily detect where the outline of the level is okay so pipeboy is out finally i found open ai retro open ai retro could run over 1 000 emulated games automatically and could be modified to work with any other older game so i set it up to play mario 1 for the nes unfortunately these steps were recorded only on my phone so the quality is really really not good i apologize for that the ai uses a machine learning method known as neat neat stands for uh well what it stands for is not important what is important is what it does basically the ai will evolve and mutate to adapt to the game the better one does the higher its score will be and the more likely it will move on to the next generation the ai could see the level in a grayscale down-sampled version of the game this is the original game here's what the ai can see and here's a colored version of what he can see from my own viewing anyways nerd stuff aside mario 1 suffered for a really long time for at least an hour he couldn't jump i could not figure out why he wasn't learning i mess with the learning parameters and jacked the mutation rate really high to see if he'd jump still nothing turns out he physically couldn't jump i didn't give him access to enough buttons on the controller after changing it he immediately began to jump it was really disappointing now i know how my parents feel all right i'll shut up for a minute and just show the ai making progress in the level [Music] eventually the a i got stuck and was never able to make more progress in the level so i decided to switch to a new game mario world i've already explained how the ai works so the rest of this video will be the ai doing his stuff this is basically the outro in the middle of my video so if you want to see more games leave them in the comments below it would be preferred if you pick games from the openai retro supported list but whatever the link to that list will be in the description below normally i'd tell you to subscribe and hit the bell to watch more of my stuff let's try this instead just subscribe to me anyways i don't care if you watch my other videos just subscribe and while you're at it have your mom do it too can we hit 15 subscribers that's pathetic anyways without further ado here's the mario world ai surprisingly i had only one ai cheat the system rather than progress forward in the level he learned that any forward progress was worth points he decided to run back and forth and back and forth and back and forth in order to increase his score i watched him do this for six minutes until the time ran out [Music] now for the rest of the ai let's go [Music] do [Music] do [Music] do [Music] do [Music] let's go [Music] do [Music] do [Music] [Laughter] [Music] do [Laughter] [Music] do [Music] do [Music] do [Music] do [Music] do [Music] do [Music] do [Music] do [Music] wow [Music] you
Info
Channel: Health Potion Studios
Views: 11,693
Rating: 4.8794522 out of 5
Keywords: game, mario, ai, python, pyboy, snes, openai, retro, openai retro, neural network, NeuroEvolution of Augmenting Topologies, genetic algorithm, machine learning, super mario world, super mario, sethbling, fail, reinforcement learning, making a mario ai, ai plays mario, mario world ai, artificial intelligence, making a mario ai in python, can an ai beat mario, indie game dev
Id: fkvc9Qc5ycE
Channel Id: undefined
Length: 13min 22sec (802 seconds)
Published: Tue Sep 15 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.