Curious how the AI thinks? Lab view shows the 5 numbers it sees, the gap it's aiming for, a trail of where it flapped, the reward it's trying to maximise and the real hitboxes. Press L at any time.
Each medal is the eight-pointed star from Moroccan zellige tiles.
| Gap | Speed | |
|---|---|---|
| Easy | 180 px | 3 px per step |
| Medium | 155 px | 3.5 px per step |
| Hard | 130 px | 4 px per step |
Tip: tap in small, steady rhythms. Big panicky bursts shoot you into the clouds.
Win medals to unlock new storks. A medal on any level counts. Skins only change how your stork looks: the hitbox and the physics stay exactly the same.
Stork Flight is part of Morocco in Data, a set of projects where I use data and code to test ideas.
This game is an experiment in reinforcement learning. The exact same rules run in a Python environment, where an AI learned to fly from rewards alone: +1 for each minaret, −1 for a crash. Nobody told it to flap.
The physics here match the training environment step for step: 30 steps per second, the same gravity, the same gaps. So your score and the AI's score mean the same thing.
The AIs in this game are real snapshots from training, running right in your browser. Beginner is an AI early in its training, and Seasoned is the best snapshot after up to a million steps of practice. Every opponent is a real point in the learning process; none of them was made worse on purpose.
Average minarets passed on the same 20 test courses (the most possible in 100 seconds is 41 on Easy, 49 on Medium and 56 on Hard):
| Easy | Medium | Hard | |
|---|---|---|---|
| Beginner | 13.8 | 11.1 | 16.4 |
| Intermediate | 20.6 | 28.3 | 35.6 |
| Experienced | 36.9 | 40.1 | 44.8 |
| Seasoned | 41.0 | 49.0 | 47.9 |
| My one-line rule | 41.0 | 43.0 | 26.9 |
The full experiment, with the training code and learning curves, is in the notebook on GitHub.
Every drawing is made with code, the storks, minarets and medina wall. Every sound is made with code too, using the Web Audio API, with no recordings. White storks really do nest on minarets in Morocco, which is where the idea came from.
I wrote it with help from an AI coding assistant. The project idea, the experiments and the decisions are mine.