Summary: Discussion mathematics of racing lines, and neural networks. This is a 2026 “update”, with a little UI code from Claude.
Creating a neural network powered car got me hooked. Watching the cars evolve from random numbers into ones that zoom around the track was so cool.
But one of the fascinating things was that they evolved their own racing line – the fastest route around the track.
Petrol heads often have a “feel” for what makes a good racing line. There is actually a lot of math behind it, as we’re about to dive into.
Below is a poor racing line (100 evolutions, no hidden neurons). A Go Kart can go around this track in 10.5 seconds, this route takes 14 seconds, 30% slower.

I hope you like my new F1 style telemetry (there’s more too). The centre ribbon is speed, dark is the slowest region (not a slow speed, just slow relative to fast). The thin ribbon shows acceleration and braking. And (not shown) it also plots drift.
The following is a more optimal route – the AI is keeping a fairly constant speed. I’m not claiming this is the fastest possible, just a pretty good path without it being given prior knowledge or assistance.

That was Go Karts, I also have Formula 1 cars – they are sliding a bit, and not all on throttle due to the shortness of the track. Maybe a bit more throttle with late braking is still missing. It’s not bad for generation 600.

Leave it longer, and it’s improved, everywhere!

In car feels like this: (Claude turned the flat scenery into a 3D view)
Plotting a hypothetical racing line requires solving a complex mathematical optimization problem where the goal is to minimise total lap time by balancing geometric boundaries with the physics of the vehicle…
And it did it.
