Project was aimed at making a reinforcement learning algorithm capable of driving a drifty car.
AI Based details:
- A game environment was developed with car physics, drifting, skidmarks and anti roll mechanics.
- Reset mechanics were introduced to speedup the process
- Resets if the car flips
- Resets if the car crashes
- Resets if it doesn't reach the next checkpoint in time.
- Added penalty for
- mean square distance
- angular difference
- collision with mountain.
- Added waypoints along the road for the AI to reach and obtain reward. waypoint colliders were created dynamically during execution calculating the front facing vector using the perpendicular vector formula to the guiding spline
- Observations for input:
- the next 3 waypoints
- velocity of the car
- depth raycasts from the car's roof slightly pointed towards the ground
- Created two types ofbased on wheel physics settings:
- highly gripping car, with very responsive control
- highly drifty car, with low responsive control
- Since neither of the two cars were learning a shuffle algorithm was added which spawned the car at random points along the track
- Both were left to train overnight ~12 hours with 4x instances of the game running.
- Experimented with imitation learning
- Only the car with high grip coefficient on the tires was able to learn anything substantial
Graphics based details:
- Introduced occlusion culling which sent framerate up to about ~45
- Added postprocess, ambient occlusion, color grading, depth of field and fog at some point along the development cycle but later removed while training AI
- the mountain and track models were made from blender and the polycount was kept as low as possible.( Very Low poly road made the car bounce ).
- skidmarks script was taken from here: https://github.com/Nition/UnitySkidmarks
The project was slightly *ambitious* and went through many changes with one hard reset
Here is a gif of me driving the drifty car with arrow keys as input.
This is the AI driving the grippy car. Very wonky controls.
Will get back to this project after learning some more about reinforcement learning.
- Increase decision interval.
- Curriculum Learning from grip to drift coefficients.
- Curriculum Learning for brake strength.
- Action smoothing, reward if similar to previous state.
- Learn RAINBOW.
- CNN input.
