15 Aug 2026 · updated

F40

I am teaching a car to drive in Assetto Corsa. I do not draw the racing line for it. The car tries a lap. If it stays on the road and keeps moving, it gets a higher score. If it leaves the track, the lap ends and it starts again. Over many tries the program changes how it steers and uses the pedals. That is how it learns.

The project is called OpenChamber. I use a Ferrari F40 at Monza. The training runs on the graphics card in my computer. It is built on AssettoCorsaGym. I am training the model myself, from the start.

How it works

AC hotlap
 → sensors @ 25 Hz
 → gym env
 → PPO (CUDA)
 → vJoy controller → AC
  • The game sends the car’s speed and position
  • The program steers and uses the pedals through a virtual controller
  • If the car leaves the track, it is placed back on the road

Setup

CarFerrari F40
TrackMonza
AlgoPPO · MlpPolicy
DeviceCUDA
This run500k timesteps
Folderppo_f40_monza

First pass

The first training run reached about 101,000 steps out of a planned 300,000. The average score started near zero and later sat around 77. The best single run scored 404. Top speed was about 62. The pictures below are from that run.

Steps~101k/ 300k
Episodes330
Throughput~22fps
Peak speed~62

Episode reward, first pass

  • First 10 (mean) 3.6
  • MA15 at 101k 77
  • Best episode 404

Training again

I have started again with the same car and track. This time the plan is 500,000 steps. It is still at the beginning. I wanted a model that I trained myself, on this computer, all the way through.

Track

Monza track outline
Monza - layout from the sim track config

Learning

Learning curve
Return vs steps, and early vs late reward distribution
Stint distance
How long the agent stays on track (speed × episode length)

Run it

.\.venv\Scripts\python src\train.py \
 --car ferrari_f40 \
 --track monza \
  --timesteps 500000 \
 --run runs\ppo_f40_monza

I later went back to the Mazda on this track. That note is here.

The pictures are from the first F40 run.

← Teaching a model to drive