GithubHelp home page GithubHelp logo

yishengpei / pokemonredexperiments Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pwhiddy/pokemonredexperiments

0.0 0.0 0.0 63.69 MB

Playing Pokemon Red with Reinforcement Learning

License: MIT License

Shell 0.01% Python 1.31% Jupyter Notebook 98.69%

pokemonredexperiments's Introduction

Train RL agents to play Pokemon Red

Watch the Video on Youtube!

Join the discord server

Join the Discord server!

Running the Pretrained Model Interactively ๐ŸŽฎ

๐Ÿ Python 3.10 is recommended. Other versions may work but have not been tested.
You also need to install ffmpeg and have it available in the command line.

  1. Copy your legally obtained Pokemon Red ROM into the base directory. You can find this using google, it should be 1MB. Rename it to PokemonRed.gb if it is not already. The sha1 sum should be ea9bcae617fdf159b045185467ae58b2e4a48b9a, which you can verify by running shasum PokemonRed.gb.
  2. Move into the baselines/ directory:
    cd baselines
  3. Install dependencies:
    pip install -r requirements.txt
    It may be necessary in some cases to separately install the SDL libraries.
  4. Run:
    python run_pretrained_interactive.py

Interact with the emulator using the arrow keys and the a and s keys (A and B buttons).
You can pause the AI's input during the game by editing agent_enabled.txt

Note: the Pokemon.gb file MUST be in the main directory and your current directory MUST be the baselines/ directory in order for this to work.

Training the Model ๐Ÿ‹๏ธ

10-21-23: Updated Version!

This version still needs some tuning, but it can clear the first gym in a small fraction of the time and compute resources. It can work with as few as 16 cores and ~20G of RAM. This is the place for active development and updates!

  1. Previous steps 1-3
  2. Run:
    python run_baseline_parallel_fast.py

Tracking Training Progress ๐Ÿ“ˆ

You can view the current state of each emulator, plot basic stats, and compare to previous runs using the VisualizeProgress.ipynb notebook.

Extra ๐Ÿœ

Map visualization code can be found in visualization/ directory.

Supporting Libraries

Check out these awesome projects!

pokemonredexperiments's People

Contributors

pwhiddy avatar luiscosio avatar eltociear avatar baekalfen avatar suravshresth avatar turamarth14 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.