Mark
/
celeste-ai
Archived
1
0
Fork 0
This repository has been archived on 2023-11-28. You can view files and clone it, but cannot push or open issues/pull-requests.
celeste-ai/celeste
Mark 3d25d63efe
Plotter cleanup
2023-02-26 15:26:45 -08:00
..
celeste_ai Plotter cleanup 2023-02-26 15:26:45 -08:00
resources Added resources readme 2023-02-26 13:11:54 -08:00
README.md Updated README 2023-02-26 14:41:08 -08:00
ffmpeg.sh Cleaned up ffmpeg.sh 2023-02-26 15:12:56 -08:00
plot.py Plotter cleanup 2023-02-26 15:26:45 -08:00
pyproject.toml Reorganized celeste code 2023-02-19 20:57:19 -08:00

README.md

Celeste-AI: A Celeste Classic DQL Agent

This is an attempt to create a deep Q-learning agent that learns to play Celeste Classic.

Contents

  • ./resources: contains files this script requires. Notably, we have an (old) version of PICO-8 that's known to work with this script, and a version of Celeste Classic with telementery and delays called hackcel.p8.
  • ffmpeg.sh: uses game screenshots to make real-time video of the agent's attempts. Read the script, it's pretty simple.
  • plot.py: generates plots from model snapshots. These are placed in model_data/current/plots/.

Setup

Before you set up Celeste-AI, you need to prepare PICO-8. See resources/README.md

This is designed to work on Linux. You will need xdotool to send keypresses to the game.

  1. cd into this directory
  2. Make and enter a venv
  3. pip install -e .

Once you're set up, you can...

  • python celeste_ai/train.py to train a model
  • python plot.py to make prediction plots
  • python test.py to test a model

Before running, be aware of the following:

  • Only one instance of PICO-8 can be running at a time. See celeste.py.
  • hackcel.p8 captures a screenshot of every frame. PICO-8 will probably place these on your desktop. Since this repo contains a rather old version of PICO-8, there is no way to change where it places screenshots. train.py will delete, move, and rename screenshots automatically during training, but you should tell it where your desktop is first.
  • When you start training, a model_data directory will be created. It contains the following:
    • model_archive: history of the model. Save interval is configured inside train.py
    • screenshots: contains subdirectories. Each subdirectory contains the frames of one episode. Use ffmpeg.sh to turn these into a video.
    • plots: generated by plot.py. Contains pretty plots.