Evolutionary driving school: cars that breed their way around walls
A Unity sandbox where neural-network cars learn to steer via genetic algorithm instead of backpropagation.

What it does This is a 2D Unity simulation where tiny cars must navigate obstacle courses without crashing. Each car reads five front-facing distance sensors, feeds that data through a feedforward neural network, and uses the network’s two outputs to control engine and steering. The twist: nobody backpropagates anything. The network weights evolve through generations of selection, recombination, and mutation until the population stops hitting walls.
The interesting bit The genetic algorithm is implemented as a pluggable C# class with delegate hooks, so you can swap in your own selection or mutation logic without rewriting the core loop. The UI even visualizes the best car’s neural network in real time—green connections for positive weights, red for negative, thickness for magnitude—so you can literally watch evolution sculpt the synapses.
Key highlights
- 5-4-3-2 fully connected feedforward network, hand-rolled in C#
- Generic
GeneticAlgorithmclass with assignable delegate methods for easy experimentation - Pre-built Windows executable if you don’t want to touch Unity Editor
- Multiple courses of varying difficulty as separate Unity scenes
- Real-time visualization of the current best car’s neural network and fitness
Caveats
- Only a Windows
.exebuild is provided; other platforms need Unity Editor - The README doesn’t specify population sizes, mutation rates, or convergence times
- It’s a simulation sandbox, not a trained model you can drop into another project
Verdict Grab this if you want to see evolutionary algorithms in motion or teach a class on neuroevolution. Skip it if you need a production-ready autonomous driving stack or GPU-accelerated training.