Track Files Explained
Posted: Mon Dec 08, 2008 7:55 am
Here's a bit of a tutorial on the layout of track files. A few things to remember
> In track editor mode, you are looking at the x and z plane, x is horizontal, z is vertical. So, y is the height of the object.
> The aspect ratio is always x:y (so is calculated by x/y)
> Units are in 'feet'
> Rotation angles are in 'radians' (just put 0, and rotate in game)
> If you are putting the file in your track folder, 'foldername' is the name of your track folder.
> For things that can't be placed in game (like flaggers), put your mouse where you want them to be, and write down the co-ordinates that appear in the left panel in the editor. The y value in these co-ordinates is the height of the terrain. But for the following things, the y value is the height with respect to the y value of the terrain (so when y=0, the object is on the ground)
Desc
trackname
eg.
Washougal 2008
(this file is used so you don't have to use spaces or capitals in your folder name. This file has to be made yourself, it doesn't have a file extension)
Billboards
[x y z] height aspectratio @foldername/image.png
eg.
[820.000000 0.000000 10.000000] 80.00000 0.500000 @randomtown/largetree.png
Statues
[x y z] rotation @foldername/object.jm @foldername/skin.png @foldername/shape.shp
eg.
[1401.199341 0.000000 1143.900757] 2.838703 @djsobjectpk1/teamtent.jm @djsobjectpk1/suzukitent.ppm @djsobjectpk1/teamtent.shp
Add _lod# to the name for the lower detail levels, where # is the base 2 log of the distance it will be used at.
E.g.
tree.jm < 2 feet
tree_lod1.jm 2-4 feet
tree_lod2.jm 4-8 feet
tree_lod3.jm 8-16 feet
tree_lod4.jm 16-32 feet
tree_lod5.jm 32-64 feet
tree_lod6.jm 64-128 feet
tree_lod7.jm 128-256 feet
tree_lod8.jm 256-512 feet
tree_lod9.jm > 512 feet
If an lod is missing it will use the next higher lod.
Decals
[x z] rotation scale aspectratio @foldername/decal.png
eg.
[1215.841431 1044.001099] 2.955113 32.000000 1.100000 @washougal2008/trackdirt.png
______________________________________________________________________________________________________
Flaggers
There are 3 parts in the original file.
Top part
This is for the start runner
You only have to pay attention to the first 2 lines. The first line is where the runner starts, the 2nd line is where he finishes.
eg.
[1975.000000 0.000000 1294.000000] (Start)
[1975.000000 0.000000 1397.000000] (Finish)
8.4 1 (Ignore)
12
@30sec_30.png
@30sec_turn.seq
@30sec_5.png
@30sec_run.seq
@30sec_done.png (Ignore)
Middle part
This is for the finish line flagger.
[450 0.0 2000] (Location of flagger)
8 -1 (Ignore)
@finish_green.png
@finish_crossed.png
@finish_white.png
@checkerwave.seq (Ignore)
Last part
This is for the track marshalls (ie people who wave yellow flags etc). You can put as many of these in as you like, just copy this part thats in the file and paste it a few times.
[1174.52 0.00 1032.30] (Location)
9.6 1 (Ignore)
1 2 -1 -1 (The timing gates the flagger waves for. Can handle 4 gates. -1 is used if you want less than 4 gates)
@flagger_resting.png (Ignore)
@flagger_waving.seq (Ignore)
______________________________________________________________________________________________________
Timing_Gates
startinggate
Write down the start and end co-ordinates of a line of gates you would like, but only the X and Z co-ordinates (ie the 1st and 3rd number). Put the co-ordinates into this, then copy and paste what is outputed under 'startinggate:'
http://www.mxsimulator.com/gate.html
checkpoints
Done in game. If you need to add more, copy and paste some lines from an untouched timing_gate file into this.
firstlap
Order of timing gates you need to take to complete the first lap
normallap
Order of timing gates you need to take to complete a normal lap
______________________________________________________________________________________________________
Texturelist
Not so important what you do with this because of the new texture system. But is handy for changing frictional and resistance numbers (so you can add mud and sand)
friction lowspeedresistance highspeedresistance foldername/image.ppm
eg.
1 20 50 grass.ppm
Terrain.hf
resolution scale minaltitude maxaltitude
eg.
9 2.000000 -5.146564 48.516369
'resolution' specifies the size of the terrain.png and shading.ppm you are using. The formula is 2^(n+1)+1. So 2^(9+1)+1=1025, hence standard tracks use 1025x1025 pixel terrains.
'scale' is in feet/pixel, so standard tracks are 2 feet/pixel.
______________________________________________________________________________________________________
Lighting
Standard stuff
sun_vector [ 1.00 1.00 1.00 ] (Vector of the sun, [x y z])
sun_color [ 1.00 1.00 0.50 ] (Floating-point colour value, [Red Green Blue]. Equivalent to RGB values in photoshop divided by 255)
ambient [ 0.25 0.25 0.50 ] (Ditto)
Skybox
sky_x @foldername/image_x.png (x is first letter of direction, eg x=n if north. x=u for up)
eg.
sky_n @oldgoldberry/sky_north.png
sky_env @foldername/image.png (used for reflections)
Fog
fog [red green blue] density
eg.
fog [0.56 0.64 0.35] 0.0032
Flare
flare_elements must be added first, then either flare_point or flare_vector is added underneath
flare_element [x y] [red green blue] size @foldername/image.png (size should be ~1. x=0, y=0 flare is centre of screen, x=0, y=1 flare is on vector. Black in image represents transparency)
flare_vector [x y z] (self explanatory, if sun flare, same as sun_vector)
flare_point [x y z] (location on terrain of flare. Very tedious, as it needs a white pixel behind it to work)
eg.
flare_element [0 1] [1 1 1] 0.8 @mainflare.png
flare_element [0 1] [0.62 0.45 0.24] 0.4 @light.png
flare_vector [1 1 1]
______________________________________________________________________________________________________
Feel free to ask questions!
> In track editor mode, you are looking at the x and z plane, x is horizontal, z is vertical. So, y is the height of the object.
> The aspect ratio is always x:y (so is calculated by x/y)
> Units are in 'feet'
> Rotation angles are in 'radians' (just put 0, and rotate in game)
> If you are putting the file in your track folder, 'foldername' is the name of your track folder.
> For things that can't be placed in game (like flaggers), put your mouse where you want them to be, and write down the co-ordinates that appear in the left panel in the editor. The y value in these co-ordinates is the height of the terrain. But for the following things, the y value is the height with respect to the y value of the terrain (so when y=0, the object is on the ground)
Desc
trackname
eg.
Washougal 2008
(this file is used so you don't have to use spaces or capitals in your folder name. This file has to be made yourself, it doesn't have a file extension)
Billboards
[x y z] height aspectratio @foldername/image.png
eg.
[820.000000 0.000000 10.000000] 80.00000 0.500000 @randomtown/largetree.png
Statues
[x y z] rotation @foldername/object.jm @foldername/skin.png @foldername/shape.shp
eg.
[1401.199341 0.000000 1143.900757] 2.838703 @djsobjectpk1/teamtent.jm @djsobjectpk1/suzukitent.ppm @djsobjectpk1/teamtent.shp
Add _lod# to the name for the lower detail levels, where # is the base 2 log of the distance it will be used at.
E.g.
tree.jm < 2 feet
tree_lod1.jm 2-4 feet
tree_lod2.jm 4-8 feet
tree_lod3.jm 8-16 feet
tree_lod4.jm 16-32 feet
tree_lod5.jm 32-64 feet
tree_lod6.jm 64-128 feet
tree_lod7.jm 128-256 feet
tree_lod8.jm 256-512 feet
tree_lod9.jm > 512 feet
If an lod is missing it will use the next higher lod.
Decals
[x z] rotation scale aspectratio @foldername/decal.png
eg.
[1215.841431 1044.001099] 2.955113 32.000000 1.100000 @washougal2008/trackdirt.png
______________________________________________________________________________________________________
Flaggers
There are 3 parts in the original file.
Top part
This is for the start runner
You only have to pay attention to the first 2 lines. The first line is where the runner starts, the 2nd line is where he finishes.
eg.
[1975.000000 0.000000 1294.000000] (Start)
[1975.000000 0.000000 1397.000000] (Finish)
8.4 1 (Ignore)
12
@30sec_30.png
@30sec_turn.seq
@30sec_5.png
@30sec_run.seq
@30sec_done.png (Ignore)
Middle part
This is for the finish line flagger.
[450 0.0 2000] (Location of flagger)
8 -1 (Ignore)
@finish_green.png
@finish_crossed.png
@finish_white.png
@checkerwave.seq (Ignore)
Last part
This is for the track marshalls (ie people who wave yellow flags etc). You can put as many of these in as you like, just copy this part thats in the file and paste it a few times.
[1174.52 0.00 1032.30] (Location)
9.6 1 (Ignore)
1 2 -1 -1 (The timing gates the flagger waves for. Can handle 4 gates. -1 is used if you want less than 4 gates)
@flagger_resting.png (Ignore)
@flagger_waving.seq (Ignore)
______________________________________________________________________________________________________
Timing_Gates
startinggate
Write down the start and end co-ordinates of a line of gates you would like, but only the X and Z co-ordinates (ie the 1st and 3rd number). Put the co-ordinates into this, then copy and paste what is outputed under 'startinggate:'
http://www.mxsimulator.com/gate.html
checkpoints
Done in game. If you need to add more, copy and paste some lines from an untouched timing_gate file into this.
firstlap
Order of timing gates you need to take to complete the first lap
normallap
Order of timing gates you need to take to complete a normal lap
______________________________________________________________________________________________________
Texturelist
Not so important what you do with this because of the new texture system. But is handy for changing frictional and resistance numbers (so you can add mud and sand)
friction lowspeedresistance highspeedresistance foldername/image.ppm
eg.
1 20 50 grass.ppm
Terrain.hf
resolution scale minaltitude maxaltitude
eg.
9 2.000000 -5.146564 48.516369
'resolution' specifies the size of the terrain.png and shading.ppm you are using. The formula is 2^(n+1)+1. So 2^(9+1)+1=1025, hence standard tracks use 1025x1025 pixel terrains.
'scale' is in feet/pixel, so standard tracks are 2 feet/pixel.
______________________________________________________________________________________________________
Lighting
Standard stuff
sun_vector [ 1.00 1.00 1.00 ] (Vector of the sun, [x y z])
sun_color [ 1.00 1.00 0.50 ] (Floating-point colour value, [Red Green Blue]. Equivalent to RGB values in photoshop divided by 255)
ambient [ 0.25 0.25 0.50 ] (Ditto)
Skybox
sky_x @foldername/image_x.png (x is first letter of direction, eg x=n if north. x=u for up)
eg.
sky_n @oldgoldberry/sky_north.png
sky_env @foldername/image.png (used for reflections)
Fog
fog [red green blue] density
eg.
fog [0.56 0.64 0.35] 0.0032
Flare
flare_elements must be added first, then either flare_point or flare_vector is added underneath
flare_element [x y] [red green blue] size @foldername/image.png (size should be ~1. x=0, y=0 flare is centre of screen, x=0, y=1 flare is on vector. Black in image represents transparency)
flare_vector [x y z] (self explanatory, if sun flare, same as sun_vector)
flare_point [x y z] (location on terrain of flare. Very tedious, as it needs a white pixel behind it to work)
eg.
flare_element [0 1] [1 1 1] 0.8 @mainflare.png
flare_element [0 1] [0.62 0.45 0.24] 0.4 @light.png
flare_vector [1 1 1]
______________________________________________________________________________________________________
Feel free to ask questions!