Just a test The cars have no idea where the walls and screen edges are in the beginning of the game. They only know that they are doing it wrong when colliding to a wall or screen edge. They can turn between -20 and 20 degrees and move with a constant speed. Negative degrees means to the left and positive degrees to the right. 0 degrees is going straight. They can decide each frame which direction to move. The system improves with generations. Each generation 100 cars are tested. The first generation just starts taking random paths. Then the system lets run all 100 cars until all cars have collided. For each car the time that it can drive without colliding is measured in frames. Then the system looks at the directions the top 3 longest surviving cars have taken each frame. The next time for each frame the range for which direction cars can take is narrowed down from -20 to 20 to the lowest and highest direction detected for that specific frame of the top 3 best cars. Then a next generation begins and the process is repeated and repeated. The process is a bit inefficient and sometimes can get stuck at some point and you have to start over again. Most times it works I am going to improve the speed of the AI later Works fine for most paths with one way, but it gets frequently stuck when there are more paths to solution like in a maze and/or when there are too sharp curves
This project is made in the autumn/winter of 2024-2025 and is now shared. I'm not sure if this is real AI Press p to pause/replay the simulation Green flag to reset You can turn on Turbo Mode to speed up the learning process