Lights-Out Surfer: the PPO runner AI

The AI opponent of Lights-Out Surfer, an open-source endless runner (3 lanes, trains, barriers, coins, jump and roll) built for the BULSHY.FM series. You can race it in the browser on theonlygoatsan.com.

Benchmark (rules v4)

The final model plays the same 100 tracks (seeds 1000-1099) on each start level, deterministic actions, 30-minute limit, scored with the game's own score (metres + coins):

Start level Mean ± 95% CI Median survival
Easy 27,478 ± 1,299 14 min
Normal 24,296 ± 1,182 11.6 min
Hard 20,965 ± 1,087 9.5 min

The difficulty keeps rising during a run with no ceiling, so every run ends. Most end head-on into a train.

Files

  • policy-hard.onnx (final, 55M decisions), policy-normal.onnx (27.5M), policy-easy.onnx (15M): the browser opponents. Input obs float32 [batch, 1074], output logits float32 [batch, 5] (nothing, left, right, jump, roll); play = argmax. Each has a .json with its benchmark and a _parity.json with 50 observations and the actions PyTorch picks (for checking another runtime).
  • final.zip: the SB3 model (MLP 256x256 actor and critic).
  • reward.json: the reward it was trained with (one documented weight per game event).
  • bench.csv: every benchmark track and level; bench_<steps>.csv for the two easier models.

What it sees

What a player sees, as numbers: a grid of 3 lanes x 32 rows ahead (3 m each) with 11 object types, plus 18 values about the runner (lane, height, speed, power-ups, difficulty). The chaser behind the runner is hidden from it, like from a player who does not look back.

Training

PPO (Stable-Baselines3 2.9.2), 192 games in parallel run by a Node game server, a random start level per run, 55M decisions (about an hour on a laptop). Reward: +0.1 per metre, -1 per stumble, -10 when the run ends, -0.02 per reversed lane change or pointless jump/roll (see reward.json).

Code: https://github.com/GOATsann/goatsan-lab. Made by @_goatsan.

Downloads last month
27
Video Preview
loading