Speedmaxxing: a Three.js racer on Dubai’s Sheikh Zayed Road, with cannon-es crashes and an FPV replay director

Hey everyone :waving_hand:

Sharing a game I’ve been building: Speedmaxxing, a free browser racer set on Dubai’s Sheikh Zayed Road. It’s plain Three.js, no engine, and it runs on phones as well as desktop.

Play: Speedmaxxing · Dubai Edition · Free 3D Racing Game

speedmaxxing-crash

A few things I’d love feedback on:

1. The FPV replay director
While you play, the game samples the scene 30 times a second into a ring buffer of about 11 seconds: every vehicle’s transform, the car rigs, lights, coins, the debris and the smoke/spark particles. When you get busted, it replays that buffer through a drone camera that follows a Catmull-Rom keyframe path with a spring follow, roll and a bit of wobble. The camera starts far back and low, closes in, and slows time down for jumps and crashes. A raycast keeps it from clipping through trucks and bridges.
The replay is also filmed: each frame is copied to a 2D canvas, with a branded card, and recorded with MediaRecorder (MP4 where supported). Players can download a 9:16 clip made entirely on their own device, with nothing uploaded.

2. Crash physics with cannon-es
Traffic normally runs on simple lane logic. When you hit a car it becomes a real cannon-es body, with mass by vehicle type, an impulse at the contact point, and spin from off-centre hits. Two tricks made it feel right:

  • cannon’s box friction grabbed instantly at highway speeds, so the contacts are frictionless and tyre grip and metal scraping are done by hand.
  • nearby traffic becomes kinematic sensors, so a wreck can knock into the next car and start a pile-up.
    Hit a bus at speed and it’s game over.

3. The world
A hand-built Sheikh Zayed Road with the Burj Khalifa skyline, the Metro line, bilingual Arabic/English exit signs, and Dubai traffic (taxis, school buses, delivery bikes, police), from day to night. The vehicles are all procedural geometry. The full UI also works in Arabic, with right-to-left layout.

There’s also live two-player (Supabase realtime) and a police drone that hunts you down.

To see the replay: play a run until the police catch you, then tap Watch replay on the results screen.

Happy to go into detail on any of it, and I’d love to hear how it runs on your device :folded_hands: