Welcome to FlappyBirdAI, an innovative project utilizing NEAT (NeuroEvolution of Augmenting Topologies) Python to teach an AI how to play Flappy Bird. This repository leverages a genetic algorithm to optimize neural network configurations through successive generations, enhancing the AI's performance over time.
- Genetic Algorithms: Uses NEAT Python for evolutionary learning.
- Interactive Learning: Watch the AI improve with each generation.
- Detailed Visualization: Real-time display of AI playing Flappy Bird.
Explore the comprehensive documentation for the NEAT module here.
For an in-depth understanding of how this project works, refer to this blog post by Chris Nielsen.
Lakshya from Techiral offers a detailed tutorial on this project. Watch it on YouTube.
- CONFIG.txt: Configuration file for NEAT.
- FB.gif: Animated demonstration of the AI playing Flappy Bird.
- FBAI.py: Main Python script containing the AI code.
- README.md: Project documentation.
- Clone the repository:
git clone https://github.com/Techiral/Flappy-Bird-AI.git
- Navigate to the project directory:
cd Flappy-Bird-AI
- Install the required libraries:
pip install -r requirements.txt
- Run the script:
python FBAI.py
The core of the project is the FBAI.py
script, which uses Pygame for the game's graphical interface and NEAT for the evolutionary algorithm. Here's a brief overview of key components:
Defines the behavior and properties of the bird, including movement, jumping, and drawing.
Manages the pipes' positions, movements, and collision detection.
Handles the moving base at the bottom of the screen.
- blitRotateCenter: Rotates and blits images centered.
- draw_window: Draws the game window with the bird, pipes, and base.
- eval_genomes: Evaluate each generation of genomes.
- run: Sets up the NEAT configuration and runs the evolutionary process.
- Star this repository to show your support.
- Fork this repository to contribute and enhance the project.
- Open issues to report bugs or request features.
- Follow our GitHub profile for more exciting projects.
- Subscribe to our YouTube channel for tutorials and updates.
Elevate your coding skills by diving into the world of AI and evolutionary algorithms with FlappyBirdAI. Happy coding!