Majority of this site's info needs a rework; that's coming soon - BlackNinja745
A 2D Neural Network simulation where you can train cars to complete a track. Uses basic feedforward neural network model without backpropagation. The layer structure is customizable, cars evolve through random mutation and selecting the best car from each generation.
The best car is evaluated by the time it stays alive (killed by crashing into a wall), and more importantly, by how many "reward gates" it crosses around the map.
Multiple reward gates are there to guide the car around the track, and to ensure the selected best car is more likely to have gone further.
Each generation's feedforward algorithm can be processed in parallel, all at once on the GPU using compute shaders. Processing each car individually on the CPU is also possible.
Customizable Parameters
- Load Existing Brain (Neural Network layers with weights & biases)
- Generate New Brain, 3 input neurons, customizable hidden layers, and 4 output neurons.
- Cars Per Generation
- Mutation Per Generation, weights & biases [-1,1] are linearly interpolated to random float [-1,1] by the mutation value.
- Limit Generation Time, cars are given a set time to drive/be tested before the best one is selected. Can be set to a value (sec) or disabled.
- Purge Generation Time, cars that haven't crossed a reward gate after a certain amount of seconds have passed will be killed. Can be set to a value (sec) or disabled.
- Auto Clear Dead Cars, at set intervals all dead cars are cleared from the screen and freed from memory. If the current best car is dead when the cars are being cleared, it will not be killed. Can be set to a value (sec) or disabled.
- Use Multiple Spawn Points, cars will be spawned at different places around the map. This is a measure to test the cars in different locations and to potentially avoid over fitting.
- Save Directory, the default location to save saved_brain.braindata files. Default location is [Documents]/CarNeuralNetowrkSimulation/
- Map Selection, select different maps to test/train the cars on.
Screenshots of the simulation.
BlackNinja745 Studios 2023
This project was fully created by BlackNinja745 & MSKatKing
Inspired by Sebastian Lague
Made with Godot Engine 4.11