I built a self-driving-car simulator where every car on the road is driven by the same neural network , trained with Double DQN. The cars have a proper dynamic tyre model, so they can understeer, drift with a handbrake and drive in reverse . Everything is written in KingCobra , my programming language, using only its standard library ( std.nn , std.http , std.json and std.system ). There is no Python and there are no external dependencies.
Repo: https://github.com/DivyanshuSinha136/KingCobra-Self-Driving-Car-DQN
The dashboard, captured from the real app: the AI and four NPC cars on a track the network never saw, all driven by one network.
The result
Laps 100 % completed on 3 tracks the network never saw, at about 14 m/s, with no wrecks
Training 1.7 minutes on one CPU core, for a network of about 21,000 parameters
Agent one shared Double DQN, 3-step returns, Huber loss, gradient clipping, soft target updates, 12 actions (steering × pedal)
Physics dynamic bicycle model, tyre friction circle, handbrake…