Just-for-fun side project trying to teach a car driving using RL in Unity. The code uses a quite realistic car model that includes nonlinearities such as skidding etc. and is taken from Unity standard assets.
16 cars in parallel on randomized trajectories. The episode ends when a wall is hit. Then, a new trajectory is generated and the process repeats.

Result:
Racing1.mp4
Training an agent to find a path itself is hard - implementing it with a pathfinding algorithm (here: A*) is much easier. Agent and setup are the same, but I retrained the agent in a less cluttered environment since it seemed to rely mostly on the wall information, and not so much on the waypoints. You can find the code in the pathfinding branch.

Result:
Racing.2.mp4
This project requires Unity Editor version 2021.3.15f1. To see the learning environment, navigate to Assets/Scenes
and open main (car).unity
. If you are using the pathfinding branch, go to Scenes
to load either the Learning
scene or the Evaluation
scene.