Skip to content

About

Flappy Bird game to play around with ANN

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation


Logo

Flappy Bird AI

Flappy Bird game to play around with ANN
Explore the docs »

View Demo on YouTube · Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact
  5. Acknowledgements

About The Project

I wanted to make a simple game using what I learned about AI lastly. The idea was to be as simple as possible, AND start from scratch. I forbid myself to use anything other than numpy and pygame or standard libraries.

I decided to go with Flappy Bird which is a simple game to implement and play (except for me, I'm bad at it). Only a few data are required for the bird to play, and the output decision is simple, either you jump or you don't.

The AI behind this project is a simple neural network (just one hidden layer). The learning process uses part of a genetic algorithm, I take the best bird and I tweak its genes to generate a new generation.

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

There are a few requirements to be able to run Flappy Bird AI.

  • Python 3.x : https://www.python.org/downloads/
  • pygame
    pip install pygame
  • numpy (at the time of writing, there is a bug about some checks in the latest version of numpy, 1.19.4)
    pip install numpy==1.19.3

Installation

  1. Clone the repo
    git clone https://github.com/DannySauval/Flappy_Bird_AI.git
  2. Run FlappyBird.py
    py.exe FlappyBird.py

Usage

I wrote the code keeping in mind I wanted to be able to tweak parameters and see what it does on the final result. In my opinion, it is the best way to learn. You can change most of the settings in the settings.py file and see what it does, like the number of birds for each generation. Regarding the mutation specific settings, it is not using parameters from the settings file yet, maybe it will in a future version. But if you want to tweak them, you should check the model_mutate() method.

I hope everything is clear enough and that this project will help you. If you have any question or suggestion, feel free to contact me !

Contact

Danny SAUVAL

Project Link: https://github.com/DannySauval/Flappy_Bird_AI

Acknowledgements

  • Clear code The Flappy Bird game mechanics come from him. I designed my Flappy Bird quicker and better thanks to his video. Thanks !
  • Internet !

About

Flappy Bird game to play around with ANN

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages