How can I build a track from scratch? - xTs - 10-03-2006
Hi,
it seems like i'm doing the first attempt to create a track from scratch.
So, i started with a blender model, using this Howto: http://www.geocities.com/swdoughty/blendertuteIndex.html
After step 8 i stopped, because then comes racer related stuff.
Now i exported it as JOE file with the export script from VDrift-modelpack.
Next thing was to copy the track and the textures in a directory of track-editor. ( /data/tracks/MYTRACK/objects/ )
After this i edited the "active track" variable in /data/tracks/editor.config file to fit "MYTRACK".
Then I ran the track-editor but didn't see anything, just weird messages:
Code: Error finding bezier for lap sequence in GetLapSeq(2)
Error finding bezier for lap sequence in GetLapSeq(3)
Error finding bezier for lap sequence in GetLapSeq(4)
Error finding bezier for lap sequence in GetLapSeq(5)
Error finding bezier for lap sequence in GetLapSeq(6)
Error finding bezier for lap sequence in GetLapSeq(7)
Error finding bezier for lap sequence in GetLapSeq(8)
Error finding bezier for lap sequence in GetLapSeq(0)
Error finding bezier for lap sequence in GetLapSeq(1)
Error finding bezier for lap sequence in GetLapSeq(2)
Error finding bezier for lap sequence in GetLapSeq(3)
Error finding bezier for lap sequence in GetLapSeq(4)
Error finding bezier for lap sequence in GetLapSeq(5)
Error finding bezier for lap sequence in GetLapSeq(6)
Error finding bezier for lap sequence in GetLapSeq(7)
Error finding bezier for lap sequence in GetLapSeq(8)
and so on
I tried this with the track "spa" and saw the street, without textures, just a wire frame model, but at least there was something.
My questions are:
What did i do wrong? Did i miss something? (Somebody mentioned that i have to export the track from blender as triangled model. How do I do that?)
Regards,
Matt
- joevenzon - 10-03-2006
If you don't have this already, here's how to convert a Racer track:
Code: Converting a track from RACER:
* Unzip and put racer files in temporary folder RACER_TP (temporary track path). Make sure the path has no spaces (dof2joe doesn't like spaces).
* Create new folder for track in track editor folder TRACKEDITOR_TP.
* Convert all texture names to lowercase in TRACKEDITOR_TP via "find . -type f -name \*.tga|sort -r|awk '{f=tolower($1);if(f!=$1 && p[f]!=1){print "mv "$1" "f}p[$1]=1}' | /bin/sh"
* Make folder TRACKEDITOR_TP/objects/
* Run "dof2joe/dof2joe -p TRACKEDITOR_TP/objects/ RACER_TP/*.dof". If there are thousands of .dof files, you may have to do this in steps to avoid a "too many arguments" error from your shell. This will take a while. Textures are automatically converted using nconvert. No filenames should have spaces.
* Open track editor /data/tracks/editor.config and set active track to TRACKEDITOR_TP.
* Run the track editor. Trace the roadways and mark the starting position (press H for help).
* CD to the TRACKEDITOR_TP/objects folder (this is important, the packfile stores relative paths) and run "VDrift-tracked/joepack/joepack -c objects.jpk *.joe"
* Copy TRACKEDITOR_TP into the main VDrift tracks folder VDRIFT_TP. Erase VDRIFT_TP/objects/*.joe (since they are in the pack file).
* Add your VDRIFT_TP to VDrift/data/tracks/track_list.txt
* Add VDRIFT_TP/about.txt and ensure that the first line is the name of the track.
* Open up all of the texture files in TRACKEDITOR_TP/objects and review which textures belong to objects that should be collide-able (roads and walls), have full brightness (trees), be mipmapped (fences and fine transparent objects should not be mipmapped), or be skyboxes.
* Any textures that have transparent areas are usually colored #ff00ff in the Racer textures. You'll need to make these truly transparent in the PNG files. An easy way to do this is to use ImageMagick. Use the command "mogrify -transparent rgb\(255,0,255\) file.png". This can be scripted to speed things up of course.
* Set the correct object properties using the VDrift-tracked/listedit tool (more documentation to come).
* Run VDrift and check out what the track looks like in-game. Note that you will only be able to drive on the roadways you defined in the track editor since no other surfaces have been flagged as collideable. Also take a screenshot for the track selection screen.
* Add the track selection screenshot to VDrift/gui/tracks/VDRIFT_TP.png (hopefully these png files will be moved into the folders of the individual tracks soon).
* Done!
For creating a track from scratch, it should be something like:
Code: Creating a new track from scratch:
* Model the new track in blender. Use UV texturing with one texture per objects (multiple objects can have the same texture). Objects which span a large part of the track (such as the road itself, the terrain, etc) can be broken down into separate objects to increase performance (frustum culling is done per object).
* Create new folder for track in track editor folder TRACKEDITOR_TP.
* Make folder TRACKEDITOR_TP/objects/
* Export the track objects to TRACKEDITOR_TP/objects using the .joe blender export script in the model pack. Currently you have to do this one object at a time (inconvenient, I know -- a multi-object export script needs to be written).
* Create TRACKEDITOR_TP/objects/list.txt and manually add the following: the first line should be the number of objects in the track. Then, for each object, add the following lines:
#0. model filename (without path, no spaces allowed)
#1. texture filename (without path, no spaces allowed)
#2. mipmap texture (1 for true, 0 for false)
#3. disable lighting (1 for true, 0 for false)
#4. is this a skybox? (1 for true, 0 for false)
#5. is this object a transparent blended texture? (1 for true, 0 for false)
#6. bump wavelength
#7. bump amplitude
#8. driveable (1 for true, 0 for false) -> deprecated, use collide-able flag
#9. collide-able (1 for true, 0 for false)
#10. friction coefficient for non-treaded tires
#11. friction coefficient for treaded tires
#12. rolling resistance coefficient (http://en.wikipedia.org/wiki/Rolling_friction)
#13. rolling drag
* I realize editing the list.txt file manually sucks, but eventually this will be automatically generated by the export script. There's also a tool in the listedit sub-directory of the track editor that allows for easier list.txt file editing (mentioned in a later step), but it's pretty user unfriendly.
* Open track editor /data/tracks/editor.config and set active track to TRACKEDITOR_TP.
* Run the track editor. Trace the roadways, mark the starting position, mark the starting line and one other track location (press H for help).
* CD to the TRACKEDITOR_TP/objects folder (this is important, the packfile stores relative paths) and run "VDrift-tracked/joepack/joepack -c objects.jpk *.joe"
* Copy TRACKEDITOR_TP into the main VDrift tracks folder VDRIFT_TP. Erase VDRIFT_TP/objects/*.joe if you want (since they are in the pack file).
* Add your VDRIFT_TP to VDrift/data/tracks/track_list.txt
* Add VDRIFT_TP/about.txt and ensure that the first line is the name of the track.
* Open up all of the texture files in TRACKEDITOR_TP/objects and review which textures belong to objects that should be collide-able (roads and walls), have full brightness (trees), be mipmapped (fences and fine transparent objects should not be mipmapped), or be skyboxes.
* Set the correct object properties using the VDrift-tracked/listedit tool (more documentation to come).
* Run VDrift and check out what the track looks like in-game. Note that you will only be able to drive on the roadways you defined in the track editor plus any surfaces you have flagged as collideable. Also take a screenshot for the track selection screen.
* Add the track selection screenshot to VDrift/gui/tracks/VDRIFT_TP.png (hopefully these png files will be moved into the folders of the individual tracks soon).
* Done!
- joevenzon - 10-03-2006
Also, to answer you query on IRC about force feedback (I realize it's off-topic, but I know you'll check this post), the code already generates the force feedback values, but as yet I'm not aware of a good portable API to actually get the feedback values to your steering wheel's driver.
- xTs - 10-04-2006
Ok, i added the missing list.txt to my directory, but when i run the track editor, i still get this message:
Code: Note to user: All error messages will be put in data/settings/logs/.
Suspicious numparams value: 0
Error finding bezier for lap sequence in GetLapSeq(0)
Error finding bezier for lap sequence in GetLapSeq(1)
Error finding bezier for lap sequence in GetLapSeq(2)
Error finding bezier for lap sequence in GetLapSeq(3)
Error finding bezier for lap sequence in GetLapSeq(4)
Error finding bezier for lap sequence in GetLapSeq(5)
Error finding bezier for lap sequence in GetLapSeq(6)
Error finding bezier for lap sequence in GetLapSeq(7)
Error finding bezier for lap sequence in GetLapSeq(8)
Error finding bezier for lap sequence in GetLapSeq(0)
Error finding bezier for lap sequence in GetLapSeq(1)
Error finding bezier for lap sequence in GetLapSeq(2)
Error finding bezier for lap sequence in GetLapSeq(3)
Error finding bezier for lap sequence in GetLapSeq(4)
Error finding bezier for lap sequence in GetLapSeq(5)
Error finding bezier for lap sequence in GetLapSeq(6)
Error finding bezier for lap sequence in GetLapSeq(7)
Error finding bezier for lap sequence in GetLapSeq(8)
Error finding bezier for lap sequence in GetLapSeq(0)
Error finding bezier for lap sequence in GetLapSeq(1)
Error finding bezier for lap sequence in GetLapSeq(2)
Error finding bezier for lap sequence in GetLapSeq(3)
Error finding bezier for lap sequence in GetLapSeq(4)
Error finding bezier for lap sequence in GetLapSeq(5)
Error finding bezier for lap sequence in GetLapSeq(6)
Error finding bezier for lap sequence in GetLapSeq(7)
Error finding bezier for lap sequence in GetLapSeq(8)
Error finding bezier for lap sequence in GetLapSeq(0)
Error finding bezier for lap sequence in GetLapSeq(1)
Error finding bezier for lap sequence in GetLapSeq(2)
Error finding bezier for lap sequence in GetLapSeq(3)
Error finding bezier for lap sequence in GetLapSeq(4)
Error finding bezier for lap sequence in GetLapSeq(5)
and so on
- xTs - 10-04-2006
Here's my list.txt
Code: firstroad.joe
road.png
1
0
0
0
1.0
0
0
1
1.0
0.9
1.0
0.0
- thelusiv - 10-04-2006
OK here's an example from the Spa-Francorchamps objects/list.txt:
Code: # File generated by listedit, a VDrift track editor tool
14
#entry 0
2002.dof-00.joe
numblog.bmp.png
1
0
0
0
1.0
0
0
1
1.0
0.9
1.0
0.0
Don't worry about the commented lines so much, but you will need the number preceding the object listings to tell VDrift how many objects to read out of your file. I'm thinking for this one it should be 1.
- xTs - 10-04-2006
What does the 14 mean at the beginning? This is nowhere defined.
- thelusiv - 10-04-2006
That's the number of objects in the file. VDrift will read each object from the object list file one after another until it has read that many objects.
- xTs - 10-04-2006
thanks thelusiv.
The line says how for many objects the trackeditor should look for. (aka: how many objects in the list.txt are)
- xTs - 10-04-2006
Ok, now it's time for the track editor.
But, how to use it?
i see a track, with a texture (but there are triangles, everywhere).
I can select some points, but then they create bizarre forms and not just a road.
So, do i have to select the points in a special order? And then what next?
(this thing is not very usable... so you need a good tut to use it)
- joevenzon - 10-04-2006
The track editor is a temporary fix-up until someone writes a proper one. Press H for help, that plus the info I posted above should get you started.
- xTs - 10-04-2006
Ok, for all:
The 14 at the top of the list.txt has to stay a 14. Don't touch this.
- xTs - 10-04-2006
Ok... the first thing is done, now i need some advice...
the car seems to be in the middle of nowhere, but isn't falling.
Here's my track... if you got time, please test it and tell me, what's wrong with it.
http://www.informatik.uni-frankfurt.de/~mheinz/vdrift/testroad.tar.gz
- joevenzon - 10-04-2006
Ohhh, that's right, 14 is the number of lines per entry. My bad. It automatically determines the number of objects based on the number of lines per entry.
- joevenzon - 10-04-2006
xTs, it looks like you forgot this step:
Code: * Add VDRIFT_TP/about.txt and ensure that the first line is the name of the track.
Look at the other tracks for examples of the about.txt file.
Hmm... I'm not sure how you were able to view your track in-game without this file. Are you using the 7/8 release or the latest in SVN? You should be using the latest SVN release, since the file format is different for older releases. You should use the track editor from SVN as well.
|