Code Monkey home page Code Monkey logo

elo_world_pokemon_red's Introduction

Pokémon Red Elo World

Scientifically Ranking the Pokémon Red Trainers

Confused? You should probably watch the accompanying video first.

Or the follow-up.

If you just wanna watch battles, you probably want the tutorial.

About this repo

This repo contains most of the code and data I used to run and analyze the tournament. It's very disorganized, but it should be relatively easy to get up and running (if not understand). This readme is far from a thorough explanation, though, so expect to need to do some fiddling.

Playing with the data

If you don't want to run a tournament yourself but instead just play with the data, omega.pickle contains pretty much everything you'll need. In common_methods.py you'll find a load_pickle method that will load the data (of course, you should generally be cautious of unpickling arbitrary data--it's as unsafe as running a binary. But you can trust me 🙂). The types are in common_types.py. It probably requires Python 3.8 or newer.

elo_calculator.py is a hodge-podge of data analysis things I wrote while making the video. You probably won't want to try running this yourself, but you may want to use it as reference for playing with the data. If you don't want to use Python, it should be easy enough to make JSONs out of the data, but be wary of the circular references. You might want to replace the battle objects in the trainer class with references, and likewise for the trainer objects in the battle class. Battles have a unique original_path while trainers have a unique class_id and instance_id combination, so you may want to use these as keys.

There are also a bunch of other files compiling data tangentially related to the tournament, including trainers.json, charmap.json, items.json, moves.json, pokemon_names.json, and trainers_by_order.txt. It should be easy enough to figure out what these are about.

Running the tournament

Running a tournament yourself should be easy, too, but expect some hurdles. Aside from what's in this repo, you'll need:

  • a copy of BGB (I used version 1.5.8)
  • Pokemon Red (UE) [S][!].gb md5: 3d45c1ee9abd5738df46d2bdda8b57dc (this is the same rom produced by the disassembly proejct)
  • Python 3.8 or newer

If you want video output, you'll also need:

battle_x_as_y.py is the main file that runs battles. You'll probably want to update WORKING_DIR_BASE, OUTPUT_BASE, and BGB_PATH. If you run this file, it should prompt you for a HashID, as described in the tutorial.

I'll probably make a more detailed explanation for this code when I inevitably make a "Code Review" video. Stay tuned for that if you want more help, but in the meantime feel free to poke around the code.

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.