How I Taught an AI to Play Pokemon Emerald

Поделиться
HTML-код
  • Опубликовано: 11 окт 2024
  • In this video I go over the tools and techniques that I used to program an AI to play Pokemon Emerald!
    Computerphile A* search video: • A* (A Star) Search Alg...
    Sebastian Lague minimax search video: • Algorithms Explained -...
    Blog / Transcript: remptongames.c...
    Github: github.com/Rem...

Комментарии •

  • @RemptonGames
    @RemptonGames  4 года назад +12

    Hey y'all, if you liked this video I have made a follow-up, which you can find here: ruclips.net/video/C1KpQc9cWmM/видео.html
    This video focuses on AI for Pokemon Showdown, the competitive online Pokemon platform. I also answer several frequently asked questions about this video, and announce a possible future project! If you enjoyed this video you should definitely check it out!

  • @el_1776
    @el_1776 4 года назад +37

    Next video: AI critiques Pokémon artwork from the early 2000s

  • @harshjalan4777
    @harshjalan4777 4 года назад +44

    Being a long time Pokemon fan and a fairly recent AI engineer! I find this extremely awesome!!! Would love to collaborate to make the AI better!

    • @WanDeLay4
      @WanDeLay4 3 года назад +5

      Yeah do it!

    • @josholin31
      @josholin31 Год назад

      Been a while since I got into using TAS software. But now that I know more about how reverse engineering files and looking into memory. I've been thinking about randomly generating the input directions for 24+ hrs. Running the directions at super fast speeds. Doing that a 10's of times.
      Whichever gets the furthest, is the basis for the next generation and a slight mutation rate between the new sets of directions.
      More or less, genetic machine learning. But since I want it to come up with its own strategies. So I think I want to only want to track gym badges. This will take an absurd batch size or direction length since it will be going in circles. But I have a feeling there are better glitchless strategies in speedruns. And I think this might find them. (Since TAS gets rid of RNG, I bet it won't withdraw the portion from the PC in 1st Gen. But maybe it'll find other things.)

  • @henriquealves3086
    @henriquealves3086 3 года назад +111

    Now teach A.I to play pokemon competitive (pokemon showdown)

    • @King_Nex
      @King_Nex 3 года назад +6

      I think there's actually a rule against that in Showdown.

    • @ilovecairns5181
      @ilovecairns5181 3 года назад

      pog

    • @nicholaswoel-nogueira4074
      @nicholaswoel-nogueira4074 3 года назад +2

      @Rotom Channel bro u don't know anything about competitive pokemon

    • @nicholaswoel-nogueira4074
      @nicholaswoel-nogueira4074 3 года назад +2

      @Rotom Channel I'm not salty I just don't know what format you would do that in unless ur talking about VGC maybe but I don't even think that

    • @nicholaswoel-nogueira4074
      @nicholaswoel-nogueira4074 3 года назад +3

      @Rotom Channel hey wanted to apologize for my comment. Before they banned zacian yeah just spamming behemoth blade worked in ubers mb. While like maybe click other coverage moves too but yeah

  • @mikerenfro4608
    @mikerenfro4608 4 года назад +53

    What would your Pokemon team look like if AI chose it.

  • @archivelibrarian6818
    @archivelibrarian6818 3 года назад +14

    this is gonna blow up. calling it right now

    • @RemptonGames
      @RemptonGames  3 года назад +2

      Thanks, I’m glad you liked it! To me 4,000 views already feels like it has blown up haha. I’ve got a related project on the way in a few weeks as well!

    • @archivelibrarian6818
      @archivelibrarian6818 3 года назад +1

      @@RemptonGames thats so awesome to hear man! keep up the hard work. this is very good content. i look forward to your new project! :)

  • @TyroneTG3
    @TyroneTG3 3 года назад +20

    I was kinda hoping it was just gonna be a computer plowing through Pokemon Emerald, bumping into walls and catching like 3 of the same Pokemon but beating other trainers....that would've been funny

  • @pndacat1
    @pndacat1 4 года назад +7

    The work that went into this was crazy!

    • @TKuja1
      @TKuja1 3 года назад

      Check out codebullet

  • @Jawack
    @Jawack 3 года назад +1

    Just had this recommended. Was surprised when you said "small channel", legit thought this a big pokemon channel I haven't heard of.

  • @patrickdeck9178
    @patrickdeck9178 4 года назад +2

    this was very insightful, please more on machine learning/reinforcement learning, this deserves way more views!

  • @SuperMarioLiam10
    @SuperMarioLiam10 4 года назад +15

    Love your content! You deserve wayy more views

  • @mittypkm
    @mittypkm 4 года назад +20

    Holy crap. Watching the AI play the game live on Twitch would be super cool. Love the work that went into it.
    I'd love to see a follow-up video about it and maybe see the AI battle system implemented, as well as overworld puzzles and gimmicks. I'm sure it'd be a big task to program all that and it would take a long time, so take your time if you do decide to continue the project.
    This makes me wonder... would the AI go out of its way to catch Pokemon they deemed useful?

    • @RemptonGames
      @RemptonGames  4 года назад +7

      Based on the response I’ll probably do some follow-up videos, but they will take some time and I have some other stuff in the works. As for catching, I think the easiest way would be to basically follow Nuzlocke rules (catch first thing in a new area) or some other simple rule

  • @Yellow_Balloon125
    @Yellow_Balloon125 4 года назад +8

    I wish you had more subscribers. These videos are so professional!

  • @robertchristian7020
    @robertchristian7020 3 года назад +1

    i cant get enough of these programing videos crazy! good stuff

  • @alexisdipoalo9443
    @alexisdipoalo9443 3 года назад +12

    a little disappointed you didn't have the AI beat the whole game would love to see how that ended / was even possible ( i'd do it if i even knew how to write such a scipte )

    • @jacobhoover1654
      @jacobhoover1654 Месяц назад

      It would probably just have a couple level 100 pokemon you catch early in the game

  • @OnEiNsAnEmOtHeRfUcKa
    @OnEiNsAnEmOtHeRfUcKa 3 года назад +2

    Here before this channel blows up!
    Amazing quality stuff. :)

  • @wasserhahn94
    @wasserhahn94 3 года назад +1

    Thank you gods of the RUclips algorithm for leading me here!
    Really nice and informative video! I liked your calm way of explaining things and as a fellow data scientist/machine learning person I'm intrigued to try and do something similar :)
    Keep up the good work, looking forward to future content!

  • @xSugknight
    @xSugknight 3 года назад +1

    Nice video - im happy that i found your channel while still below 1k subs - cause this will change really quick!

  • @shadowseeker97
    @shadowseeker97 3 года назад +3

    the youtube algorithm gods has led me here. . Well edited, good audio and informative without being overwhelming. Have a like and subscribe sir.

  • @andrewv.9142
    @andrewv.9142 3 года назад +4

    this is so interesting, I would watch an hours long video about this!

  • @tapewormrage
    @tapewormrage 3 года назад +1

    Criminally underrated video. Excellent work.

  • @Joreon
    @Joreon 3 года назад +2

    With this quality of content I was shocked seeing your subcount lol

  • @albertocalabrese2958
    @albertocalabrese2958 3 года назад +1

    I see Eragon in the background, I leave a like!

  • @thezemag
    @thezemag 4 года назад +3

    Coding + Pokemon?
    Loving this channel!

  • @SuperDavedm
    @SuperDavedm 3 года назад

    I'd really like to see a part 2 to this, continue the project! I'd like to see a reinforcement learning technique applied to pokemon, although I don't know how feasible it would be given the action space.

  • @johnthroneberry7212
    @johnthroneberry7212 3 года назад +2

    I have just recently circled back around to Pokémon. As a data scientist, I would want to find a way for the AI to learn from a play through and apply it to a subsequent play through or even another ROM. The cool thing would be to implement this learning in a manner that would be visible during gameplay

  • @pyroskullfist
    @pyroskullfist 3 года назад

    One idea I thought of is what if an AI go against a stronger AI as the pokemmo AI. That would be almost like AI wars.

  • @kacywatson6314
    @kacywatson6314 3 года назад

    Will be very interesting to have a complete set of Pokémon games that were completed by an AI. You can do one game for each generation. And you can challenge yourself to design the AI to have the game completed in the fastest time possible. Like some kind of weird but interesting to watch AI speed run.

  • @pavfeira
    @pavfeira 3 года назад

    In addition to the pathfinding limitations you mentioned like solving block puzzles, I would imagine that the basics of RPG questing wouldn't fit cleanly into A* search. I'm fuzzy on my Gen3 so if you'll excuse the Gen2 example, Mr. Pokemon. You grab your starter, venture past the first town, and find Mr Pokemon in a house in the middle of a route. So far so good, A* should eventually get you here. But then after getting the Mystery Egg, you're supposed to take that back to Prof Elm.
    There's likely some flag in memory once you trigger a plot-essential conversation like this, though it'd be difficult to datamine this flag using the techniques you showed, and regardless, that flag wouldn't help you know where the next flag is located. Furthermore, the next step is to return to an area/NPC that A* already interacted with, because now the gamestate has been updated and this NPC does something he didn't previously do (accept the egg from you). I suppose a solution here would be that if A* exhausted all currently-accessible areas, then restart a fresh A* under the assumption that you must've triggered some event or obtained some key item, and that backtracking to old areas is warranted now? This feels pretty unoptimal, like you'd end up re-combing the entire world map every time the game requires backtracking, but I'm not sure how else you could make this smarter without hardcoding some quest knowledge into the AI (such as "if you have a Mystery Egg, give it to NPC #2 on map #0").

  • @WanDeLay4
    @WanDeLay4 3 года назад +1

    This is sick, man. You should be proud, man.

  • @hiroshiendo6331
    @hiroshiendo6331 3 года назад +1

    Really good video, congratulations!

  • @MangaDungeon
    @MangaDungeon 3 года назад

    Wow this is really cool.
    I wonder how deep this rabbit hole can go., like learning and forgetting moves, or planning move synergy or game meta that a person is more likely to click with
    like for example, how it would calculate an instance of rain and thunder, vs 2 instances of like shockwave or prioritizing certain types or the risk factor of catching certain pokemon or rather not catching them if the AI cares about money

  • @nashawesome2840
    @nashawesome2840 3 года назад

    Please for the love of god have a tournament of the best ai teams.

  • @peterfeliciano7797
    @peterfeliciano7797 3 года назад +1

    now i wanna see it complete the game

  • @domperaino
    @domperaino 3 года назад +1

    Genuinely good channel.

  • @Reidemptionv1
    @Reidemptionv1 Год назад

    Now I’m wanting to make an AI for Pokémon!

  • @towerofhellonerun2042
    @towerofhellonerun2042 2 года назад

    This is my first vid and already like it keep uploading pls

  • @truestbluu
    @truestbluu 3 года назад +1

    Underrated RUclipsr!

  • @richardosborn159
    @richardosborn159 4 года назад

    This is such a cool project, and I have so many questions! How far the AI get into the game? Could it beat the puzzles? Could it think about its team and optimize? What starter pokemon did it pick? How did it navigate menus and choices! This is so cool!

  • @Dahxelb
    @Dahxelb 3 года назад

    Now, what we need is: AI Plays Pokémon VS Twitch Play Pokémon, and see who beats the game first

  • @kaylads
    @kaylads 3 года назад +1

    great video! and super fun topic!

  • @TB-dv8bx
    @TB-dv8bx 4 года назад +2

    Came here from Reddit.
    This is so goodd!

  • @joshuacampbell17
    @joshuacampbell17 3 года назад

    Eragon on the bookshelf 👀

  • @SuperOttsel
    @SuperOttsel 3 года назад

    If you like this video I really recommend a video by pimanrules where he makes a ranking of the ai trainers in generation 1 by making them fight against each other it's really one of the best RUclips videos I've seen

  • @leetspeak4240
    @leetspeak4240 3 года назад

    Super interesting and very informative, let me know if your still interested in this project.

  • @PawzyPuppy
    @PawzyPuppy 3 года назад +1

    Finally someone other than me who says PoKEYmon

  • @cosmicsvids
    @cosmicsvids Год назад

    I would just be easier to preprogram where it walks then having it do this and paring that with a damage calcautor to pick the best move.

  • @anan371
    @anan371 4 года назад +10

    Do Ai tutorials , not many good channels out there

  • @HomnixHD
    @HomnixHD 2 года назад +1

    You should keep improving on the ai and let the ai run a 24hour livestream and when it beats the game it starts a newgame

  • @Alex-sc6yy
    @Alex-sc6yy 4 года назад +5

    Can't you look up GameShark codes to deduce which memory addresses represent which game attributes?

    • @RemptonGames
      @RemptonGames  4 года назад +4

      Interesting suggestion, I’ll have to look into it!

  • @mcbiatiger8804
    @mcbiatiger8804 3 года назад +1

    Nice work!

  • @Luma-ht6sg
    @Luma-ht6sg 3 года назад

    I would love to see an ai play the whole game

  • @gojirasan1976
    @gojirasan1976 3 года назад +1

    How did you integrate Emerald rom with GYM Retro? I'm having the worst time. I keep getting "No romfiles found for game" errors. I went through their integration guide, retro.readthedocs.io/en/latest/integration.html#game-integration, where im stuck at is the Using a Custom Integration from Python
    section. I'm not entirely sure how to run that script listed. When I try I get , "name '__filename__' is not defined. Anything would help. Thanks!

    • @wildgortex
      @wildgortex 3 года назад

      what i did was manually add the 3 json files and rom.sha along with the rom and savestate (this needs to be zipped in gzip format) into a folder called PokemonEmeraldVersion-GbAdvance. For my windows installation using python 3.8.x this folder needs to be placed into C:\Users\{user}\AppData\Local\Programs\Python\Python38\Lib\site-packages
      etro\data\stable you then need to either change the code to match your savestate name or rename your savestate to state5 for the ai to run on your machine. For me there integrated UI program did not work when trying to download it. I did find another download here: pythonrepo.com/repo/openai-retro-python-reinforcement-learning scroll down to the bottom of the page and you can find the different releases. however the release i tried to download would not play my copy of emerald. hope this helps in some way.

  • @RebornAudio
    @RebornAudio 3 года назад +3

    This is amazing - but please stop saying poke-EE-mon 😂❤️

  • @scarlett285
    @scarlett285 3 года назад

    Based on the way you constructed the pathfinding system for the AI I'm left wondering how it will manage in situations where the game forces you to back track to areas you already visited such as Norman's gym.

    • @obnoxiousthegod
      @obnoxiousthegod Год назад

      so many more problems like the puzzles lol, this would only work with it also spamming A on everything and walk through walls enabled

  • @GermanAnimeStudioZZ
    @GermanAnimeStudioZZ 3 года назад

    Have you tried using advanced map(Pokémon romhacking tool) for some of the data you lack (ex: map data)?

  • @LanK111er
    @LanK111er 2 года назад

    Hey, I'm trying to complete a similar goal and I've run into a speed bump installing the retro gym integration ui. It doesn't seem to exist anymore? Any idea where it went? I've hit a brick wall

  • @logansmith2703
    @logansmith2703 3 года назад

    What about moves like Leer that lowers the stats of your opponents? Would it consider those effects or would it exclusively use attacking moves.

  • @laurarenfro5744
    @laurarenfro5744 4 года назад

    A few questions. Is there any way to tell that AI racked up the score? I am interested in more videos like this. How do you think this might translate to more complicated games?

  • @BrayBray-jl8xi
    @BrayBray-jl8xi 3 года назад

    Can you do like a stream maybe of how long it takes your Ai to beat emerald?

  • @srhodes2013
    @srhodes2013 3 года назад

    The only real question is what Pokémon the AI used the master ball on.

  • @khairulmikhaelilman8895
    @khairulmikhaelilman8895 4 года назад +2

    This is Very interesting

  • @dabesrobert5638
    @dabesrobert5638 2 года назад

    So is it like the oldschool gamesharks?

  • @Peibool
    @Peibool Год назад

    Hello, what great content, could I somehow get in touch with you to be able to do this for myself, I would like to remunerate you

  • @MegaMachiOnline
    @MegaMachiOnline 3 года назад

    I wonder what would happen if you took an ai from pokemon reborn and dropped it into pokemon bw2

  • @Jam77229
    @Jam77229 3 года назад +1

    Wow less than 1000 subs! I'll click!

  • @laurarenfro5744
    @laurarenfro5744 4 года назад +2

    Love!

  • @thecursedumbreon6755
    @thecursedumbreon6755 Год назад

    don't know if you did this but can you post this so someone can ran it a lot more times to see what happens, I kinda want to see what happens if its ran for months

  • @Tom_Neverwinter
    @Tom_Neverwinter Год назад

    I see your virtual enviroment. however to build my own it does not want to build the wheels.

  • @starrycollections3023
    @starrycollections3023 3 года назад

    now teach it to do a randomizer nuzlocke.

  • @1snivy10
    @1snivy10 4 года назад +2

    Where can we watch the AI play Emerald?

    • @RemptonGames
      @RemptonGames  4 года назад +1

      I haven’t put anything up of it just playing, but maybe I will if enough people are interested in seeing it. I need to do some more work on it first though

    • @brentrobinson3026
      @brentrobinson3026 4 года назад +1

      Rempton Games YESSS I’m wondering how the AI picks Pokemon for its team

  • @keldeo05
    @keldeo05 3 года назад

    But how does the ai deals with Hms?

  • @antoniovalenzuela647
    @antoniovalenzuela647 3 года назад +1

    You watch RWBY? You should also watch Camp Camp

  • @busterdafydd3096
    @busterdafydd3096 2 года назад

    Well done coding this.... But my no means did you do any training. You made it discover (explore and remember) the map. Training would be to allow it to do hundreds of battles over and over until it learnt.
    Last note, cool program to use memory addresses but humans never used memory addresses so computers shouldn't need it either. In old games like this everything is made of "tiles" which you could of employed a segment network to cache all tiles and meaning depending on Context

  • @daredeviledoa
    @daredeviledoa 3 года назад +1

    can i download this and run this myself?

    • @RemptonGames
      @RemptonGames  3 года назад

      I have a link to the GitHub repo in the description, and you’ll need a ROM and Open AI Gym Retro

    • @daredeviledoa
      @daredeviledoa 3 года назад

      @@RemptonGames I'm going to see if I can get it to work with pokemmo

  • @KlugSupremacy
    @KlugSupremacy 5 месяцев назад

    So cool!

  • @lazy_figetspinner_from2228
    @lazy_figetspinner_from2228 3 года назад

    7:12 reminds me of cheat engine

  • @firenutter1798
    @firenutter1798 4 года назад

    it seems so next to imposssible to have a AI do 90% of the work rasing and hunting for the pokemon so then u can get rare shiny competive redy pokemon that of wich u can trade w/ to start a pokemon journy on ur own

  • @conned2rpi
    @conned2rpi 3 года назад

    Can't seem to download the OpenAI Integration UI :(

    • @wildgortex
      @wildgortex 3 года назад

      pythonrepo.com/repo/openai-retro-python-reinforcement-learning scroll down to the bottom and find the latest release. for me the program will run but i cant get any roms to run...

  • @yourcj5734
    @yourcj5734 11 месяцев назад

    Was this AI able to beat the game and does it play gen 1 and 2?

  • @Willem654
    @Willem654 3 года назад

    Was there any logic by it choosing the female trainer?
    How far can the AI play the game so far, did it beat Steven?

  • @watto7291
    @watto7291 Год назад

    I wish I this clever

  • @CARROTMOLD
    @CARROTMOLD 3 года назад +1

    Soooo........ when does it actually play? You know, like, teach moves, cut down trees... and BATTLE POKEMON? Is it gonna catch one? You know you can't beat the game by just applying a pathfinding algorithm, right? There is nothing intelligent about this at all.

  • @DM-qm5sc
    @DM-qm5sc 2 года назад

    This code is borrowed, not impressed.