← São Paulo WorldOne stepWhat it calculatesGarageHow lightFull mathGitHub
OpenRoad Dynamics · the physics engine behind the game

What happens in 2.8 milliseconds

Every 1/360 of a second, the car on the test track is solved again from scratch: where each tyre touches the road, how hard the springs push, how much each tyre slips and grips, what the engine, clutch, gearbox and differential do, and how the whole car moves. Nothing is animated or canned. It's all physics, in plain C++ that doesn't care which game engine runs it.

▶ Drive it in your browserFree & open source on GitHub (MIT)Motor Vehicle Dynamics: every equation →
360physics steps a second in the browser demo
44ground samples per step (11 under each tyre)
15,840ground samples a second, before any rendering
~330numbers that define one car (68 per wheel corner)
0memory allocations per step (tested)
129automated tests on Linux, macOS and Windows
One step, in order

Four stages, 360 times a second

This is the order of operations inside Vehicle::computeStep. Assists act first (only through real actuators: brakes, throttle, shifts), then the four stages, then a telemetry snapshot of about 130 values.

Contact and suspension

Under each tyre: 5 points across the contact patch plus 3 envelope probes ahead and 3 behind, so kerbs and pothole edges are felt before the patch reaches them. Springs, bump and rebound damping (separate slow and fast settings, like a real two-way damper), bump stops, anti-roll bars, and each wheel's own unsprung mass bouncing on the tyre's vertical stiffness. Each wheel's camber to the road comes from its geometry: static camber, camber gain as the suspension moves, caster as it steers, and the body's roll.

Tyre slip, sideways

Slip angles build up over a relaxation length (0.45 m by default) instead of jumping, which is what makes a car feel like it has weight on turn-in. Grip comes from a Pacejka Magic Formula with load sensitivity and combined slip, scaled by camber (best leaning about 2° into the turn), tread temperature, tyre pressure, and the compound's grip on wet or loose ground.

Drivetrain, solved together

Engine crank, gearbox input, all four wheel speeds and their longitudinal slip are solved in one implicit system, with the clutch, gears and differentials as stick/slip constraints. Up to 12 iterations per step.

Forces and motion

Tyre forces, suspension forces, self-aligning torque, rolling resistance, aerodynamics and gravity are summed on the chassis, a rigid body with 6 degrees of freedom, which is then integrated. Aero uses the speed through the air (wind included): drag, a floor whose downforce grows as it runs lower until it stalls, and a rear wing that stalls past its critical angle. Each tread then heats from sliding and cools in the airflow.

One 60 fps frame (16.7 ms) = six physics steps of 2.78 msIn a game the core can also run 4 substeps inside a 60 Hz world, with ground pre-fetched once per frame
The hard part

Why the drivetrain is solved implicitly

A spinning wheel is tied to the road by the tyre's slip stiffness. That coupling settles in about 0.1 ms, far shorter than a 2.8 ms step, so stepping it forward naively explodes at low speed. The usual fixes (heavy substepping, clamping slip) change the physics. OpenRoad Dynamics instead solves every shaft, every slip and every clutch/differential constraint together, backward Euler, every step.

τ ≈ I_w · |v_x| / (K_x · r²)  ≈ 0.1 ms  (I_w 1.2 kg·m², K_x 10⁵ N, r 0.33 m, v_x 1 m/s)
I_i (ω_i − ω_i⁰)/Δt = T_i − r_i F_x,i + Σ J λ   ·   σ (κ′_i − κ′_i⁰)/Δt + |v_x,i| κ′_i = r_i ω_i − v_x,i

Unknowns per step: engine crank speed, gearbox input speed, four wheel speeds, four transient slips, plus one multiplier per active clutch, gear or differential constraint. At zero speed the slip equation becomes a spring, which is what lets the car sit still on a hill without creeping.

What it calculates

Every factor in the model

About 330 numbers describe one car, plus its engine torque curve. Tyre data can be generated from nothing more than a size and category (e.g. 335/40 R21, ultra-high performance).

Tyre 48 per tyre

  • Peak grip, longitudinal and lateral, and how it falls with load (load sensitivity)
  • Magic Formula shape and curvature, both directions
  • Slip stiffness and cornering stiffness, peaking at a set load
  • Combined-slip weighting: braking while turning costs grip both ways
  • Relaxation lengths (transient slip), low-speed carcass damping
  • Rolling resistance, pneumatic trail (self-aligning torque), wheel inertia
  • Vertical stiffness and damping, contact-patch length and width
  • Camber thrust and the camber that gives peak grip
  • Tread temperature window, heating and cooling (slicks need heat)
  • Grip on wet and loose ground (off-road to slick, rain)
  • Hydroplaning in standing water: speed from the tyre pressure (NASA's 6.35 √p km/h), tread depth, water drag, wheel spin-down

Suspension & wheel 20 per corner

  • Hardpoint position (x, y, z) and travel
  • Spring rate and preload, bump stop rate
  • Separate bump and rebound damping, slow and fast
  • Static camber, camber gain, caster
  • Unsprung mass (wheel, tyre, hub, brake)
  • Steering lock, static toe, Ackermann (per car)
  • Brake and handbrake torque; anti-roll bar per axle

Engine & drivetrain ~25 + torque curve

  • Torque curve, idle, rev limiter (9,000 rpm on the test car), crank inertia
  • Engine braking: friction a + b·ω through the gear ratio
  • Clutch capacity; gearbox ratios, reverse, efficiency, shift time, input inertia
  • Automatic, sequential, dual-clutch or H-pattern
  • Open, locked or clutch-LSD differentials with preload and power/coast ramps; AWD split

Body, air & aids ~40

  • Mass, centre of mass, roll/pitch/yaw inertia
  • Drag area, front and rear downforce, side force in a crosswind
  • Floor ride-height sensitivity and stall; rear wing span, chord, angle and stall (from Aviation Dynamics)
  • Air density from altitude and temperature, and the engine power it costs
  • ABS target slip; traction control that brakes a spinning wheel before it cuts power
  • Stability control from a sideslip reference; countersteer and drift aids (labelled as non-real)
  • Steering shaping and rates, auto clutch (opens with the handbrake, like a drifter), launch rpm, shift mode
  • Fun, Sport, Simulation and Drift only change these aids, never the grip
Tracked every stepHow manyWhat
Chassis6 DOFPosition and orientation, linear and angular velocity
Each wheel4 × 5Spin, unsprung vertical travel, transient slip ratio, transient slip angle, tread temperature
Drivetrain2 + stateEngine crank speed, gearbox input speed, gear, clutch engagement, shift timer
Ground44Contact samples and envelope probes, with the surface's grip, roughness and micro-texture
Crash structure~110 + 380With realistic damage: nodes (position, velocity) and elastic-plastic beams (rest length, plastic deformation, torn); asleep, at no cost, until something is near
Parts~40Per wheel: toe, camber, mount offset, bend, torn off, puncture and deflation; steering offset and lock; radiator, coolant, engine temperature and damage, seizure; drag and wing
Telemetry~130Speed, sideslip, yaw rate, g-forces, inputs vs actuator outputs, rpm, gear, every aid's intervention, downforce, drag and stall flags, and per wheel load, slip, forces, grip used, camber, tread temperature, brake torque and lock
A test bed, not just a game

Garage, drifting, crashes and bikes

The same physics, with the parts changed. Every setting is in the units a setup sheet uses, and the results come from the model, not from a lookup table.

Tuning garage per axle

  • Camber, toe, caster, camber gain
  • Springs, ride height, slow and fast bump and rebound, anti-roll bars
  • Tyre compound: off-road, all-season, street, sport, semi-slick, slick, rain; pressure; tyre warmers
  • Brake balance and pressure, differential, final drive, gear ratios
  • Splitter, rear downforce, a rear wing and its angle; altitude, air temperature, wind
  • Saved per car, shared as a JSON setup file

What changing them does measured

  • Skidpad on warm tyres: 0.76 g off-road, 0.83 g street, 0.94 g slick
  • On gravel the order flips: 0.62 g off-road, 0.37 g slick. In the wet, rain tyres lead (0.56 g)
  • Slicks from cold: 0.74 g; warm: 0.94 g
  • 100–0 km/h: 39.0 m at 0° camber, 42.6 m at −6°
  • Rear wing at 200 km/h: 211 N at 0°, 1,394 N at 24°, then it stalls (920 N at 30°)
  • Brake balance at 30% front without ABS: the car swaps ends (31° of sideslip)

Drifting an aid, labelled

  • Steering sets the drift angle, throttle holds it, centring the wheel straightens the car
  • Holds 17° / 24° / 31° at half, three-quarter and full steering (52° with an angle kit)
  • Full lock and throttle from a crawl spins donuts: the aid steps aside
  • It only ever countersteers and trims power; switched off, the same car simply spins

Crashes and two-wheelers

  • Each impact becomes a crash pulse; two crash-test dummies give chest g, head injury criterion and injury risk from published curves (a game estimate, not a crash test)
  • Cars roll over: a body hull meets the ground once the car tilts, so a car slid sideways into a kerb or launched off a one-sided ramp lands on its side or roof. The tall, 4.2 t S 600 Guard goes over first; the F1 car hardly ever does
  • Rideable bicycle, e-scooter and sport motorcycle on a multibody model that reproduces the textbook bicycle weave and capsize speeds
  • Counter-steering emerges from the physics; wheelies and ABS for the motorcycle
How light it is

Thousands of cars of headroom

Headless core only, single-threaded on a 2.1 GHz cloud Xeon. These numbers cover physics and ground handling, not a game engine's scene queries, rendering, audio or game logic, so they're not a promise of how many cars a game can run.

SceneCPU per 60 fps frameGround rays per frame
Player car: 60 Hz world × 4 substeps, 5-point contact + envelope probes, ground cache~0.08 ms~24
+ 16 nearby AI cars (lighter fidelity) + 300 traffic cars~0.43 ms~108
+ 1,000 traffic cars instead of 300~0.77 ms~150

On kerbs and potholes the cached 60 Hz × 4 configuration stays within about 5–8 % of a 2,000 Hz reference, with about 4× fewer ground rays than querying directly at 240 Hz.

Engine-agnostic

Runs anywhere C++ runs

The core includes no game-engine headers. A host only has to answer “where is the ground under this point, and what is it made of?”. Everything else lives in the library.

Where it runs today

  • Headless for tests, servers and benchmarks (Linux, macOS, Windows; GCC, Clang, MSVC)
  • In the browser: compiled to WebAssembly for the test track
  • Inside an engine: the host can integrate the chassis itself and pass forces back, with ground pre-fetched once per frame
  • An Unreal Engine 5 plugin is written but not compiled yet

Built to be trusted

  • Deterministic, with no allocations in the step
  • Every definition field is range-checked; a runtime guard catches non-finite state
  • 13 headline handling numbers are locked in a reviewed baseline that CI checks
  • Implemented from published mathematics; MIT licence
The test car: Rosser V8Measured in the sim
0–100 km/h (Sport preset)3.81 s
0–200 km/h9.57 s
Top speed~330 km/h
Mass, weight split1,480 kg · 42 / 58
Rev limiter, gearbox9,000 rpm · 7-speed DCT