← projectsPocket Paddock
// project — Pocket Paddock

Pocket Paddock

Your phone is the steering wheel. Your browser is the race track.

Pocket Paddock — captura
01// historia

A steering wheel you already carry

I wanted a racing game anyone could try in thirty seconds. A real wheel costs hundreds of dollars and nobody has one nearby, but almost everyone has a phone with an accelerometer. The idea: the PC shows the race like a TV, and the phone, held sideways, is the wheel.

It started at a Claude Community game-dev workshop at Platzi in Bogotá and kept growing with feedback from the people who played it.

Phone wheel interface with brake and throttle pedals, paddles, DRS and ERS

↳ The wheel: touch pedals, paddles, DRS and ERS buttons, a speedometer and RPM LEDs.

02// arquitectura

A relay that knows nothing about racing

The PC opens a room and shows a QR code. The phone scans it and joins that room over WebSocket. In the middle sits a FastAPI relay that only forwards messages between the two ends: it has no game logic, so there is nothing to sync or break on the server side.

The phone sends input at 60 Hz and the PC sends telemetry back at 20 Hz so the wheel doubles as a dashboard. Physics runs on the PC at a fixed 120 Hz step and the renderer interpolates between steps, so network latency doesn't show up in how the car moves.

60 Hz
wheel input
20 Hz
telemetry
120 Hz fixed
physics
Grand Prix menu with a broadcast-style look

↳ The menu, styled like a TV broadcast, with the QR code to pair your phone.

03// decision

No physics engine, on purpose

The car uses an arcade model written from scratch in plain TypeScript, with no Rapier or Cannon. It covers aero load, grip and slip, surfaces (asphalt, kerbs, grass, gravel) and slopes. That way I control exactly how it feels and can test it without a browser.

Steering comes from gravity in `devicemotion`, not `deviceorientation`, and sensitivity changes with speed. I also added shaking the phone to trigger DRS or ERS without letting go of the wheel. The shake had to be limited to the axis perpendicular to the screen; otherwise every hard turn fired DRS.

8 speeds
gearbox
none
physics engine
582
tests (Vitest)
04// arquitectura

Circuits built from real data

A Python pipeline takes public racing-line data (FastF1), OpenStreetMap and elevation models and turns them into the track mesh, sectors, DRS zones and kerbs. Each circuit is a JSON file the game loads, so adding one means running a script, not touching the engine.

There are three: Interlagos, with the climb to the pits; Spa-Francorchamps, with Eau Rouge and Raidillon; and Bahrain at night, with its own floodlights and desert ground. The elevation changes are real, and you feel them most at Spa.

3
circuits
real zones only
DRS
Chasing at Spa-Francorchamps toward Eau Rouge

↳ Spa-Francorchamps: the Eau Rouge–Raidillon climb with the real terrain relief.

05// media

Practice, Grand Prix, split screen and VR

There is practice with sector times and delta, a 5-lap Grand Prix against AI rivals from fictional teams, split screen for two players with a phone each, and online racing between PCs. Keyboard and USB gamepad remain as a fallback.

On Meta Quest 3 you sit in the cockpit with instruments on the wheel and drive with the phone or the headset controllers. The hybrid engine sound comes from a procedural Web Audio synth: there isn't a single audio file.

4 + VR
modes
0
audio files
Wheel-to-wheel night race at Bahrain

↳ Bahrain at night: floodlights, desert run-off and heavy braking into Turn 1.

06// aprendizaje

What I learned and what is still open

The hard part wasn't the 3D, it was the sensors. A phone needs a secure context (HTTPS) to expose motion, every browser behaves differently, and a wheel with half a second of lag is unplayable. So I measured latency first and built everything else on top.

The reference setup today is Android with Chrome. On iOS and Safari the motion permissions aren't fully handled yet, and that is noted in the README. It's a non-commercial project: the teams and liveries are fictional and it has no affiliation with Formula 1 or the FIA.

Lights out at Interlagos with AI rivals on the grid

↳ Lights out at Interlagos, with the AI rivals on the grid.

Built with:Vanilla Three.js, TypeScript, Vite, FastAPI (WebSocket relay), WebXR, Web Audio, Python (FastF1, NumPy, SciPy) for the track pipeline, Vitest and Docker. Built with Claude Code.
next project
Code Arena→

Because a university programming contest should feel like a live arena, not a static form.