Self-Driving Car Simulator
Cars learn to drive by themselves using a neural network β a simple artificial brain inspired by how real neurons work.
How it works
- Sensors β Each car has yellow rays that detect obstacles and road edges. These are the brain's "eyes".
- Brain β The neural network (shown on the right) takes sensor data and decides: go forward, turn left, turn right, or reverse.
- Selection β The car that gets the furthest without crashing is the "best" (shown in full color). All others are transparent ghosts.
- Evolution β Save the best brain, restart, and all new cars get slightly mutated copies. Over generations, they learn to drive!
Training workflow
- Watch cars drive. The best one is highlighted automatically.
- When you're happy with one, click πΎ Save to remember its brain.
- Click π Restart β new cars spawn with mutations of the saved brain.
- Repeat! Each generation should get better.
- Click ποΈ Discard to start completely fresh.
Neural network display
The black panel on the right shows the best car's brain in real-time:
- Bottom nodes β sensor inputs (how close obstacles are)
- Middle nodes β hidden layer (the "thinking" part)
- Top nodes β outputs: β forward, β left, β right, β reverse
- Yellow lines β positive connections (encouraging)
- Blue lines β negative connections (inhibiting)
- Dashed circles β neuron bias (activation threshold)
Buttons
| πΎ | Save the best car's brain |
| ποΈ | Delete saved brain, start fresh |
| π | Restart simulation (keeps saved brain) |
| βοΈ | Open settings panel |
| β | This help screen |