I am creating a bike racing game in which I want a AI to race as a opponent with me. So I decided and created a model by training the agent for Left turns, right turns, both left and right turns in a simple track. The model was trained very good that it turns left and right according to the placement of checkpoints in the track.
Then I created a big track and then tried to train the agent there.
I had a total of 210 checkpoints in the track and the agent was only able to navigate to 170 checkpoints. Then the agent can't able to find the next checkpoint(I guess). It simply checks for the checkpoint in the surrounding which looks like fresh models. When I drag them to the checkpoint, still no improvements. It still acts like new model.
The agent takes the following observations:
- Speed of the bike
- Distance to next checkpoint
- Angle to next checkpoint
The agent takes the following continuous actions:
- Applies acceleration
- Steers the bike
Rewards system:
- for correct checkpoint = Distance reward + angle reward + 1
- for wrong checkpoint = -0.5
- for colliding with normal walls = -0.5
- for colliding with side walls = -1 with RESET
- for colliding with backSide walls = -2 with RESET
- for colliding and staying inside walls = -0.01
- if speed < 5 = -0.01
Actually I trained the model for 1680961225 steps. The model will easily take sharp left and right turns accordingly. The only issue is , It stops finding way at a certain place/Checkpoint.
I even tried the same in different track with different right & left turns. Placed 100 checkpoints and the model is getting only 55 checkpoints and then acting like a fresh one. I tried changing some behavior parameters in the config file but it was not working.
Note: I am a beginner in unity game developing.