finds.dev

ssusnic/Machine-Learning-Flappy-Bird

Machine Learning for Flappy Bird using Neural Network and Genetic Algorithm

View on GitHubHomepage ↗

★ 1,839JavaScriptMITupdated Dec 2017

// the take

A 2017 Phaser/JavaScript demo that trains a population of Flappy Bird agents using neuroevolution — a genetic algorithm that evolves neural network weights rather than gradient descent. Good teaching artifact for explaining how GAs work without any math prerequisites. Not a library, not a tool — just a runnable demo with a tutorial.

The genetic algorithm implementation is clearly separated into its own file with well-named methods (selection, crossOver, mutation), making it easy to follow the evolutionary loop. The fitness function is sensible — rewarding distance traveled minus distance to the gap captures both survival time and precision. Watching 10 birds evolve in real time is genuinely a better intuition-builder for neuroevolution than any static explanation. The neural network is intentionally minimal (2 inputs, 6 hidden, 1 output), which keeps the focus on the GA mechanics rather than the NN.

Abandoned in 2017 — Phaser has had two major versions since then (v2→v3→v4), and Synaptic is also effectively unmaintained, so you can't expect to extend this without significant dependency archaeology. Only two input neurons means the bird has no awareness of vertical velocity, which is why early generations often flap erratically — a third input would improve convergence speed noticeably. No persistence: closing the tab loses all evolved weights, there's no export/import for trained genomes. The mutation rate appears hardcoded with no UI to experiment with it, which limits its value as a learning tool for GA hyperparameter intuition.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
1,839
Forks
393
Language
JavaScript
License
MIT
Last commit
19 Dec 2017

// nearby

If Machine-Learning-Flappy-Bird isn't quite it.

All repos →