AI Racing
Short Instructions:
Control your car with [A] and [D] or [LEFT] and [RIGHT].
Once you activate "player controlled speed", use [W] or [UP] to accelerate.
You can change the map by clicking on corners around the track. you can also move the checkpoints by clicking on the center of them. (activate Debug view first; click once to drag, click once to drop)
Longer Instructions:
I stumbled upon this reddit post a while ago, so I went ahead and downloaded the github project.
I wanted to create an easy scenario to play around with the self-learning AI, so I build a simple race track. Each car gets the distance to the next wall diagonally at the front left and front right and uses that as input to the neural network 60 times/sec. The output then decides to either drive left or right. A car gets fitness points depending on how far they manage to drive along the track. You can see the line and checkpoints that are used for calculating the fitness score when you activate the debug view.
Every time, all the cars crashed, a new generation is born and their neural network is trained in favor of those, who had a higher scores.
For faster training success, you can kill a generation each time a car manages to get around the first corner... that way, you get more generations done a lot quicker... then kill the generation each time they manage to go around the second corner and so on. Soon you'll have a whole group of cars being able to go around the track.
You can also change the track in a way that they HAVE to crash in the last corner and just leave it running.
If you significantly change the track, you should activate the debug view and also change the checkpoint locations accordingly.
Have fun and please leave some feedback!
[known issue: changing max speed leads to different behavior. example: set max speed to 30 and the cars will never (or at least not for a long time) reach the finish line. set it back to something small like 6, and they will behave as expected.... no idea what's going on there.]
Status | Prototype |
Platforms | HTML5 |
Rating | Rated 4.8 out of 5 stars (4 total ratings) |
Author | zwometer |
Genre | Racing |
Tags | ai, artificial-intelligence, Experimental |
Average session | A few seconds |
Languages | English |
Inputs | Keyboard, Mouse |
Links | Source for the neuroevolution library by u/kahagino |