Difference between revisions of "MXB Track Creations Guide"

From PiBoSo Documentation
Jump to navigation Jump to search
Line 19: Line 19:
  layer0
  layer0
  (
  (
  '''map''' = mud.tga ''(for example, the base terrain texture name)''
  '''map''' = track.tga ''(for example, the base terrain texture name)''
  '''repititions''' = 50 ''(texture tiling)''
  '''repetitions''' = 1 ''(texture tiling)''
  }
  }
   
   
Line 26: Line 26:
  {
  {
  '''map''' = grass.tga ''(second texure layer name)''
  '''map''' = grass.tga ''(second texure layer name)''
  '''repititions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''
  '''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''
  '''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''
  '''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''
   
   
Line 53: Line 53:
  scene0 ''(here you add the scenery model)''
  scene0 ''(here you add the scenery model)''
  {
  {
  name = scenery.edf ''(name of the scenery model file)''
  '''name''' = scenery.edf ''(name of the scenery model file)''
  pos ''(use these values to change the position and rotation of the scenery)''
  '''pos''' ''(use these values to change the position and rotation of the scenery)''
  {
  {
  x = 0
  x = 0
Line 60: Line 60:
  z = 0
  z = 0
  }
  }
  rot
  '''rot'''
  {
  {
  x = 0
  x = 0
Line 83: Line 83:
  '''shininess''' = 12 ''(sharpness of the specular highlight)''
  '''shininess''' = 12 ''(sharpness of the specular highlight)''
  }
  }


==Exporting==
==Exporting==
You need to generate a .map (graphics) file and a .trh (collisions) file.
You need to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.
Shadows are generated automatically during the .map export.
===params.ini===
===params.ini===
Here you can change light / shadows settings.
Here you can change light / shadows settings.
  [params]
  [params]
  lightdir_x = 2 ''(position of the sun east)''
  '''lightdir_x''' = 2 ''(position of the sun east)''
  lightdir_y = 10 ''(position of the sun up [can be left at 10 usually])''
  '''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''
  lightdir_z = -7 ''(position of th sun north)''
  '''lightdir_z''' = -7 ''(position of th sun north)''
  shadowvolumes_create = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)''  
  '''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)''  
  shadowvolumes_supersampling = 4 ''(quality of the shadow volumes, can usually be left at 4)''
  '''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''
  shadowmaps_create = 1 ''(enable shadows generation, turn off for faster exports for testing)''  
  '''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)''  
  shadowmaps_scale = 0.2 ''(texels per meter. Can usually be left at 0.2)''
  '''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''
  shadowmaps_supersampling = 4 ''(quality of the shadows, reduce for faster exports)''
  '''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''


*Run '''map.bat''' to generate a track.map file
*Run '''map.bat''' to generate a track.map file
Line 110: Line 110:
*You can also place marshals and replay cameras.
*You can also place marshals and replay cameras.
*For instructions on using TrackEd, go here: [[TrackEd]]
*For instructions on using TrackEd, go here: [[TrackEd]]
==Extra Files==
*If desired, you can adjust the sun position & colour, fog amount & colour, and ambient light colour, for all conditions. Open the .amb file in notepad, and use [[Map_Viewer]] to see the changes. Please note that you should use the same settings for the sun direction in the amb file and the params.ini file.
*You should edit the .ini file to change the track name, author, location etc.
*Update the track.tga screenshot and the track_map.tga.
*Use the skies provided, or create new skydomes.
==Packing==
:All final track files should go in a folder of the same name.
:For example, mytrack/
You should have the following files in the folder:
mytrack.map ''(track graphics)''
mytrack.trh ''(track collision)''
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''
mytrack.ini ''(track information)''
mytrack.tsc ''(trackside cameras)''
mytrack.amb ''(lighting and environment settings)''
mytrack_map.tga ''(map of the track for the UI)''
mytrack.tga ''(screenshot of the track for the UI)''
clearsky.edf ''(sunny skydome)''
cloudysky.edf ''(cloudy skydome)''
rainysky.edf ''(rainy skydome'')
Copy this folder to your mxbikes/tracks folder to test it (you have to create the tracks folder manually)
For distribution, you can zip up the folder and rename the zip file to .pkz. The folder must be zipped, not just the files.

Revision as of 17:55, 24 March 2014

Download the example track

Heightmap

Heightmap must be 16bpp 2049x2049 IBM RAW.
1025x1025 & 4097x4097 are also supported.

Track Data files

track.hmf

samples_x = 2049 (RAW image width)
samples_y = 2049 (RAW image height)
data = heightmap.raw (RAW image filename)

size_x = 480 (track size in meters)
size_z = 480 (track size in meters)
scale = 3.2 (total track height in meters)

num_layers = 2 (number of texture layers)

layer0
(
map = track.tga (for example, the base terrain texture name)
repetitions = 1 (texture tiling)
}

layer1
{
map = grass.tga (second texure layer name)
repetitions = 50 (if you are using a shader for this texture, this value should match the one in the .shd file)
mask = grass_mask.tga (the alpha channel will be a mask that shows / hides this layer)

grass (enables 3d grass for this layer)
 {
 max_density = 8
 height = 0.15
 height_diff = 0.1 (randomise the grass height by this much)
 width = 0.2
 width_diff = 0.1 (randomise the grass width by this much)
 texture = grassfx.tga (this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)
 densitymap = mask.tga (alpha channel controls the grass density)
 }
}

track.tht

samples_x = 2049 (must be the same as value in .hmf file)
samples_z = 2049 (must be the same as value in .hmf file)

data = heightmap.raw (must be the same as value in .hmf file)

size_x = 480 (must be the same as value in .hmf file)
size_z = 480 (must be the same as value in .hmf file)
scale = 3.2 (must be the same as value in .hmf file)

scene0 (here you add the scenery model)
{
name = scenery.edf (name of the scenery model file)
pos (use these values to change the position and rotation of the scenery)
	{
	x = 0
	y = 0
	z = 0
	}
rot
	{
	x = 0
	y = 0
	z = 0
	}
}

Terrain Textures & Shaders

Textures must be power of 2 (256, 512, 1024, 2048, 4096)

SHD files

These allow you to use specular & normal maps. Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)

bump
{
map = mud_n.tga (normal map filename, specular level should be in alpha channel)
repetitions = 46 (must be the same as the value for this texture layer in the .hmf file)
}

specular
{
shininess = 12 (sharpness of the specular highlight)
}

Exporting

You need to generate a .map (graphics) file and a .trh (collisions) file. Shadows are generated automatically during the .map export.

params.ini

Here you can change light / shadows settings.

[params]
lightdir_x = 2 (position of the sun east)
lightdir_y = 10 (position of the sun up [can be left at 10 usually])
lightdir_z = -7 (position of th sun north)
shadowvolumes_create = 1 (enable shadow volumes generation, turn off for faster exports for testing) 
shadowvolumes_supersampling = 4 (quality of the shadow volumes, can usually be left at 4)
shadowmaps_create = 1 (enable shadows generation, turn off for faster exports for testing) 
shadowmaps_scale = 0.2 (can usually be left at 0.2)
shadowmaps_supersampling = 4 (quality of the shadow volumes, reduce for faster exports)
  • Run map.bat to generate a track.map file
  • Run trh.bat to generate a track.trh file

Rename these files to your chosen track name.

TrackEd

  • Open your .trh file in tracked.
  • You will need to create a centerline, merge it, and then save the trh.
  • You must place the pits, starting gates, finish line, and pitboards.
  • You can also place marshals and replay cameras.
  • For instructions on using TrackEd, go here: TrackEd

Extra Files

  • If desired, you can adjust the sun position & colour, fog amount & colour, and ambient light colour, for all conditions. Open the .amb file in notepad, and use Map_Viewer to see the changes. Please note that you should use the same settings for the sun direction in the amb file and the params.ini file.
  • You should edit the .ini file to change the track name, author, location etc.
  • Update the track.tga screenshot and the track_map.tga.
  • Use the skies provided, or create new skydomes.

Packing

All final track files should go in a folder of the same name.
For example, mytrack/

You should have the following files in the folder:

mytrack.map (track graphics)
mytrack.trh (track collision)
mytrack.rdf (race data - pits, startgates, finishline etc.)
mytrack.ini (track information)
mytrack.tsc (trackside cameras)
mytrack.amb (lighting and environment settings)
mytrack_map.tga (map of the track for the UI)
mytrack.tga (screenshot of the track for the UI)
clearsky.edf (sunny skydome)
cloudysky.edf (cloudy skydome)
rainysky.edf (rainy skydome)

Copy this folder to your mxbikes/tracks folder to test it (you have to create the tracks folder manually) For distribution, you can zip up the folder and rename the zip file to .pkz. The folder must be zipped, not just the files.