← All work
Game · Reinforcement learning

Reflection Madness

A physics marble game on an endless procedural course, with a learning agent that takes the controls and gets better as you watch.

Prototype
A dark marble on a gray tiled isometric platform above tall red and yellow columns, with one yellow and two red sensor markers around it at the platform's edge.
The agent at a cliff corner: its edge and gap sensors turn red where the track drops away.
A dark marble on a stepped isometric track of gray tiles on red and yellow columns, with cyan, yellow and red sensor markers near it.
The marble rolling down a stepped section of generated course, its right sensor reading the drop beside it.

Reflection Madness drops a marble onto an isometric downhill course that keeps generating ahead of it. You can roll it yourself, or watch a Q-learning agent drive, fall and improve. The course gets harder with distance: banked turns and switchbacks first, then wave ramps, split bridges and jumps over open chasms.

The agent sees very little: the angle to the next checkpoint, two raycasts for cliff edges, one for gaps ahead, and a speed bucket. It picks one of six steering actions and learns from a shaped reward that favors downhill progress on solid ground and punishes a fall at -500. Track is built in 16 by 16 tile chunks from a seeded generator, and neighboring tiles of the same height merge into larger colliders to keep the physics world small.

Status A playable browser prototype; the agent's learned table is saved in the browser between visits.

Zach’s part Built the game and the learning agent.