Brotato RL

A reinforcement-learning environment for Brotato (Demon, Danger 5, endless mode), built in a 12-hour hackathon with PufferLib 5. Code: github.com/IlyaasK/brotato-rl.

Play it

The same C simulator, compiled to WebAssembly, playing a 10B-step Demon endless Danger-5 policy at 60 Hz. Click the canvas first so it takes the keyboard: WASD / arrow keys drive the same 8-way action space, so you can take over from the policy at any moment. Open full window.

What it is

Results so far

Result
Real-game recordings, matching frame for frameup to ticks 1977 / 1551 / 1854 (of 3,600 / 3,600 / 2,799), every recorded action matching
Policy in the simulatorreaches wave ≈3 in the training sweep after 1B steps; 6 weapon slots filled, buys weapons, items and pets
Same policy in the real game (10B steps)4.33 waves on average over seeds 1–3 on both the mid and final checkpoints (best 6), with the simulator matching the game's wave count exactly on 8 of 11 seed pairs
Reward+1 per wave completed, plus potential-based shaping from the endless-mode guide: harvesting and luck first, the pruner → potato thrower → excalibur weapon ladder, Max-HP scaling (materials deliberately unshaped, since paying for holding gold fights the snowball)

Earlier clip

A 1B-step policy playing the desktop simulator, before the browser build.

Notes