PWhiddy / PokemonRedExperiments
- понедельник, 16 октября 2023 г. в 00:00:04
Playing Pokemon Red with Reinforcement Learning
🐍 Python 3.10 is recommended. Other versions may work but have not been tested.
PokemonRed.gb
if it is not already. The sha1 sum should be ea9bcae617fdf159b045185467ae58b2e4a48b9a
, which you can verify by running shasum PokemonRed.gb
.baselines/
directory:cd baselines
pip install -r requirements.txt
python run_pretrained_interactive.py
By default the game with terminate after 32K steps, or ~1 hour. You can increase this by adjusting the ep_length
variable, but it will also use more memory.
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.
Note: By default this can use up to ~100G of RAM. You can decrease this by reducing the num_cpu
or ep_length
, but it may affect the results. Also, the model behavior may become degenerate for up to the first 50 training iterations or so before starting to improve. This could likely be fixed with better hyperparameters but I haven't had the time or resources to sweep these.
python run_baseline_parallel.py
You can view the current state of each emulator, plot basic stats, and compare to previous runs using the VisualizeProgress.ipynb
notebook.
Map visualization code can be found in visualization/
directory.