How the AI works
Thirty cars evolve with NEAT. Each car is a neural network that steers and accelerates; the population improves through selection and mutation rather than gradient descent.
Inputs → outputs
- Inputs: 8 raycast sensors measuring the distance to the track edges, plus current speed.
- Outputs: steering (left/right) and throttle.
Evolution loop
Cars that drive farther without crashing earn higher fitness. The best are bred and mutated; speciation protects new strategies long enough to mature.
What you see on screen
The raycast lines glow from each car in real time, so you can see exactly what the network "senses" before it decides how to steer.