I know it's an older post, but some people are asking me how I did my racer game and to post it public I'm using this topic.
This was a long dialog on the forum to understand how the logic of a race game works.
First, the AI need some support to understand the path, like the actual Uber self-driving cars. So, you can do it by placing way-points (placeholders) with instance variables stored while giving the bot-driver some insights of how to drive to the next way-point.
Each waypoint have two instance variables, one called ID and another called Rank.
The racer-bot should use the car-behavior to drive to the next way-point also, you should setup it to turn toward that direction, plus, give him some variable behavior.