Skip to content

JohannesKantz/FlappyBird-NeuroEvolution-AI

Repository files navigation

Flappy Bird NeuroEvolution AI

A NeuroEvolution AI for the game Flappy Bird.

Demo

Example Screenshot

Tech Stack

Tensorflow Tensorflow.js p5.js Vite Svelte Typescript Github Actions

How it works

The algorithm used is a NeuroEvolution algorithm. NeuroEvolution is a technique inspired by the process of natural evolution, where a population of AI agents undergoes a genetic algorithm-based optimization to improve their performance over generations.

The process starts with the initialization of a population of AI agents (with random Neural Networks). Each agent is then evaluated by playing the game and receiving a fitness score based on how well it performed. The fitness score is calculated by the distance the agent has traveled. The agents with the highest fitness scores are then selected to reproduce and create the next generation of agents. The process is then repeated until the agents are able to play the game.

Neural Network

Neural Network

How to run

git clone https://github.com/JohannesKantz/FlappyBird-NeuroEvolution-AI.git

pnpm install

pnpm run dev