02-21-2007, 07:37 PM,
|
|
pwp71
Member
|
Posts: 105
Threads: 15
Joined: Nov 2006
|
|
Reverse Tracks
What do you think to drive in some circuits like dijon(very funny) pau, weekend and some
others on the contrary way?
So, we have a more circuits with few work (I hope).
We can insert in the track.txt file one attribute like reverse true/false
and below give new start position and start directions, etc.
Another solution is add another file like trackr.txt with reverse info.
Give me your feedback ( but before drive a little bit with reverse dijon )
pwp71
|
|
02-22-2007, 01:30 AM,
|
|
thelusiv
Administrator
|
Posts: 2,346
Threads: 223
Joined: Jun 2005
|
|
This would be pretty simple to code up. If someone takes the time with the tracks, and creates backwards starting points and a backwards track sequence for them, someone will code it. However to really support such a feature, sort of like any of our track features, it must be retro-fitted onto our old tracks.
So is someone willing to go through and make reversed versions of all our tracks? If so, I'll gladly throw a "Reverse track" option on the start game menus.
To make a track backwards, just open it in the editor as if it's a new import, then re-trace the track in reverse, and set new starting points. Save the file and then add it to VDrift SVN under the data/tracks/track_name/roads.reverse.trk. I think we'll also need a track.reverse.txt for each of these. Post here if you add some, and we'll make them work.
|
|
02-22-2007, 04:46 PM,
|
|
pwp71
Member
|
Posts: 105
Threads: 15
Joined: Nov 2006
|
|
After I'll finish to update start positions, I should try to create reverse tracks.
Someone could create "Reverse track" option on the start game menus?
pwp71
|
|
02-23-2007, 09:12 AM,
|
|
rookie1
Member
|
Posts: 231
Threads: 32
Joined: Nov 2006
|
|
The AI driver does rely on the patch sequence. So if you want to race against AI in reverse direction, we will need to reverse the patch sequence. Since the patch sequence is just a linked list, another way would be to change the code in track.cpp to create another linked list in reverse order.
|
|
02-25-2007, 12:10 AM,
|
|
rookie1
Member
|
Posts: 231
Threads: 32
Joined: Nov 2006
|
|
The lap counter increases when the car pass through timing sector 0. In the track reverse code, the timing sectors are also reversed. So the last timing sector in the original track becomes the new sector 0. This causes the lap counter to increase at the wrong place.
Car position depends on the relative distance from the starting line (timing sector 0) to the current patch. These are calculated during track loading, in BEZIER::Attach() and TRACK::Load(). I guess when the track is reversed, the relative distance is not recalculated. The position display become reversed as a result.
|
|
02-26-2007, 11:16 AM,
|
|
rookie1
Member
|
Posts: 231
Threads: 32
Joined: Nov 2006
|
|
I think we need one more change in BEZIER::Attach(), that is to reverse the sequence of the 4 corner points. This is because the car's relative distance from starting line is calculated as follows (you can look at Vamos_World::World::update_race_position() for the details),
car's distance from starting line = current patch's distance from starting line + car's distance from the beginning of current patch
Code: |<------ a ----->|<---- b ---->|
.................+--------------------------+
| |
| |
|-------------* |
| |
.................+--------------------------+
a = current patch's distance from starting line
b = car's distance from the beginning of current patch
* is the car
The beginning of current patch is the straight line formed by points[3][0] and points[3][3] of the patch. In a reversed track, it should be the line formed by the other 2 corner points.
I hope the above makes sense.
|
|
|