Deep Flappy Bird
A Crazy Flappy Bird agent trained with Deep Reinforcement Learning
Support training on multiple platforms
e.g., Amazon EC2, Amazon SageMaker Notebook, Google Cloud Compute Engine, Google Colab
Download the checkpoint of our best agent
Contributors
Name: Fu-Lin Hsu
Name: James Hu
Name: Jonathan Choi
Requirement
- Python 3.x
- Pygame
- Pytorch
- Numpy
- Opencv 3.x or later
Before you start
- Be sure you upload game assets in the directory order './assets/sprites/*.png'
- you can set the BASE_PATH as the prefix of assets/sprites/*.png, such as a mounted drive in Colab
- Remember to end it with a slash '/'
- Set up the directory you want to save checkpoints
Environment
env.py
The Flappy Bird Game Environment
To load resources (images) for the game, specify the BASE_PATH parameter of load()
Use frame_step(input_actions) to interact with the game and get the next observation
The game ends when the return value, terminal, of frame_step is True
env_utils.py
The utilities for establishing the environment
flappy_bird.py
The all-in-one training instance including game environment
flappy_bird_dueling.py
The all-in-one training instance using Dueling DQN