Git Product home page Git Product logo

flappy-bird-ga's Introduction

Flappy Bird NEAT

Overview

Flappy Bird NEAT is a Python implementation of the popular Flappy Bird game, enhanced with the NEAT (NeuroEvolution of Augmenting Topologies) algorithm. This project showcases the application of evolutionary algorithms in training a population of virtual birds to navigate through challenging obstacles, demonstrating the power of machine learning in achieving intelligent and adaptive behavior.

Key Features

  • NEAT Algorithm Integration: Utilizes the NEAT algorithm to evolve neural networks that control the behavior of virtual birds, allowing them to autonomously learn and adapt their strategies over successive generations.

  • Dynamic Obstacle Navigation: Birds are tasked with navigating through dynamically generated obstacles (pipes) by flapping their wings. The NEAT-trained neural networks determine the birds' actions, showcasing the emergence of intelligent decision-making.

  • Scoring System: Tracks the performance of each bird in terms of the distance traveled and awards fitness scores accordingly. The goal is to achieve the highest possible score by efficiently maneuvering through obstacles.

Installation

  1. Clone the repository:

    git clone https://github.com/ssspetrovic/flappy-bird-ga.git
  2. Navigate to the project directory:

    cd flappy-bird-neat
  3. Create a virtual environment (optional but recommended):

    python3.12 -m venv venv
  4. Activate the virtual environment:

    • On Windows:

      venv\Scripts\activate
    • On Unix or MacOS:

      source venv/bin/activate
  5. Install the required packages:

    pip install -r requirements.txt

Usage

Run the NEAT algorithm with the provided configuration file:

python main.py

This command initiates the Flappy Bird game, where a population of birds undergoes training via the NEAT algorithm, showcasing the evolution of intelligent behaviors.

Configuration

  • Python version: 3.12.1

NEAT Configuration

The NEAT configuration file used for training the birds is located at config/neat_cfg.txt. Experiment with this file to fine-tune NEAT parameters and observe the impact on the learning process.

Dependencies

  • neat-python==0.92
  • pygame==2.5.2

Acknowledgements

This project draws inspiration from the classic Flappy Bird game and highlights the potential of the NEAT algorithm in creating adaptive and intelligent agents. The Flappy Bird assets are employed for educational purposes and are not owned by the creator of this project.

License

This project is licensed under the MIT License. Feel free to use and modify the code for your own projects.

flappy-bird-ga's People

Contributors

ssspetrovic avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.