Inspiration

Treadmills are the most common excercise equipment for home use also are present in practically every gym. People walk for forty minutes, staring at a wall or a phone. I wanted to know what happens if the treadmill becomes the controller and the room becomes the world. With mixed reality this is finally made possible.

The idea that kept me going: what if every kilometer you walked actually took you somewhere? Not a step counter, but a journey, with villages, a quest-giver who needs your help, and a beacon at the end of every run.

What it does

Treadmill Warrior is a roguelite AR adventure for treadmills, with hand tracking and running in passthrough.

  • Step on any treadmill. There is no smart treadmill, no pairing and no wearables. The headset reads your stride from the small bob of your head.
  • A light trail unrolls through your room and carries you through worlds at the speed of your own pace.
  • Play with your hands. Catch wisps of light to fill your lantern, push a palm through shards of gloom, raise a hand to choose your road at forks, and press your palms together to light the beacon at the end.
  • Pip the firefly guides you, steers wisps into reach and dances when the beacon comes into view.
  • A real journey. Every completed run banks its distance toward the next village, 10 km away.
  • XP and levels reward distance, strides, wisps, gloom broken and beacons reached, with a bonus for running.

How I built it

The game is written in TypeScript on Meta's Immersive Web SDK (three.js and WebXR), built with Vite and served to the Quest browser. Everything you see is generated in code: no external 3D files are loaded at runtime.

Stride detection from the headset alone. The core problem was speed without treadmill data. When you walk on a belt you stay in place, but your head rises and falls once per footfall. I band-pass the headset's height to isolate that bounce, count a footfall each time it crosses a threshold, and only trust the rhythm after three regular strides. Cadence comes from the mean of the last six intervals:

$$ c = \frac{60}{\bar{t}}, \qquad \bar{t} = \frac{1}{6}\sum_{i=1}^{6} t_i $$

where $t_i$ are the gaps between footfalls in seconds, accepted between 0.22 s and 1.3 s.

Cadence becomes trail speed. A 120 strides-per-minute walk travels at 3 m/s, scaled within limits:

$$ v = 3 \cdot \operatorname{clamp}!\left(\frac{c}{120},\ 0.5,\ 1.6\right)\ \text{m/s} $$

A steady pace instead of a twitchy one. Following cadence directly made the world slow down every time I looked around. So the trail now holds a baseline pace learned in a warm-up, and only adopts a new pace when it stays outside a ±10% band long enough: 4 s to speed up, 8 s to slow down, because a false slow-down feels much worse than a false speed-up.

Progression.

XP per run is

$$ \text{XP} = \sum_{\text{events}} b(v)\cdot x_e, \qquad b(v) = \begin{cases} 1 & v < 2.5 \ 1.25 & 2.5 \le v < 3.5 \ 1.5 & v \ge 3.5 \end{cases} $$

with 100 XP per km, 1 per stride, 5 per wisp and 50 per gloom or beacon. Abandoned runs keep half. Level $L$ costs $1000 \cdot 1.25^{\,L-1}$ XP.

Worlds Scenery is instanced, low-poly and procedural: 48 slots recycle along a 72 m window, and each slot re-rolls its prop, position, size and turn every lap, seeded so it changes out of sight. Some worlds are glowing holograms; others (village cabins, crystals, dandelions) are flat-shaded with lighting baked into vertex colors, so dozens of copies stay cheap on a standalone headset.

Interface Menus use hold-to-press medallion buttons and a touch tray, so nothing needs a precise pinch mid-run. Story and dialogue text types out letter by letter, with recorded voiceover. Sound effects are synthesized live with the Web Audio API.

Testing I built a desktop preview that simulates strides, hands and gestures from the keyboard, and ran automated checks in a headless browser: playing whole runs, capturing screenshots and reading the game's state. That let me iterate many times a day and save headset sessions for what only a headset can tell you. In developmend I did use an AI assistant (Claude) extensively.

Challenges I ran into

  • Reading speed without sensors. A head bob is a few millimeters. Separating footfalls from nods, glances and turning to look at something took a lot of tuning: amplitude thresholds, interval limits and requiring a regular rhythm before trusting it.
  • Looking around would cause issues This led to the baseline-pace system described above.
  • Comfort and safety. The trail has to stay centered on a real treadmill with handrails. Scenery never comes within 2.1 m of the center line, the world can be recentered, and stopping eases the trail to a halt instead of freezing it.
  • Performance on a standalone headset. Every prop is instanced and every glow is baked rather than lit, so whole worlds render in a handful of draw calls.
  • Art direction. Not every model works on a moving trail. Some versions looked wrong in motion, and I rolled them back; the crystal horns, for example, only worked once they became a gateway arching over the trail.
  • Pacing a story around exercise. Distance only counts for completed runs, so a quest needs to fit several real workouts, not one session. The Dead Beacon fills over two to three runs.

Accomplishments that I'm proud of

  • It works on any treadmill with nothing but the headset.
  • Running feels like traveling: villages, worlds, quests.
  • Pip the Firefly, who became player's sidekick and heart of the game.

What I learned

  • The body is a great controller, if you design around it. Small, forgiving gestures such as a raised hand or palms together work mid-stride; precise ones don't.
  • Smoothing is a design decision Players notice a false slow-down far more than a slightly late speed-up, and the math should reflect that asymmetry.
  • Mixed reality is the right medium for fitness. Seeing your room keeps you safe, while the fantasy still lands.

What's next

  • More of the journey: new levels, quests and worlds beyond Rybol Village, including a misty world where the trail fades into fog and a snow land.
  • The Inner Peace world: a calmer, story-driven place where you recollect the legend of the lost light.
  • Fitness mode: a more classic music fitness game. You pick a 20-minute mixtape and run to it, catching wisps in sync with the beat, for a workout you can drop into any time

Built With

Share this project:

Updates

Submission history