// the find
NeuralNine/ai-car-simulation
A simple self-driving AI car game, which uses NEAT.
A single-file Pygame project where cars drive themselves around a 2D track by evolving neural networks with NEAT (neuroevolution of augmenting topologies). It's the companion repo to a NeuralNine tutorial video, built for people learning how genetic algorithms and neuroevolution work in practice, not for anyone who wants a reusable self-driving stack.
Keeping everything in newcar.py means you can read the whole fitness loop, sensor model, and NEAT integration in one sitting instead of chasing it across modules. It uses neat-python's config.txt properly, so population size, mutation rates, and network topology constraints are externalized and tunable without touching code. Collision detection is done by sampling pixel color on the map image under each car's sensor rays, which is a neat way to avoid writing an actual physics or geometry engine for a toy project. Shipping five different maps (map.png through map5.png) makes it trivial to check whether a trained network actually generalizes or just memorized one track's geometry.
There's no requirements.txt or any dependency pinning, so pygame and neat-python versions are left to chance and this will eventually break on a fresh install. No README is visible in the tree, so there's nothing explaining which map is active, how to tweak config.txt, or how to read the on-screen output. It's a script, not a library — no functions are factored out for sensors, fitness, or rendering, so extending it (new sensor types, different car physics) means editing the monolith directly. The project hasn't been touched since mid-2024 and was always a one-off tutorial artifact, so don't expect fixes if neat-python's API drifts or pygame deprecates something it depends on.