← All writing

October 26, 2026 4 min read

AtomTaxi: how a taxi simulator works in the browser

Physics, living traffic, file-free sound and 6× fewer triangles per frame — inside a Cobalt taxi on the streets of Tashkent.

AtomTaxi is a driving simulator: a Chevrolet Cobalt taxi in a Tashkent-style city. It is built on Vite, TypeScript, three.js and the Rapier physics engine, runs in the browser and needs nothing installed. This post covers three hard parts: physics, city life and performance.

Physics: not arcade, but playable

The car sits on Rapier's raycast vehicle controller: suspension, weight transfer, air drag, a 6-speed automatic or manual gearbox. Physics runs on a fixed 1/60 s step and is drawn with interpolation, so the car behaves the same at any frame rate.

The Mercedes C63's rear-wheel drive is not left to Rapier: the rear axle has its own angular velocity, and each tyre computes longitudinal and lateral slip together. Keyboard throttle is only 0 or 1, so a drift assistant acts as the driver's right foot; the rest of the time traction control and ESP keep the car in line.

Every change is checked with numbers: the test:physics and test:drift scripts run the game in a browser without rendering and measure 0–100, braking distance and drift symmetry.

A living city

AI cars follow a lane graph using IDM (Intelligent Driver Model): they keep distance to the car ahead, to traffic lights and to the player, and brake smoothly. At junctions, conflicting paths are reserved — a car enters only when its way is clear. Pedestrians use zebra crossings and AI cars wait for them at the stop line.

The taxi shift is a separate layer. It includes:

  • orders in a phone app, plus passengers hailing from the kerb
  • GPS — A* over the lane graph with "in 200 m turn right" prompts
  • a taximeter on the Yandex Go tariff: pick-up + km + minutes, with a rush-hour multiplier
  • methane consumption, speed-camera and red-light fines, passenger ratings

From 7.5M to 1.2M triangles

The first version drew 2,600 full trees every frame — twice, counting shadows. Now trees have three LOD levels and each one is culled against the camera frustum, distant AI cars get simple wheels, and the taximeter and maps redraw at 30 Hz. The result: ~1.2M triangles per frame instead of ~7.5M.

The game rates the machine on its own (GPU, cores, memory) and picks a Low, Medium or High preset. If FPS drops below 40 during play, the graphics step down a level; when there is headroom for a while, they step back up.

Sound — without files

The Cobalt engine is synthesised in an AudioWorklet. The turbo whistle, blow-off, tyre squeal and impacts are synthesised too: the impact sound depends on what you hit — a car, a wall, a pole or a tree. Real recordings are used only for the Mercedes V8.

You can try the game at atomtaxi.vercel.app — on a computer, with a keyboard or a gamepad.

ProjectAtomTaxi Taxi simulator in Tashkent

// Contact

Have a project?
Let's build it.

A new product, rewriting an existing system or a collaboration — message me on Telegram, I usually reply within a day.

Telegram: @atomlabs_support