casper
← All projects

In progress Semester 7 (AI), autumn 2026

Assetto Corsa RL

A reinforcement learning driver for Assetto Corsa that learns to drive any track in any car, and is tested on the Nürburgring Nordschleife, a track it never trains on.

Most racing game AIs learn a single track by heart. I wanted one model that can drive any track in any car, by looking at the road ahead and feeling what the car does. It steers, brakes, accelerates and shifts gears itself, without a racing line to follow. The final test is the 20.8 km Nordschleife, a track it never sees during training.

I test with three cars: the Audi R18 e-tron, a prototype with a lot of power and downforce, the Lamborghini Huracán GT3, and the Abarth 500, a normal road car.

How it works

C# (.NET 9) runs the game. It starts sessions, reads the telemetry, places the cars, hands out the rewards and shows a live dashboard. A Lua app inside the game reads the track and drives the cars, and talks to C# through shared memory. The learning happens in Python with Stable-Baselines3 (SAC) and a small CNN that looks at the road ahead.

40 cars train at the same time, in real time, at 10 decisions per second, on 48 real tracks with 10 different cars. Each decision is based on about 470 numbers, such as the road edges and kerbs up to 400 m ahead, the distance to the walls, speed, g-forces, tyre slip, revs and damage. Training runs for days without me watching. It restarts itself after a crash and saves a copy of the model to Google Drive every million steps, so I can test old versions later.

Results so far

On the training tracks, the median run grew from about 820 m to about 2.6 km between round 1 and round 11. The share of runs that ended with the car stuck dropped from 40% to 3%.

On the Nordschleife, which it has never seen, the best runs now reach about 6.3 km, almost a third of a lap. The R18 gets there in 2:17, the Abarth in 3:18. At Canadian Tire Motorsport Park the R18 drives more than a full lap (5.06 km in 100 seconds) from a standing start without crashing.

Testing

One test run per car was too random to compare rounds with, so the Nordschleife test now runs 40 copies of each car at once, 1 m apart.

Videos

Gallery

  • The Audi R18 at speed on the Nordschleife, a track the AI never trained on.

Driving

  • The R18 at over 200 km/h at Canadian Tire Motorsport Park (Mosport).

Under the hood

  • Debug view: everything the AI sees, with its requests, its inputs and the road ahead as a grid up to 400 m.

Results

  • Progress over rounds 1 to 11: distance per run, how runs end, and the Nordschleife test.
  • Nordschleife test per car: the median of 40 cars, and the range from worst to best.