This is really cool that you're working on this, it's something we really need. I'm not sure about how to get the track information from the game. TORCS has a nice Robots API that provides this information to the programmer writing AI, but we have no such API.
TORCS tracks are built sort of like this. First they start as an XML file defining road segments and such. From this a 3D model of the road is generated. Then the scenery is manually added to the model. When the track is loaded, the XML is used to define the track's road segments, and this information is given to the robots. Then the track model is loaded, which the player and robots drive on.
The way VDrift tracks are built is different. We start with a fully modeled track, with scenery and surrounding objects and everything. Then we open it in our simple track editor and trace the track itself. This is saved so the game knows which parts of the model are the track and should be smooth. The game loads the track definition and interprets it as a bezier patch. Then the model is loaded much like in TORCS.
So the big difference is that in VDrift, we do not have this track definition XML file. It may be possible however to get the same information from the bezier curves which define the track. However I don't know if or exactly how this would be done...
Joe wrote the track code and could probably enlighten us on this issue. Joe, what do you think? Would it be possible to provide a TORCS-like robots API from the track data we already have? Or would we need something more?
|