Skip to content

Using NEAT algorithm to play the Flappy Bird Game

Notifications You must be signed in to change notification settings

sayan112207/neat-flappy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

138ae6b · Nov 22, 2024

History

15 Commits
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024

Repository files navigation

Optimization of Flappy Bird using NEAT

This project implements the classic Flappy Bird game using the NEAT (NeuroEvolution of Augmenting Topologies) algorithm along with XOR mechanism, allowing an AI agent to learn to play the game autonomously. NEAT is a genetic algorithm that evolves neural networks to perform tasks, in this case, playing Flappy Bird.

Clone the repository to your local machine:

git clone https://github.com/Shubhampatel001/Flappy-Bird-With-NEAT-Algorithm

Install the required Python modules using pip:

pip install -r requirements.txt

This command will install the necessary dependencies, including neat-python and pygame.

Usage

To play Flappy Bird manually:

Open the "Base Model Flappy Bird.ipynb" notebook. Execute the cells to control the bird and navigate through the pipes.

To watch the AI agent train itself:

Open the "NEAT Algo Flappy Bird.ipynb" notebook. Run the cells to train the NEAT algorithm and observe the AI gameplay.

To watch the AI agent play:

Run

python test.py

Notes

Ensure that you have Python and Jupyter Notebook installed on your system before running the notebooks.

Configuration

The feedforward.txt file contains the NEAT configuration parameters. You can adjust these parameters to change the behavior of the NEAT algorithm and experiment with different settings to improve the AI's performance.

Additional Folders

Documentations: Contains abstracts, references, and notes related to the implementation.

Visuals: Includes photos, videos, results, graphs, and block diagrams related to the game.

Acknowledgments

This project is based on the implementation of Flappy Bird by sourabhv. NEAT algorithm implementation is provided by NEAT-Python.

About

Using NEAT algorithm to play the Flappy Bird Game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published