← BACK TO LEVEL SELECT

🎮 Game Dev Origin

NEAT Flappy — Self-Learning AI Birds

A Flappy-Bird clone where nobody plays — a population of neural networks teaches itself to fly via NEAT (NeuroEvolution of Augmenting Topologies), growing more complex each generation.

Overview

A Flappy-Bird clone where nobody touches the keyboard — the birds learn to play themselves. Built in Python + Pygame with NEAT (NeuroEvolution of Augmenting Topologies): a whole population of tiny neural networks flaps, dies, and breeds, and the survivors’ networks evolve — gaining nodes and connections — generation after generation until they clear pipes effortlessly. One of my earliest ML projects, and still one of the most fun to just sit and watch.

Architecture

flowchart LR
    subgraph SIM["Pygame Simulation"]
        BIRDS["Bird population<br/>one genome each"]
        PIPES["Pipes + physics"]
        FIT["Fitness<br/>distance survived"]
    end
    subgraph NEAT["neat-python"]
        SPEC["Speciation"]
        REPRO["Crossover + mutation<br/>weights AND topology"]
        NEXT["Next generation"]
    end
    CHAMP["Champion genome<br/>saved + topology visualizer"]
    BIRDS --> PIPES --> FIT --> SPEC --> REPRO --> NEXT --> BIRDS
    FIT -->|best| CHAMP

Highlights

  • Evolves structure, not just weights — NEAT (via neat-python) starts from minimal networks and augments the topology over generations, so complexity emerges only when it earns its keep.
  • Watch it learn live — a Pygame loop runs the population in real time; average fitness climbs each generation as the weak genomes die off.
  • Genetic-algorithm core — speciation, crossover, and mutation drive a fitness function that rewards distance survived.
  • Replayable champion — the best evolved genome is saved, plus a network visualizer that draws the topology the birds invented.

Why it’s here

It’s a five-year-old repo from the very start of my ML journey — but the idea still holds up: the most effective learning starts simple and grows. A nice origin marker for the road from game loops to production AI.