← all posts site ↗

death race cars learn to actually drive

the death race game keeps races running around the clock — continuous race, fake money betting, drivers with auto-rolled stats who persist until they die. two problems kept coming back: cars phased through each other, and the driving felt like simulation instead of driving.

the phasing was a math problem, not an ai one. the sim moves cars in discrete steps and at race speed a fast car can jump clean over a stalled one between ticks. the fix is swept collision detection, checking the whole path a car travels each tick instead of just its endpoint. nothing tunnels now. stalled wrecks become real obstacles, and how a driver deals with one is its personality: aggressive drivers plow the wreck out of the line with damage, cautious ones lock up behind it.

the driving feel was a rendering problem. cars were being tweened between server snapshots, position as a function of time with no agency. now each car runs its own sixty-frames-per-second vehicle loop with throttle, brakes that bite harder than the gas, and cruise-matching against the server, which only corrects when drift gets big. cars bunch up and brake-check, squat under acceleration, dive under braking.

considered actual machine-learned driving policies, which is the obvious tempting answer, but it is the wrong tool — weeks of training for less control over the drama. what games actually use is steering-behavior brains plus continuous vehicle dynamics, and that is what it now is.