yeah, you could use splines or checkpoints. a spline would probably be a bit easier to tweak.
basically add a spline across the track and periodically have the ai see what place they are in by referencing their distance along the spline. if they are doing laps then you’d have to add an int variable to the cars to count laps.
(current distance on splinecurrent lap)/ (spline lengthTotal Laps) = percentage of race completed
then have each car ai compare the the percentage of whoever is in first with their own position and give them some extra speed based on that.
Splines could get pretty complex if you have a track with a bunch of branches paths since you’d have to use multiple splines. So long as any branches on the racetrack are generally going in the same direction though you can just put the spline in the average location and it should would reasonably well.
you could give cars a boost based on the distance behind the players in the lead instead of the percentage, might be easier to work with if you have a bunch of different track sizes. you could also project the estimated time it will take the ai to finish the course so if the human finishes all the ai times can be filled in right away without having the player wait for em.