Open-Source RL Research · Pure NumPy · Zero Deep Learning

Physics Beats Hacks

Why naive tabular RL fails at Flappy Bird—and how two classic Sutton & Barto fixes (asymmetric Tile Coding + Eligibility Traces) jump from 1.2 to 57.3 / 59 pipes (92% cap) and 215-pipe endurance in 2,000 episodes.

57.27 / 59
Mean greedy pipes · 92% cap hits (10 seeds)
215.1 pipes
Endurance test (4.25× Tabular Q · 2.65× Heuristic)
4.0k weights
3× smaller & 2.5× fewer episodes than Tabular Q
106× rescue
4D Lookahead state: 0.53 → 56.36 pipes

1. Watch the Real Trained Agent Fly (Live in Your Browser)

Running the exact exported weights of tile_sarsa_3d_seed0.pkl (47 KB JSON, zero server) on the exact Python environment physics. Switch controllers—or click/press Space to play yourself!

Real trained Tile-Coded SARSA(λ) weights: 8 asymmetric overlapping tilings over (Δx, Δy, v). Watch the live Flap-vs-Coast Q-advantage bar below the ground—it coasts ~88% of frames and taps flap strictly in the lower safe band (Δy > +7 px).

Current Pipes
0
Best This Session
0
Height Δy = y − gap
0 px
Q(Flap) − Q(Coast)
0.000
Why Naive RL Fails Here

A single flap rises 45 px over 9 frames, while clearance above gap center is only 38 px. Try Play Yourself and flap at the gap center—you will immediately hit the top pipe!

2. First-Principles Physics Lab

Drag the flap height slider to see why naive shaping bribes the bird into a ceiling crash—and why steep drops motivate 4D lookahead.

Flap height Δy = y − gap 0 px

3. Locked 10-Seed Benchmark (All Numbers Auto-Generated)

20 unseen standard levels (Cap 59) + 20 unseen endurance levels (Cap 299). Every Tile-Coded gain over Tabular Q is significant at p < 0.001 (Cohen's d = +2.31 to +3.51).

ActConfigurationTrain Eps Pipes (Cap 59)Cap Hits Endurance (Cap 299)Wall Margin

4. Visual Story: From Failure to Mastery

Every figure is generated directly from results/runs_full.json and saved seed-0 checkpoints.

3-Act Result Ladder
Figure 2 — The 3-Act Result Ladder: Individual 10-seed points, mean ± 95% CI, and the 299-pipe endurance stress test breaking the 59-pipe cap.
Policy Brain Maps and Learning Speed
Figure 3 — Seeing Inside the Agent's Brain: Learned greedy policy in (Δy, v) space discovering the exact Δy = +7 px physics boundary, plus 10-seed learning speed curves.
Evolution Trail and Safety Margins
Figure 4 — Growing Up on the Same Unseen Level: Episode 10 (ceiling crash) → Episode 200 → Episode 2,000 smooth pipe surfing, alongside mean pipe-wall safety clearance.