https://docs.piboso.com/wiki/api.php?action=feedcontributions&user=PiBoSo&feedformat=atomPiBoSo Documentation - User contributions [en]2024-03-29T12:51:52ZUser contributionsMediaWiki 1.36.1https://docs.piboso.com/wiki/index.php?title=Main_Page&diff=179Main Page2021-09-28T20:20:15Z<p>PiBoSo: </p>
<hr />
<div>__NOTOC__<br />
==User Manuals==<br />
<br />
===[[Kart Racing Pro]]===<br />
===[[GP Bikes]]===<br />
===[[World Racing Series]]===<br />
===[[MX Bikes]]===<br />
<br />
==Modding Guides==<br />
===[[Track Creation Guide]]===<br />
===[[MXB Track Creation Guide]]===<br />
===[[Bike Creation Guide]]===<br />
===[[Helmet Creation Guide]]===<br />
<br />
==Tools Manuals==<br />
===[[FBX2EDF]]===<br />
===[[TrackEd]]===<br />
===[[MapView]]===<br />
<!--===[[Track Tools]]===(this section is not needed now)--><br />
===[[PaintEd]]===<br />
===[[Dedicated Server]]===<br />
<!--===[[BikeEd]]===<br />
===[[Dash]]===--><br />
===[[Tyres]]===<br />
<br />
==Tools & Resources Downloads==<br />
====[http://www.kartracing-pro.com/downloads/ct.zip FBX2EDF, 3dsmax plugins]====<br />
====[http://www.kartracing-pro.com/downloads/tt.zip MapView, TerrainEd, TrackEd]====<br />
====[http://www.kartracing-pro.com/downloads/painted.zip PaintEd]====<br />
====[http://mx-bikes.com/downloads/templates.zip MXB Bike & Rider templates]====<br />
====[http://gp-bikes.com/downloads/gpb_templates.zip GPB Bike & Rider templates]====<br />
====[http://kartracing-pro.com/downloads/krp_templates.zip KRP Kart & Driver templates]====<br />
====[http://www.worldracingseries.net/downloads/wrs_templates.zip WRS Cars & Drivers templates]====<br />
====[http://www.kartracing-pro.com/downloads/track_lights.zip Track startlights and pit lights templates]====</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MapView&diff=176MapView2021-08-12T11:17:39Z<p>PiBoSo: </p>
<hr />
<div>==Controls==<br />
<br />
:'''Right CTRL key''' : Mouse Look (hold down)<br />
:'''Arrow Keys''' : Move Camera<br />
:'''Mouse Wheel''' : Change Movement Speed<br />
:'''F9''' : Grab a Cubic Screenshot. Saved under "env" directory.<br />
:'''F11''' : Grab Screenshot. Saved under "scrshots" directory.<br />
<br />
==mapview.ini==<br />
<br />
[gfx]<br />
width = 800<br />
height = 600<br />
maximized = 0<br />
multisample = 0<br />
anisotropic = 0<br />
<br />
[navigation]<br />
fov = 60<br />
pos = 0, 0, 0 ; to set the camera start position<br />
rot = 0, 0, 0 ; to set the camera start rotation ( yaw, pitch, roll )<br />
<br />
[shared]<br />
skies=c:\mxbikes\misc\skies\<br />
flags=c:\mxbikes\misc\flags\<br />
<br />
[load]<br />
reload_last = 1 ; to reload the latest file at start<br />
<br />
[env]<br />
width = 256<br />
height = 256</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=175MXB Track Creation Guide2021-01-19T17:47:46Z<p>PiBoSo: /* SHD files */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
====Surface Layers====<br />
These are used to define areas for the offtrack, pits, and start areas.<br />
*'''surface = off''': Defines the offtrack areas and is used to calculate the correct long reset lines. Be sure that the offtrack area encompasses all trackside collision objects in order to prevent players from getting stuck inside them after a long-reset.<br />
*'''surface = pits''': Not strictly necessary, but will reset riders to their pit spot when inside. Also allows for pits camera set. See TrackEd trackside cameras [[TrackEd#Trackside_Cameras|Surface_Params]]<br />
*'''surface = start''': Also not strictly necessary, but allows for custom start area camera set. See TrackEd trackside cameras [[TrackEd#Trackside_Cameras|Surface_Params]]<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 0<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that repetitions for the normal map can be manually set here. A setting of 0 will match it with the repetitions in the hmf file, which is usually desired.<br/><br />
Setting repetitions to 1, for example, is useful for having a normal map that covers the entire terrain.<br/><br />
If "repetitions" is missing it is automatically set to 1.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===Soft Objects===<br />
'Soft' objects allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
*'''SOFTBPLAS'''<br />
*'''SOFTCPLAS'''<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
*In the INI file it is possible to set a paint ( located in the track folder ), for example to change the billboards textures, different for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
if no file is set, "default.pnt" is automatically loaded, if it exists.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=174MXB Track Creation Guide2021-01-19T14:19:53Z<p>PiBoSo: /* Track Data files */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
====Surface Layers====<br />
These are used to define areas for the offtrack, pits, and start areas.<br />
*'''surface = off''': Defines the offtrack areas and is used to calculate the correct long reset lines. Be sure that the offtrack area encompasses all trackside collision objects in order to prevent players from getting stuck inside them after a long-reset.<br />
*'''surface = pits''': Not strictly necessary, but will reset riders to their pit spot when inside. Also allows for pits camera set. See TrackEd trackside cameras [[TrackEd#Trackside_Cameras|Surface_Params]]<br />
*'''surface = start''': Also not strictly necessary, but allows for custom start area camera set. See TrackEd trackside cameras [[TrackEd#Trackside_Cameras|Surface_Params]]<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===Soft Objects===<br />
'Soft' objects allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
*'''SOFTBPLAS'''<br />
*'''SOFTCPLAS'''<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
*In the INI file it is possible to set a paint ( located in the track folder ), for example to change the billboards textures, different for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
if no file is set, "default.pnt" is automatically loaded, if it exists.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=173Track Creation Guide2020-12-28T17:29:45Z<p>PiBoSo: </p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
===Soft Objects===<br />
'Soft' objects allow the vehicle to pass through but offer some resistance.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
*'''SOFTBPLAS'''<br />
*'''SOFTCPLAS'''<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
===Transparent Textures===<br />
Textures with alpha channels will appear transparent.<br />
Alpha channels with only 2 values (0 and 255) are automatically treated as color-key. It's also possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
===Shading===<br />
Trees leafs should have the '''TREE''' string inside the name (eg: CK_TREE.TGA); this will give the leaves less harsh shading and appear more natural.<br />
<br />
The same constant shading can be achieved also using the '''CONSTS_''' string in the name that, unlike "TREE", works for movable models, too ( eg. the background ).<br />
<br />
To disable shading, '''NOLIGHTING''' must be added to the texture name.<br />
<br />
===Tyre Mark Overlay===<br />
For tyre marks, a second texture can be defined using Opacity channel (in Blender: Alpha) and a secondary UV mapping.<br />
Textures without an alpha channel will be drawn with multiply blending (good for tyre marks and baked AO), while ones with an alpha channel will be drawn with alpha blending.<br />
<br />
If using [[FBX2EDF]], the second UV channel must be named the same as the overlay texture. For instance in Blender:<br />
<br />
[[File:blender_uv_channels.jpg]]<br />
<br />
===Wet Track Reflections===<br />
For rain puddles (track reflections) a third texture can be set in the Specular channel, and a secondary UV mapping. The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
===FLG files===<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
clampu = 1 ; disables repetitions along U direction<br />
clampv = 1 ; disables repetitions along V direction<br />
nocompress = 1 ; the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
===Specular Maps===<br />
Specular map '''must be in alpha channel of normal map'''. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
<br />
===Normal Maps===<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
<br />
It's possible to set the normal map tiling by setting '''repetitions''':<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
repetitions = 10<br />
}<br />
<br />
<br />
===Reflections===<br />
Realtime reflections are not supported on tracks. However, you can use a static cubic reflection map:<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
"Add" reflections are useful for more natural, non-metallic fresnel reflections (for example, plastic or painted surfaces).<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Like specular, reflection maps only use the alpha channel.<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
==Track Paints==<br />
<br />
In the INI file it is possible to set a paint ( located in the track folder ), for example to change the billboards textures, different for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
If no paint is set, "default.pnt" is automatically loaded, if it exists.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=172MXB Track Creation Guide2020-12-28T17:29:37Z<p>PiBoSo: /* Other Files */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===Soft Objects===<br />
'Soft' objects allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
*'''SOFTBPLAS'''<br />
*'''SOFTCPLAS'''<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
*In the INI file it is possible to set a paint ( located in the track folder ), for example to change the billboards textures, different for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
if no file is set, "default.pnt" is automatically loaded, if it exists.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=171MXB Track Creation Guide2020-12-28T15:15:23Z<p>PiBoSo: /* Soft Objects */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===Soft Objects===<br />
'Soft' objects allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
*'''SOFTBPLAS'''<br />
*'''SOFTCPLAS'''<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
*In the INI file it is possible to set a paint, for example to change the billboards textures, different for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
if no file is set, "default.pnt" is automatically loaded.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=170Track Creation Guide2020-12-28T15:15:11Z<p>PiBoSo: /* Soft Objects */</p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
===Soft Objects===<br />
'Soft' objects allow the vehicle to pass through but offer some resistance.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
*'''SOFTBPLAS'''<br />
*'''SOFTCPLAS'''<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
===Transparent Textures===<br />
Textures with alpha channels will appear transparent.<br />
Alpha channels with only 2 values (0 and 255) are automatically treated as color-key. It's also possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
===Shading===<br />
Trees leafs should have the '''TREE''' string inside the name (eg: CK_TREE.TGA); this will give the leaves less harsh shading and appear more natural.<br />
<br />
The same constant shading can be achieved also using the '''CONSTS_''' string in the name that, unlike "TREE", works for movable models, too ( eg. the background ).<br />
<br />
To disable shading, '''NOLIGHTING''' must be added to the texture name.<br />
<br />
===Tyre Mark Overlay===<br />
For tyre marks, a second texture can be defined using Opacity channel (in Blender: Alpha) and a secondary UV mapping.<br />
Textures without an alpha channel will be drawn with multiply blending (good for tyre marks and baked AO), while ones with an alpha channel will be drawn with alpha blending.<br />
<br />
If using [[FBX2EDF]], the second UV channel must be named the same as the overlay texture. For instance in Blender:<br />
<br />
[[File:blender_uv_channels.jpg]]<br />
<br />
===Wet Track Reflections===<br />
For rain puddles (track reflections) a third texture can be set in the Specular channel, and a secondary UV mapping. The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
===FLG files===<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
clampu = 1 ; disables repetitions along U direction<br />
clampv = 1 ; disables repetitions along V direction<br />
nocompress = 1 ; the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
===Specular Maps===<br />
Specular map '''must be in alpha channel of normal map'''. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
<br />
===Normal Maps===<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
<br />
It's possible to set the normal map tiling by setting '''repetitions''':<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
repetitions = 10<br />
}<br />
<br />
<br />
===Reflections===<br />
Realtime reflections are not supported on tracks. However, you can use a static cubic reflection map:<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
"Add" reflections are useful for more natural, non-metallic fresnel reflections (for example, plastic or painted surfaces).<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Like specular, reflection maps only use the alpha channel.<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=169Track Creation Guide2020-12-28T14:58:42Z<p>PiBoSo: /* SOFT OBJECTS */</p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
===Soft Objects===<br />
'Soft' object allow the vehicle to pass through but offer some resistance.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
*'''SOFTBPLAS'''<br />
*'''SOFTCPLAS'''<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
===Transparent Textures===<br />
Textures with alpha channels will appear transparent.<br />
Alpha channels with only 2 values (0 and 255) are automatically treated as color-key. It's also possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
===Shading===<br />
Trees leafs should have the '''TREE''' string inside the name (eg: CK_TREE.TGA); this will give the leaves less harsh shading and appear more natural.<br />
<br />
The same constant shading can be achieved also using the '''CONSTS_''' string in the name that, unlike "TREE", works for movable models, too ( eg. the background ).<br />
<br />
To disable shading, '''NOLIGHTING''' must be added to the texture name.<br />
<br />
===Tyre Mark Overlay===<br />
For tyre marks, a second texture can be defined using Opacity channel (in Blender: Alpha) and a secondary UV mapping.<br />
Textures without an alpha channel will be drawn with multiply blending (good for tyre marks and baked AO), while ones with an alpha channel will be drawn with alpha blending.<br />
<br />
If using [[FBX2EDF]], the second UV channel must be named the same as the overlay texture. For instance in Blender:<br />
<br />
[[File:blender_uv_channels.jpg]]<br />
<br />
===Wet Track Reflections===<br />
For rain puddles (track reflections) a third texture can be set in the Specular channel, and a secondary UV mapping. The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
===FLG files===<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
clampu = 1 ; disables repetitions along U direction<br />
clampv = 1 ; disables repetitions along V direction<br />
nocompress = 1 ; the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
===Specular Maps===<br />
Specular map '''must be in alpha channel of normal map'''. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
<br />
===Normal Maps===<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
<br />
It's possible to set the normal map tiling by setting '''repetitions''':<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
repetitions = 10<br />
}<br />
<br />
<br />
===Reflections===<br />
Realtime reflections are not supported on tracks. However, you can use a static cubic reflection map:<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
"Add" reflections are useful for more natural, non-metallic fresnel reflections (for example, plastic or painted surfaces).<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Like specular, reflection maps only use the alpha channel.<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=168MXB Track Creation Guide2020-12-28T14:57:39Z<p>PiBoSo: /* SOFT OBJECTS */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===Soft Objects===<br />
'Soft' object allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
*'''SOFTBPLAS'''<br />
*'''SOFTCPLAS'''<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
*In the INI file it is possible to set a paint, for example to change the billboards textures, different for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
if no file is set, "default.pnt" is automatically loaded.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=167Track Creation Guide2020-12-28T13:13:31Z<p>PiBoSo: /* Naming */</p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
===SOFT OBJECTS===<br />
'Soft' object allow the vehicle to pass through but offer some resistance.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
*'''SOFTBPLAS'''<br />
*'''SOFTCPLAS'''<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
===Transparent Textures===<br />
Textures with alpha channels will appear transparent.<br />
Alpha channels with only 2 values (0 and 255) are automatically treated as color-key. It's also possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
===Shading===<br />
Trees leafs should have the '''TREE''' string inside the name (eg: CK_TREE.TGA); this will give the leaves less harsh shading and appear more natural.<br />
<br />
The same constant shading can be achieved also using the '''CONSTS_''' string in the name that, unlike "TREE", works for movable models, too ( eg. the background ).<br />
<br />
To disable shading, '''NOLIGHTING''' must be added to the texture name.<br />
<br />
===Tyre Mark Overlay===<br />
For tyre marks, a second texture can be defined using Opacity channel (in Blender: Alpha) and a secondary UV mapping.<br />
Textures without an alpha channel will be drawn with multiply blending (good for tyre marks and baked AO), while ones with an alpha channel will be drawn with alpha blending.<br />
<br />
If using [[FBX2EDF]], the second UV channel must be named the same as the overlay texture. For instance in Blender:<br />
<br />
[[File:blender_uv_channels.jpg]]<br />
<br />
===Wet Track Reflections===<br />
For rain puddles (track reflections) a third texture can be set in the Specular channel, and a secondary UV mapping. The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
===FLG files===<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
clampu = 1 ; disables repetitions along U direction<br />
clampv = 1 ; disables repetitions along V direction<br />
nocompress = 1 ; the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
===Specular Maps===<br />
Specular map '''must be in alpha channel of normal map'''. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
<br />
===Normal Maps===<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
<br />
It's possible to set the normal map tiling by setting '''repetitions''':<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
repetitions = 10<br />
}<br />
<br />
<br />
===Reflections===<br />
Realtime reflections are not supported on tracks. However, you can use a static cubic reflection map:<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
"Add" reflections are useful for more natural, non-metallic fresnel reflections (for example, plastic or painted surfaces).<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Like specular, reflection maps only use the alpha channel.<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=166Track Creation Guide2020-12-08T22:19:32Z<p>PiBoSo: /* Shading */</p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
===Transparent Textures===<br />
Textures with alpha channels will appear transparent.<br />
Alpha channels with only 2 values (0 and 255) are automatically treated as color-key. It's also possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
===Shading===<br />
Trees leafs should have the '''TREE''' string inside the name (eg: CK_TREE.TGA); this will give the leaves less harsh shading and appear more natural.<br />
<br />
The same constant shading can be achieved also using the '''CONSTS_''' string in the name that, unlike "TREE", works for movable models, too ( eg. the background ).<br />
<br />
To disable shading, '''NOLIGHTING''' must be added to the texture name.<br />
<br />
===Tyre Mark Overlay===<br />
For tyre marks, a second texture can be defined using Opacity channel (in Blender: Alpha) and a secondary UV mapping.<br />
Textures without an alpha channel will be drawn with multiply blending (good for tyre marks and baked AO), while ones with an alpha channel will be drawn with alpha blending.<br />
<br />
If using [[FBX2EDF]], the second UV channel must be named the same as the overlay texture. For instance in Blender:<br />
<br />
[[File:blender_uv_channels.jpg]]<br />
<br />
===Wet Track Reflections===<br />
For rain puddles (track reflections) a third texture can be set in the Specular channel, and a secondary UV mapping. The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
===FLG files===<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
clampu = 1 ; disables repetitions along U direction<br />
clampv = 1 ; disables repetitions along V direction<br />
nocompress = 1 ; the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
===Specular Maps===<br />
Specular map '''must be in alpha channel of normal map'''. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
<br />
===Normal Maps===<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
<br />
It's possible to set the normal map tiling by setting '''repetitions''':<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
repetitions = 10<br />
}<br />
<br />
<br />
===Reflections===<br />
Realtime reflections are not supported on tracks. However, you can use a static cubic reflection map:<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
"Add" reflections are useful for more natural, non-metallic fresnel reflections (for example, plastic or painted surfaces).<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Like specular, reflection maps only use the alpha channel.<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=165Track Creation Guide2020-12-08T22:11:50Z<p>PiBoSo: /* Shading */</p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
===Transparent Textures===<br />
Textures with alpha channels will appear transparent.<br />
Alpha channels with only 2 values (0 and 255) are automatically treated as color-key. It's also possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
===Shading===<br />
Trees leafs should have the '''TREE''' string inside the name (eg: CK_TREE.TGA); this will give the leaves less harsh shading and appear more natural.<br />
<br />
The same constant shading can be achieved also using the '''CONSTS_''' string in the name that, unlike "TREE", works for movable models, too ( eg. the background ).<br />
<br />
To disable shading, '''NOLIGHTING''' must be added to the name.<br />
<br />
===Tyre Mark Overlay===<br />
For tyre marks, a second texture can be defined using Opacity channel (in Blender: Alpha) and a secondary UV mapping.<br />
Textures without an alpha channel will be drawn with multiply blending (good for tyre marks and baked AO), while ones with an alpha channel will be drawn with alpha blending.<br />
<br />
If using [[FBX2EDF]], the second UV channel must be named the same as the overlay texture. For instance in Blender:<br />
<br />
[[File:blender_uv_channels.jpg]]<br />
<br />
===Wet Track Reflections===<br />
For rain puddles (track reflections) a third texture can be set in the Specular channel, and a secondary UV mapping. The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
===FLG files===<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
clampu = 1 ; disables repetitions along U direction<br />
clampv = 1 ; disables repetitions along V direction<br />
nocompress = 1 ; the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
===Specular Maps===<br />
Specular map '''must be in alpha channel of normal map'''. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
<br />
===Normal Maps===<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
<br />
It's possible to set the normal map tiling by setting '''repetitions''':<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
repetitions = 10<br />
}<br />
<br />
<br />
===Reflections===<br />
Realtime reflections are not supported on tracks. However, you can use a static cubic reflection map:<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
"Add" reflections are useful for more natural, non-metallic fresnel reflections (for example, plastic or painted surfaces).<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Like specular, reflection maps only use the alpha channel.<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=164Track Creation Guide2020-12-08T22:11:03Z<p>PiBoSo: /* Textures */</p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
===Transparent Textures===<br />
Textures with alpha channels will appear transparent.<br />
Alpha channels with only 2 values (0 and 255) are automatically treated as color-key. It's also possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
===Shading===<br />
Trees leafs should have the '''TREE''' string inside the name (eg: CK_TREE.TGA); this will give the leaves less harsh shading and appear more natural.<br />
<br />
The same constant shading can be achieved also using the '''CONSTS_''' string in the name that, unlike "TREE", work for movable models ( eg. the background ).<br />
<br />
To disable shading, '''NOLIGHTING''' must be added to the name.<br />
<br />
===Tyre Mark Overlay===<br />
For tyre marks, a second texture can be defined using Opacity channel (in Blender: Alpha) and a secondary UV mapping.<br />
Textures without an alpha channel will be drawn with multiply blending (good for tyre marks and baked AO), while ones with an alpha channel will be drawn with alpha blending.<br />
<br />
If using [[FBX2EDF]], the second UV channel must be named the same as the overlay texture. For instance in Blender:<br />
<br />
[[File:blender_uv_channels.jpg]]<br />
<br />
===Wet Track Reflections===<br />
For rain puddles (track reflections) a third texture can be set in the Specular channel, and a secondary UV mapping. The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
===FLG files===<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
clampu = 1 ; disables repetitions along U direction<br />
clampv = 1 ; disables repetitions along V direction<br />
nocompress = 1 ; the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
===Specular Maps===<br />
Specular map '''must be in alpha channel of normal map'''. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
<br />
===Normal Maps===<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
<br />
It's possible to set the normal map tiling by setting '''repetitions''':<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
repetitions = 10<br />
}<br />
<br />
<br />
===Reflections===<br />
Realtime reflections are not supported on tracks. However, you can use a static cubic reflection map:<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
"Add" reflections are useful for more natural, non-metallic fresnel reflections (for example, plastic or painted surfaces).<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Like specular, reflection maps only use the alpha channel.<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=163MXB Track Creation Guide2020-11-25T23:09:15Z<p>PiBoSo: /* Scenery */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===SOFT OBJECTS===<br />
'Soft' object allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
*'''SOFTBPLAS'''<br />
*'''SOFTCPLAS'''<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
*In the INI file it is possible to set a paint, for example to change the billboards textures, different for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
if no file is set, "default.pnt" is automatically loaded.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=162MXB Track Creation Guide2020-11-25T23:08:38Z<p>PiBoSo: /* Other Files */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===SOFT OBJECTS===<br />
'Soft' object allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
*In the INI file it is possible to set a paint, for example to change the billboards textures, different for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
if no file is set, "default.pnt" is automatically loaded.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=161MXB Track Creation Guide2020-11-03T15:39:07Z<p>PiBoSo: /* Other Files */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===SOFT OBJECTS===<br />
'Soft' object allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
*In the INI file it is possible to set a paint, for example to change the billboards, different for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
if no file is set, "default.pnt" is automatically loaded.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=160MXB Track Creation Guide2020-11-03T15:38:28Z<p>PiBoSo: /* Other Files */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===SOFT OBJECTS===<br />
'Soft' object allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
*In the INI file it is possible to set paints, for example to change the billboards, different for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
if no file is set, "default.pnt" is automatically loaded.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=159MXB Track Creation Guide2020-11-03T15:05:47Z<p>PiBoSo: /* Other Files */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===SOFT OBJECTS===<br />
'Soft' object allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
*In the INI file it is possible to set a different paint, for example to change the billboards, for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
if no file is set, "default.pnt" is automatically loaded.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=158MXB Track Creation Guide2020-11-03T15:04:47Z<p>PiBoSo: /* Other Files */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===SOFT OBJECTS===<br />
'Soft' object allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
*In the INI file it is possible to set a different paint for each event type:<br />
[paint]<br />
testing=<br />
race=<br />
if no file is set, "default.pnt" is automatically loaded.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=157MXB Track Creation Guide2020-10-29T14:12:47Z<p>PiBoSo: /* =SOFT OBJECTS */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===SOFT OBJECTS===<br />
'Soft' object allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=156MXB Track Creation Guide2020-10-29T14:11:58Z<p>PiBoSo: /* Scenery */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
===SOFT OBJECTS==<br />
'Soft' object allow the bike to pass through but offer some resistance, which is useful for supercross tracks.<br />
<br />
The following options are supported:<br />
<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTBHAYB''' : Same but offers less resistance<br />
*'''SOFTCHAYB''' : Even less resistance<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
<br />
Soft objects must all be separate, individual objects. This is because the physics calculates a bounding box around the mesh.<br />
For best accuracy, the pivot should be aligned with the object axis.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=155Track Creation Guide2020-10-27T19:12:35Z<p>PiBoSo: /* Tyre Mark Overlay */</p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
===Transparent Textures===<br />
Textures with alpha channels will appear transparent.<br />
Alpha channels with only 2 values (0 and 255) are automatically treated as color-key. It's also possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
Trees leafs should have the '''TREE''' string inside the name (eg: CK_TREE.TGA); this will give the leaves less harsh shading and appear more natural.<br />
<br />
===Tyre Mark Overlay===<br />
For tyre marks, a second texture can be defined using Opacity channel (in Blender: Alpha) and a secondary UV mapping.<br />
Textures without an alpha channel will be drawn with multiply blending (good for tyre marks and baked AO), while ones with an alpha channel will be drawn with alpha blending.<br />
<br />
If using [[FBX2EDF]], the second UV channel must be named the same as the overlay texture. For instance in Blender:<br />
<br />
[[File:blender_uv_channels.jpg]]<br />
<br />
===Wet Track Reflections===<br />
For rain puddles (track reflections) a third texture can be set in the Specular channel, and a secondary UV mapping. The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
===FLG files===<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
clampu = 1 ; disables repetitions along U direction<br />
clampv = 1 ; disables repetitions along V direction<br />
nocompress = 1 ; the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
===Specular Maps===<br />
Specular map '''must be in alpha channel of normal map'''. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
<br />
===Normal Maps===<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
<br />
It's possible to set the normal map tiling by setting '''repetitions''':<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
repetitions = 10<br />
}<br />
<br />
<br />
===Reflections===<br />
Realtime reflections are not supported on tracks. However, you can use a static cubic reflection map:<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
"Add" reflections are useful for more natural, non-metallic fresnel reflections (for example, plastic or painted surfaces).<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Like specular, reflection maps only use the alpha channel.<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=154MXB Track Creation Guide2020-10-27T19:05:26Z<p>PiBoSo: /* Scenery */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''SOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''SOFTPLAS''' : Soft plastic, eg. cones<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=153MXB Track Creation Guide2020-10-27T19:00:38Z<p>PiBoSo: /* Scenery */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
*'''WLLCONC''' : Concrete Wall<br />
*'''WLLTYRE''' : Tyrewall<br />
*'''WLLHAYB''' : Hard haybales that stop the bike<br />
*'''WLLSOFTHAYB''' : Soft haybales, that slow the bike<br />
*'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=152MXB Track Creation Guide2020-10-27T18:59:48Z<p>PiBoSo: /* Scenery */</p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==Scenery==<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
'''WLLCONC''' : Concrete Wall<br />
'''WLLTYRE''' : Tyrewall<br />
'''WLLHAYB''' : Hard haybales that stop the bike<br />
'''WLLSOFTHAYB''' : Soft haybales, that slow the bike<br />
'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword INVISIBLE ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=151MXB Track Creation Guide2020-10-27T18:59:27Z<p>PiBoSo: </p>
<hr />
<div>==Basic Workflow==<br />
*'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
===Scenery===<br />
scenery.edf should be exported as fbx and converted using [[FBX2EDF]]<br />
Object collision types are:<br />
<br />
'''WLLCONC''' : Concrete Wall<br />
'''WLLTYRE''' : Tyrewall<br />
'''WLLHAYB''' : Hard haybales that stop the bike<br />
'''WLLSOFTHAYB''' : Soft haybales, that slow the bike<br />
'''WLLWIRE''' : Wire fence<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword INVISIBLE ( eg: WLLCONCINVISIBLE ) <br />
<br />
Tarmac surfaces are supported, using either '''TRKASPH''' or '''TRKCONC''' (less grip)<br />
<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Helmet_Creation_Guide&diff=150Helmet Creation Guide2020-10-27T18:35:56Z<p>PiBoSo: </p>
<hr />
<div>The easiest way to make a new helmet is to duplicate and rename the default one (found in rider.pkz , can be opened with 7zip or similar)<br />
<br />
Export your helmet model at 0,0,0 with the following fbx export settings:<br />
<br />
[[File:export_settings.png]]<br />
<br />
'''-Z Forward'''<br />
<br />
'''X Up'''<br />
<br />
Some minor rotations will usually be needed (around 15 degrees back)</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=File:Export_settings.png&diff=149File:Export settings.png2020-10-27T18:32:23Z<p>PiBoSo: </p>
<hr />
<div></div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Helmet_Creation_Guide&diff=148Helmet Creation Guide2020-10-27T18:30:45Z<p>PiBoSo: Created page with "The easiest way to make a new helmet is to duplicate and rename the default one (found in rider.pkz , can be opened with 7zip or similar) Export your helmet model at 0,0,0 wi..."</p>
<hr />
<div>The easiest way to make a new helmet is to duplicate and rename the default one (found in rider.pkz , can be opened with 7zip or similar)<br />
<br />
Export your helmet model at 0,0,0 with the following fbx export settings:</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Main_Page&diff=147Main Page2020-10-27T18:24:57Z<p>PiBoSo: /* Modding Guides */</p>
<hr />
<div>__NOTOC__<br />
==User Manuals==<br />
<br />
===[[Kart Racing Pro]]===<br />
===[[GP Bikes]]===<br />
===[[World Racing Series]]===<br />
===[[MX Bikes]]===<br />
<br />
==Modding Guides==<br />
===[[Track Creation Guide]]===<br />
===[[MXB Track Creation Guide]]===<br />
===[[Bike Creation Guide]]===<br />
===[[Helmet Creation Guide]]===<br />
<br />
==Tools Manuals==<br />
===[[FBX2EDF]]===<br />
===[[TrackEd]]===<br />
===[[MapView]]===<br />
<!--===[[Track Tools]]===(this section is not needed now)--><br />
===[[PaintEd]]===<br />
===[[Dedicated Server]]===<br />
<!--===[[BikeEd]]===<br />
===[[Dash]]===--><br />
===[[Tyres]]===<br />
<br />
==Tools & Resources Downloads==<br />
====[http://www.kartracing-pro.com/downloads/tt.zip FBX2EDF, MapView, 3dsmax plugins, TerrainEd, TrackEd]====<br />
====[http://www.kartracing-pro.com/downloads/painted.zip PaintEd]====<br />
====[http://mx-bikes.com/downloads/templates.zip MXB Bike & Rider templates]====<br />
====[http://gp-bikes.com/downloads/gpb_templates.zip GPB Bike & Rider templates]====<br />
====[http://kartracing-pro.com/downloads/krp_templates.zip KRP Kart & Driver templates]====<br />
====[http://www.worldracingseries.net/downloads/wrs_templates.zip WRS Cars & Drivers templates]====<br />
====[http://www.kartracing-pro.com/downloads/track_lights.zip Track startlights and pit lights templates]====</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=146Track Creation Guide2020-09-14T11:30:15Z<p>PiBoSo: /* Reflections */</p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
===Transparent Textures===<br />
Textures with alpha channels will appear transparent.<br />
Alpha channels with only 2 values (0 and 255) are automatically treated as color-key. It's also possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
Trees leafs should have the '''TREE''' string inside the name (eg: CK_TREE.TGA); this will give the leaves less harsh shading and appear more natural.<br />
<br />
===Tyre Mark Overlay===<br />
For tyre marks, a second texture can be defined using Opacity channel (in Blender: Alpha) and a secondary UV mapping.<br />
Textures without an alpha channel will be drawn with multiply blending (good for tyre marks and baked AO), while ones with an alpha channel will be drawn with alpha blending.<br />
<br />
If using [[FBX2EDF]], the second UV channel must be named the same as the overlay texture. For instance in Blender:<br />
[[File:blender_uv_channels.jpg]]<br />
<br />
===Wet Track Reflections===<br />
For rain puddles (track reflections) a third texture can be set in the Specular channel, and a secondary UV mapping. The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
===FLG files===<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
clampu = 1 ; disables repetitions along U direction<br />
clampv = 1 ; disables repetitions along V direction<br />
nocompress = 1 ; the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
===Specular Maps===<br />
Specular map '''must be in alpha channel of normal map'''. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
<br />
===Normal Maps===<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
<br />
It's possible to set the normal map tiling by setting '''repetitions''':<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
repetitions = 10<br />
}<br />
<br />
<br />
===Reflections===<br />
Realtime reflections are not supported on tracks. However, you can use a static cubic reflection map:<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
"Add" reflections are useful for more natural, non-metallic fresnel reflections (for example, plastic or painted surfaces).<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Like specular, reflection maps only use the alpha channel.<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=145Track Creation Guide2020-05-06T15:26:08Z<p>PiBoSo: /* Textures */</p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
===Transparent Textures===<br />
Textures with alpha channels will appear transparent.<br />
Alpha channels with only 2 values (0 and 255) are automatically treated as color-key. It's also possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
Trees leafs should have the '''TREE''' string inside the name (eg: CK_TREE.TGA); this will give the leaves less harsh shading and appear more natural.<br />
<br />
===Tyre Mark Overlay===<br />
For tyre marks, a second texture can be defined using Opacity channel (in Blender: Alpha) and a secondary UV mapping.<br />
Textures without an alpha channel will be drawn with multiply blending (good for tyre marks and baked AO), while ones with an alpha channel will be drawn with alpha blending.<br />
<br />
If using [[FBX2EDF]], the second UV channel must be named the same as the overlay texture. For instance in Blender:<br />
[[File:blender_uv_channels.jpg]]<br />
<br />
===Wet Track Reflections===<br />
For rain puddles (track reflections) a third texture can be set in the Specular channel, and a secondary UV mapping. The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
===FLG files===<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
clampu = 1 ; disables repetitions along U direction<br />
clampv = 1 ; disables repetitions along V direction<br />
nocompress = 1 ; the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
===Specular Maps===<br />
Specular map '''must be in alpha channel of normal map'''. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
<br />
===Normal Maps===<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
<br />
It's possible to set the normal map tiling by setting '''repetitions''':<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
repetitions = 10<br />
}<br />
<br />
<br />
===Reflections===<br />
Realtime reflections are not supported on tracks. However, you can use a static cubic reflection map:<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Like specular, reflection maps only use the alpha channel.<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=File:Blender_uv_channels.jpg&diff=144File:Blender uv channels.jpg2020-05-06T15:20:25Z<p>PiBoSo: </p>
<hr />
<div></div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=143Track Creation Guide2020-05-06T14:53:33Z<p>PiBoSo: /* Shaders */</p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
Textures with only 2 alpha values (0 and 255) are automatically treated as color-key. It's possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
Trees leafs must have the '''TREE''' string inside the name (eg: CK_TREE.TGA)<br />
<br />
'''For tyre marks, a second texture can be defined using Opacity channel and a secondary UV mapping.''' Textures with alpha channel will be drawn with alpha blending, while ones without alpha channel will be drawn with multiply blending.<br />
<br />
'''For rain puddles (track reflections) a third texture can be set in the Glossiness or Specular Level channel, and a secondary UV mapping.''' The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
*'''clampu = 1''' : disables repetitions along U direction<br />
*'''clampv = 1''' : disables repetitions along V direction<br />
*'''nocompress = 1''' : the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
===Specular Maps===<br />
Specular map '''must be in alpha channel of normal map'''. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
<br />
===Normal Maps===<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
<br />
It's possible to set the normal map tiling by setting '''repetitions''':<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
repetitions = 10<br />
}<br />
<br />
<br />
===Reflections===<br />
Realtime reflections are not supported on tracks. However, you can use a static cubic reflection map:<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Like specular, reflection maps only use the alpha channel.<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=142MXB Track Creation Guide2020-02-24T13:51:36Z<p>PiBoSo: /* Material Layers */</p>
<hr />
<div>'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
<br />
<br />
==Basic Workflow==<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates its own particle effects.<br />
<br />
Material types:<br />
*'''Soil'''<br />
*'''Soft Soil'''<br />
*'''Compact Soil'''<br />
*'''Sand'''<br />
*'''Gravel'''<br />
*'''Grass'''<br />
*'''Rock'''<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=TrackEd&diff=141TrackEd2020-02-04T14:14:16Z<p>PiBoSo: /* Trackside Cameras */</p>
<hr />
<div>==Controls==<br />
<br />
:'''Z key''' or '''MMB''' : pan<br />
:'''Mouse Wheel''' : Zoom in/out<br />
<br />
3d View:<br />
:'''Right Ctrl key''' : Mouselook (hold)<br />
:'''Arrow Keys''' : Move<br />
:'''Mouse Wheel''' : Change movement speed<br />
<br />
Cameras / Marshals Editor:<br />
:'''z key + left mouse button''' : move on the plane<br />
:'''x key + left mouse button''' : move up / down<br />
:'''c key + left mouse button''' : rotate camera<br />
<br />
==Menu==<br />
<br />
===File===<br />
<br />
:'''Load''' : Load a .trp file<br />
:'''Save''' : Save the currently open .trp file<br />
:'''Exit''' : Exit TrackEd<br />
<br />
<br />
===Centerline===<br />
<br />
:'''New''' : Clear current editable centerline<br />
:'''Open''' : Load a centerline .tcl file<br />
:'''Save''' : Save currently open .tcl file<br />
:'''Save As''' : Save .tcl file<br />
:'''Scale''' : Scale entire centerline<br />
:'''Merge''' : 'Stamp' the currently editable centerline to the track mesh<br />
:'''Draw''' : Show / hide the centerline<br />
<br />
<br />
===View===<br />
<br />
:'''[[TrackEd#Race_Data|Race Data]]''' : Dialogue for setting up track splits, pits, grid, etc.<br />
:'''[[TrackEd#Trackside_Cameras|Cameras Control]]''' : Place trackside cameras<br />
:'''[[TrackEd#Marshals|Marshals]]''' : Place marshals (warning & finish flags)<br />
:'''[[TrackEd#Alternate_Layouts|Layout]]''' : Place objects to block alternate routes<br />
<br />
<br />
===Draw===<br />
<br />
:'''Draw Terrain''' : Show / hide the merged centerline and colour key overlay<br />
:'''Wireframe''' : Display track mesh with textures (no colour key)<br />
:'''Materials''' : Display material colour key overlay<br />
:'''Surfaces''' : Display physics surfaces colour key overlay<br />
:'''Draw Map''' : Show / hide the track geometry<br />
:'''Linear Guide''' : Show / hide the linear guide, if you have created one (linear guides can be created using the right click menu)<br />
<br />
<br />
===Background===<br />
<br />
:'''Load'''<br />
:'''Set'''<br />
:'''Draw'''<br />
<br />
<br />
===Surface===<br />
<br />
:'''Generate''' : Calculate the dynamic surface data<br />
:'''Edit''' : Adjust left and right borders<br />
:'''Draw''' : Show / hide the surface data<br />
<br />
<br />
===Bestline===<br />
<br />
:'''Generate''' : Tool for generating a bestline<br />
:'''Save''' : Save bestline file<br />
:'''Draw''' : Turn display of bestline on or off<br />
<br />
<br />
===Min/Max Lines===<br />
<br />
:'''Save'''<br />
:'''Draw'''<br />
:'''Min/Max Toggle''' : Show /hide the height window <br />
<br />
<br />
==Workflow==<br />
<br />
===Load your track===<br />
#'''File''' -> '''Load''', find your track .trp<br />
#The file should load quickly. You will probably need to '''zoom out''' using the '''mouse wheel'''<br />
#Hold the '''z''' key and move the mouse to pan around the viewport<br />
#Go to the menu '''Draw''' -> '''Wireframe''' to see the track without collision colours<br />
<br />
===Create a centerline===<br />
#'''Centerline''' -> '''New'''<br />
#Right click anywhere in the top window. Click '''New Segment'''<br />
#From the menu that appears, select '''straight'''. Leave length at 10m. The first segment MUST be a straight!<br />
#The first segment will be placed at world center. Move it to your startline position.<br />
#Now is a good time to visually check your track scale. Your track should generally be around 12-14 metres wide. Kart tracks should generally be around 8m wide. If your track is not correctly scaled you will need to fix the size and re-export.<br />
#Click and drag the start point of your first segment to the startline. The arrow indicates track direction.<br />
#With your first segment selected, right click on it. Select '''Add Curve''' to add a curve segment. Drag the end of the curve around to follow your track centerline.<br />
#Continue to add segments as needed to map out the entire track centerline. Try to use as few segments as possible.<br />
#Make sure that the last segment is a curve.<br />
#Move the endpoint of the last segment near to the startpoint of the first segment. Deselect segment by clicking away from the centerline, right click and choose close to close your centerline, making a complete loop. If your centerline will not close, add a second curve segment to the end and try again.<br />
#It's a good idea to save your editable centerline to a '''.tcl''' file, so you can load it again if you re-export your trp. Go '''Centerline''' -> '''Save As'''<br />
#Now you have a complete centerline, use '''Centerline''' -> '''Merge''' to 'stamp' it to the track.<br />
#If you hide the editable purple centerline ('''Centerline''' -> '''Draw''') you should be able to see the stamped red centerline.<br />
#'''File''' -> '''Save''' to save the .trp file with the centerline included.<br />
#If you reload your .trp now, you should be able to see your track with red centerline. The .trp is now prepared.<br />
<br />
===Race Data===<br />
The Race Data panel is used to place the grid, pits, and splits.<br />
When entering Left and Right values, the left value should be negative and the right positive.<br />
<br />
;Checkpoints<br />
:'''Long''': Distance along the centerline<br />
:'''Left''': How far it extends to the left of the centerline<br />
:'''Right''': How far it extends to the right of the centerline<br />
:'''Penalty''': How many seconds penalty for missing the checkpoint<br />
<br />
:'''Centerline / Start Area / Joker Lap''': (MX Bikes only) Which centerline to use<br />
:'''Start''': (MX Bikes only) Enable if the checkpoint is only used for the start, and not the main circuit<br />
:'''Both''': (MX Bikes only) Enable if the checkpoint is between the start (where the start joins the main circuit) and the finish line<br />
<br />
;Pits<br />
:Used to place the pits and the pitboards<br />
<br />
;Grid<br />
:Used to place the grid. Click one of the buttons to load a preset for that sim!<br />
<br />
===Generate Bestline===<br />
Generate a bestline if you want to enable the yellow bestline helper, and to enable corner anticipation. This stage is not required.<br />
<br />
===Min / Max Lines===<br />
This defines the edges of the racing surface and the destination for long resets, so the player isn't reset in the center of the track.<br />
<br />
You must have a correctly defined 'off track' surface for this to work. For GPB/WRS/KRP tracks, 'offtrack' is automatically applied to surfaces that are not TRKASPH (eg. TRKGRAS & TRKSAND). For MXB tracks, it is defined in the tht file (surface = off)<br />
<br />
Remember to save the generated data before closing TrackEd!<br />
<br />
===Trackside Cameras===<br />
<br />
====Place Cameras====<br />
#'''View''' -> '''Cameras Control''' to activate camera editing mode.<br />
#Right click in the Cameras Control window and click '''Create Set'''<br />
#Right click on the newly created Camera Set and click '''Rename''' if you like.<br />
#Right click on your Camera Set and click '''edit'''<br />
#Click on one of the '''New Camera''' buttons and then click in the scene to place it:<br />
#*'''Normal''': Yellow. Standard camera, will look at the player.<br />
#*'''Fixed''': Purple. Static camera. Will not rotate to follow player.<br />
#*'''Path''': Red & Pink. Will move to follow player, between point 1 (Red) and point 2 (Pink).<br />
#Click on the '''camera sphere''' in the scene to select it. You can right click on the camera in the list and select '''Locate''' to focus the view on the camera.<br />
#Using the '''z''' (move horizontal), '''x''' (move vertical), '''c''' (rotate) keys, position your camera. If it is a Normal or Path camera, make sure it is angled perpendicular to the closest section of track.<br />
#Right click on a camera and select '''Test''' to see from the camera's point of view. Left click to recenter view, right click to return.<br />
<br />
====Set Camera Limits====<br />
Sometimes you will find that a camera will activate at the wrong time. This can be fixed by using '''Limits'''.<br />
Right click on a camera sphere and select '''Edit'''. Tick the '''Enable''' checkbox in the '''Limit''' section. Now enter '''Start''' and '''End''' values - these correspond to distances along your track centerline. After clicking '''OK''' you will see green and red spheres appear on the track showing where the camera activation will start and end.<br />
<br />
====Autozoom====<br />
Autozoom is enabled by default. This zooms the camera when the target is far away.<br />
*'''Reference''': The size of the target that the autozoom should try to maintain. 0.15 - 0.2 generally works best.<br />
*'''Min Fov''': The minimum field of view allowed for the autozoom<br />
*'''Max Fov''': The maximum field of view allowed for the autozoom<br />
<br />
====Surface Params====<br />
Optionally you can define cameras for the pitlane / pits and start gates (MXB only).<br />
<br />
Right click on the '''camera set''' you wish to modify and click '''Params'''. The options are:<br />
*'''0''' : Track surface (default)<br />
*'''1''' : Pitlane<br />
*'''2''' : Start gates<br />
<br />
===Generate Dynamic Surface===<br />
This is only required for road circuits (or supermoto tracks with racing surface geometry marked as TRKASPH)<br />
<br />
#'''Surface''' -> '''Generate''' to calculate the data. It may take several seconds, depending on track length.<br />
#'''Surface''' -> '''Edit''' to adjust left and right borders to fit the racing surface as close as possible.<br />
<br />
===Alternate Layouts===<br />
You can place objects to block of alternate routes.<br />
#'''View''' -> '''Layout''' to open the layout editor.<br />
#Use '''RCtrl''' and the '''arrow keys''' to navigate the free roam camera<br />
#Click on an object name in the Layout editor<br />
#Click the '''Create button'''<br />
#Click in the scene. The object will be placed on the ground below the cursor position<br />
#Use the '''z''' (move horizontal) and '''c''' (rotate) keys to position the object<br />
#Continue to add as many objects as necessary!<br />
#Save the .lyt file!<br />
<br />
===Create Layouts===<br />
This is optional, if your track has multiple layouts.<br />
#Create a new folder for your alternate layout inside your track folder (eg. tracks/mytrack/short/)<br />
#Open your trp file in TrackEd, and either modify your existing centerline or create a new one from scratch.<br />
#Merge the new centerline , generate a new dynamic surface (& bestline, if you want) and save the file as a new .trp in the alternate layout folder.<br />
#Modify your trackside cameras to match the new layout, and save the .tsc file in the alternate layout folder.<br />
#Modify your race data to match the new circuit length and save the .rdf in the alternate layout folder.<br />
#Use the layout editor to place cones and haybales to block off routes. Save the .lyt in the alternate layout folder.<br />
#Create a new map.tga image for the new layout<br />
#Modify your marshals to fit the new layout and save the marshals.cfg file in the alternate layout folder.<br />
#Copy your .ini file into the alternate layout folder, and modify appropriately.<br />
<br />
===Marshals===<br />
#Click '''Create''' and then click somewhere in the main window to place a marshal.<br />
#Use the '''Z''' Key to change the location and the '''X''' key to change the height.<br />
<br />
===Min/Max Lines===<br />
#Click '''Min / Max Lines''' to generate the track edges data that will be used for the long resets in MXB & GPB. If these are missing, the bike will reset to the centerline.<br />
#Once you have generated the lines and confirmed they look visually correct, click Save to create '''minrace.tl''' & '''maxrace.tl''' files.<br />
<br />
===Checkpoint Lines===<br />
This creates track data that ensures the bike is reset to the correct portion of the circuit which is useful for Supercross. The generated data will look like a mess - don't worry, it should work ingame.<br />
Once Generated, click save to create '''checkleft.tl''' & '''checkright.tl''' files.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Options_Menu&diff=140Options Menu2020-01-13T16:41:38Z<p>PiBoSo: /* Controls */</p>
<hr />
<div>==Input==<br />
===Calibration===<br />
Move all the axis on your controller to their extents, then click ok to save calibration.<br />
===Controls===<br />
:'''Lean''' : Bike L/R control<br />
:'''Throttle'''<br />
:'''Brake''' : Front Brake Lever control<br />
:'''Rear Brake'''<br />
:'''Clutch'''<br />
:'''F/B Lean''' : Rider forwards (tuck) and backwards (sit up) lean<br />
:'''L/R Lean''' : Rider left / right lean control, only used if auto lean is disabled<br />
===Direct Lean===<br />
:'''Enable''' : <br />
===Force Feedback===<br />
:'''Enable''' : For FF enabled joysticks and wheels. Gamepad rumble is not supported.<br />
:'''Strength''' : Values above 100% may negatively impact subtle effects<br />
:'''Reverse''' : Reverses the force effects, required by some controllers<br />
===Advanced===<br />
Allows you to fine tune the controller inputs for each axis. Click on the down arrow next to '''''Lean''''' to select other axis.<br />
:'''Deadzone''' : Useful to remove unwanted wobble in the center of steering motion, for example<br />
:'''Linearity''' : Can provide more accuracy at the start of axis motion<br />
:'''Press''' : When a button or key is assigned, adjusts axis increase speed when pressing<br />
:'''Release''' : When a button or key is assigned, adjusts axis decrease speed when releasing<br />
<br />
==Input 2==<br />
===Gearbox===<br />
:'''Preload''' <br />
:'''Shift Up'''<br />
:'''Shift Down'''<br />
===Controls===<br />
:'''Reset''' : To reset the bike on the track after a crash. Press once to reset in-place, press and hold to reset to the track.<br />
:'''Low Speed''' : Push the bike backwards and forwards<br />
:'''Dash''' : Change the information displayed on the dashboard<br />
:'''Pit Limiter''' : Pitlane speed limiter toggle<br />
:'''Engine Mapping''' : Switch between '''''Qualify, Race, Wet''''' engine mappings while on track<br />
<br />
===View===<br />
:'''Change View''' : Switch between Onboard, Cockpit, External views<br />
:'''Look Back''' : Look behind<br />
:'''Heading''' : Look to the left and right<br />
:'''Tearoff''' : Clean visor<br />
===Gestures===<br />
:'''Raise Arm''' : To let online riders know you are pitting, for example<br />
:'''Complaint''' : Unimpressed with someone's riding?<br />
:'''Win Gesture''' : You're number 1!<br />
:'''Angry Gesture''' : You only have yourself to blame.<br />
:'''Chat''' : Talk to other riders while ontrack<br />
==Input 3==<br />
===Replay Camera===<br />
This allows you to control the free roam replay camera with your analogue controller<br />
==Graphics==<br />
<br />
===Screen===<br />
===Textures===<br />
===Lighting===<br />
===Detail Level===<br />
<br />
==Misc==<br />
===Audio===<br />
===Units===<br />
===Date Format===<br />
===User Interface===<br />
===Connection===<br />
===Autochat===<br />
===Track===<br />
<br />
==Simulation==<br />
===Cockpit View===<br />
===Riding Aids===</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=TrackEd&diff=139TrackEd2020-01-13T16:40:00Z<p>PiBoSo: </p>
<hr />
<div>==Controls==<br />
<br />
:'''Z key''' or '''MMB''' : pan<br />
:'''Mouse Wheel''' : Zoom in/out<br />
<br />
3d View:<br />
:'''Right Ctrl key''' : Mouselook (hold)<br />
:'''Arrow Keys''' : Move<br />
:'''Mouse Wheel''' : Change movement speed<br />
<br />
Cameras / Marshals Editor:<br />
:'''z key + left mouse button''' : move on the plane<br />
:'''x key + left mouse button''' : move up / down<br />
:'''c key + left mouse button''' : rotate camera<br />
<br />
==Menu==<br />
<br />
===File===<br />
<br />
:'''Load''' : Load a .trp file<br />
:'''Save''' : Save the currently open .trp file<br />
:'''Exit''' : Exit TrackEd<br />
<br />
<br />
===Centerline===<br />
<br />
:'''New''' : Clear current editable centerline<br />
:'''Open''' : Load a centerline .tcl file<br />
:'''Save''' : Save currently open .tcl file<br />
:'''Save As''' : Save .tcl file<br />
:'''Scale''' : Scale entire centerline<br />
:'''Merge''' : 'Stamp' the currently editable centerline to the track mesh<br />
:'''Draw''' : Show / hide the centerline<br />
<br />
<br />
===View===<br />
<br />
:'''[[TrackEd#Race_Data|Race Data]]''' : Dialogue for setting up track splits, pits, grid, etc.<br />
:'''[[TrackEd#Trackside_Cameras|Cameras Control]]''' : Place trackside cameras<br />
:'''[[TrackEd#Marshals|Marshals]]''' : Place marshals (warning & finish flags)<br />
:'''[[TrackEd#Alternate_Layouts|Layout]]''' : Place objects to block alternate routes<br />
<br />
<br />
===Draw===<br />
<br />
:'''Draw Terrain''' : Show / hide the merged centerline and colour key overlay<br />
:'''Wireframe''' : Display track mesh with textures (no colour key)<br />
:'''Materials''' : Display material colour key overlay<br />
:'''Surfaces''' : Display physics surfaces colour key overlay<br />
:'''Draw Map''' : Show / hide the track geometry<br />
:'''Linear Guide''' : Show / hide the linear guide, if you have created one (linear guides can be created using the right click menu)<br />
<br />
<br />
===Background===<br />
<br />
:'''Load'''<br />
:'''Set'''<br />
:'''Draw'''<br />
<br />
<br />
===Surface===<br />
<br />
:'''Generate''' : Calculate the dynamic surface data<br />
:'''Edit''' : Adjust left and right borders<br />
:'''Draw''' : Show / hide the surface data<br />
<br />
<br />
===Bestline===<br />
<br />
:'''Generate''' : Tool for generating a bestline<br />
:'''Save''' : Save bestline file<br />
:'''Draw''' : Turn display of bestline on or off<br />
<br />
<br />
===Min/Max Lines===<br />
<br />
:'''Save'''<br />
:'''Draw'''<br />
:'''Min/Max Toggle''' : Show /hide the height window <br />
<br />
<br />
==Workflow==<br />
<br />
===Load your track===<br />
#'''File''' -> '''Load''', find your track .trp<br />
#The file should load quickly. You will probably need to '''zoom out''' using the '''mouse wheel'''<br />
#Hold the '''z''' key and move the mouse to pan around the viewport<br />
#Go to the menu '''Draw''' -> '''Wireframe''' to see the track without collision colours<br />
<br />
===Create a centerline===<br />
#'''Centerline''' -> '''New'''<br />
#Right click anywhere in the top window. Click '''New Segment'''<br />
#From the menu that appears, select '''straight'''. Leave length at 10m. The first segment MUST be a straight!<br />
#The first segment will be placed at world center. Move it to your startline position.<br />
#Now is a good time to visually check your track scale. Your track should generally be around 12-14 metres wide. Kart tracks should generally be around 8m wide. If your track is not correctly scaled you will need to fix the size and re-export.<br />
#Click and drag the start point of your first segment to the startline. The arrow indicates track direction.<br />
#With your first segment selected, right click on it. Select '''Add Curve''' to add a curve segment. Drag the end of the curve around to follow your track centerline.<br />
#Continue to add segments as needed to map out the entire track centerline. Try to use as few segments as possible.<br />
#Make sure that the last segment is a curve.<br />
#Move the endpoint of the last segment near to the startpoint of the first segment. Deselect segment by clicking away from the centerline, right click and choose close to close your centerline, making a complete loop. If your centerline will not close, add a second curve segment to the end and try again.<br />
#It's a good idea to save your editable centerline to a '''.tcl''' file, so you can load it again if you re-export your trp. Go '''Centerline''' -> '''Save As'''<br />
#Now you have a complete centerline, use '''Centerline''' -> '''Merge''' to 'stamp' it to the track.<br />
#If you hide the editable purple centerline ('''Centerline''' -> '''Draw''') you should be able to see the stamped red centerline.<br />
#'''File''' -> '''Save''' to save the .trp file with the centerline included.<br />
#If you reload your .trp now, you should be able to see your track with red centerline. The .trp is now prepared.<br />
<br />
===Race Data===<br />
The Race Data panel is used to place the grid, pits, and splits.<br />
When entering Left and Right values, the left value should be negative and the right positive.<br />
<br />
;Checkpoints<br />
:'''Long''': Distance along the centerline<br />
:'''Left''': How far it extends to the left of the centerline<br />
:'''Right''': How far it extends to the right of the centerline<br />
:'''Penalty''': How many seconds penalty for missing the checkpoint<br />
<br />
:'''Centerline / Start Area / Joker Lap''': (MX Bikes only) Which centerline to use<br />
:'''Start''': (MX Bikes only) Enable if the checkpoint is only used for the start, and not the main circuit<br />
:'''Both''': (MX Bikes only) Enable if the checkpoint is between the start (where the start joins the main circuit) and the finish line<br />
<br />
;Pits<br />
:Used to place the pits and the pitboards<br />
<br />
;Grid<br />
:Used to place the grid. Click one of the buttons to load a preset for that sim!<br />
<br />
===Generate Bestline===<br />
Generate a bestline if you want to enable the yellow bestline helper, and to enable corner anticipation. This stage is not required.<br />
<br />
===Min / Max Lines===<br />
This defines the edges of the racing surface and the destination for long resets, so the player isn't reset in the center of the track.<br />
<br />
You must have a correctly defined 'off track' surface for this to work. For GPB/WRS/KRP tracks, 'offtrack' is automatically applied to surfaces that are not TRKASPH (eg. TRKGRAS & TRKSAND). For MXB tracks, it is defined in the tht file (surface = off)<br />
<br />
Remember to save the generated data before closing TrackEd!<br />
<br />
===Trackside Cameras===<br />
<br />
====Place Cameras====<br />
#'''View''' -> '''Cameras Control''' to activate camera editing mode.<br />
#Right click in the Cameras Control window and click '''Create Set'''<br />
#Right click on the newly created Camera Set and click '''Rename''' if you like.<br />
#Right click on your Camera Set and click '''edit'''<br />
#Click on one of the '''New Camera''' buttons and then click in the scene to place it:<br />
##'''Normal''': Yellow. Standard camera, will look at the player.<br />
##'''Fixed''': Purple. Static camera. Will not rotate to follow player.<br />
##'''Path''': Red & Pink. Will move to follow player, between point 1 (Red) and point 2 (Pink).<br />
#Click on the '''camera sphere''' in the scene to select it. You can right click on the camera in the list and select '''Locate''' to focus the view on the camera.<br />
#Using the '''z''' (move horizontal), '''x''' (move vertical), '''c''' (rotate) keys, position your camera. If it is a Normal or Path camera, make sure it is angled perpendicular to the closest section of track.<br />
#Right click on a camera and select '''Test''' to see from the camera's point of view. Left click to recenter view, right click to return.<br />
<br />
====Set Camera Limits====<br />
Sometimes you will find that a camera will activate at the wrong time. This can be fixed by using '''Limits'''.<br />
Right click on a camera sphere and select '''Edit'''. Tick the '''Enable''' checkbox in the '''Limit''' section. Now enter '''Start''' and '''End''' values - these correspond to distances along your track centerline. After clicking '''OK''' you will see green and red spheres appear on the track showing where the camera activation will start and end.<br />
<br />
====Autozoom====<br />
Autozoom is enabled by default. This zooms the camera when the target is far away.<br />
*'''Reference''': The size of the target that the autozoom should try to maintain. 0.15 - 0.2 generally works best.<br />
*'''Min Fov''': The minimum field of view allowed for the autozoom<br />
*'''Max Fov''': The maximum field of view allowed for the autozoom<br />
<br />
===Generate Dynamic Surface===<br />
This is only required for road circuits (or supermoto tracks with racing surface geometry marked as TRKASPH)<br />
<br />
#'''Surface''' -> '''Generate''' to calculate the data. It may take several seconds, depending on track length.<br />
#'''Surface''' -> '''Edit''' to adjust left and right borders to fit the racing surface as close as possible.<br />
<br />
===Alternate Layouts===<br />
You can place objects to block of alternate routes.<br />
#'''View''' -> '''Layout''' to open the layout editor.<br />
#Use '''RCtrl''' and the '''arrow keys''' to navigate the free roam camera<br />
#Click on an object name in the Layout editor<br />
#Click the '''Create button'''<br />
#Click in the scene. The object will be placed on the ground below the cursor position<br />
#Use the '''z''' (move horizontal) and '''c''' (rotate) keys to position the object<br />
#Continue to add as many objects as necessary!<br />
#Save the .lyt file!<br />
<br />
===Create Layouts===<br />
This is optional, if your track has multiple layouts.<br />
#Create a new folder for your alternate layout inside your track folder (eg. tracks/mytrack/short/)<br />
#Open your trp file in TrackEd, and either modify your existing centerline or create a new one from scratch.<br />
#Merge the new centerline , generate a new dynamic surface (& bestline, if you want) and save the file as a new .trp in the alternate layout folder.<br />
#Modify your trackside cameras to match the new layout, and save the .tsc file in the alternate layout folder.<br />
#Modify your race data to match the new circuit length and save the .rdf in the alternate layout folder.<br />
#Use the layout editor to place cones and haybales to block off routes. Save the .lyt in the alternate layout folder.<br />
#Create a new map.tga image for the new layout<br />
#Modify your marshals to fit the new layout and save the marshals.cfg file in the alternate layout folder.<br />
#Copy your .ini file into the alternate layout folder, and modify appropriately.<br />
<br />
===Marshals===<br />
#Click '''Create''' and then click somewhere in the main window to place a marshal.<br />
#Use the '''Z''' Key to change the location and the '''X''' key to change the height.<br />
<br />
===Min/Max Lines===<br />
#Click '''Min / Max Lines''' to generate the track edges data that will be used for the long resets in MXB & GPB. If these are missing, the bike will reset to the centerline.<br />
#Once you have generated the lines and confirmed they look visually correct, click Save to create '''minrace.tl''' & '''maxrace.tl''' files.<br />
<br />
===Checkpoint Lines===<br />
This creates track data that ensures the bike is reset to the correct portion of the circuit which is useful for Supercross. The generated data will look like a mess - don't worry, it should work ingame.<br />
Once Generated, click save to create '''checkleft.tl''' & '''checkright.tl''' files.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Main_Page&diff=138Main Page2020-01-13T15:59:16Z<p>PiBoSo: /* Tools Manuals */</p>
<hr />
<div>__NOTOC__<br />
==User Manuals==<br />
<br />
===[[Kart Racing Pro]]===<br />
===[[GP Bikes]]===<br />
===[[World Racing Series]]===<br />
===[[MX Bikes]]===<br />
<br />
==Modding Guides==<br />
===[[Track Creation Guide]]===<br />
===[[MXB Track Creation Guide]]===<br />
===[[Bike Creation Guide]]===<br />
<br />
==Tools Manuals==<br />
===[[FBX2EDF]]===<br />
===[[TrackEd]]===<br />
===[[MapView]]===<br />
<!--===[[Track Tools]]===(this section is not needed now)--><br />
===[[PaintEd]]===<br />
===[[Dedicated Server]]===<br />
<!--===[[BikeEd]]===<br />
===[[Dash]]===--><br />
===[[Tyres]]===<br />
<br />
==Tools & Resources Downloads==<br />
====[http://www.kartracing-pro.com/downloads/tt.zip FBX2EDF, MapView, 3dsmax plugins, TerrainEd, TrackEd]====<br />
====[http://www.kartracing-pro.com/downloads/painted.zip PaintEd]====<br />
====[http://mx-bikes.com/downloads/templates.zip MXB Bike & Rider templates]====<br />
====[http://gp-bikes.com/downloads/gpb_templates.zip GPB Bike & Rider templates]====<br />
====[http://kartracing-pro.com/downloads/krp_templates.zip KRP Kart & Driver templates]====<br />
====[http://www.worldracingseries.net/downloads/wrs_templates.zip WRS Cars & Drivers templates]====<br />
====[http://www.kartracing-pro.com/downloads/track_lights.zip Track startlights and pit lights templates]====</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MapView&diff=137MapView2020-01-13T15:57:00Z<p>PiBoSo: PiBoSo moved page Map Viewer to MapView without leaving a redirect</p>
<hr />
<div>==Controls==<br />
<br />
:'''Right CTRL key''' : Mouse Look (hold down)<br />
:'''Arrow Keys''' : Move Camera<br />
:'''Mouse Wheel''' : Change Movement Speed<br />
:'''F11''' : Grab Screenshot. Saved under "scrshots" directory.<br />
<br />
==mapview.ini==<br />
<br />
[gfx]<br />
width = 800<br />
height = 600<br />
maximized = 0<br />
multisample = 0<br />
anisotropic = 0<br />
<br />
[navigation]<br />
fov = 60<br />
<br />
[shared]<br />
skies=c:\mxbikes\misc\skies\<br />
flags=c:\mxbikes\misc\flags\</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=136MXB Track Creation Guide2020-01-13T15:51:02Z<p>PiBoSo: </p>
<hr />
<div>'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
<br />
<br />
==Basic Workflow==<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates it's own particle effects.<br />
You can also have material types '''sand''' and '''gravel'''.<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==.amb file==<br />
You can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
You can use custom skies if desired by exporting your skydomes in .edf format.<br />
<br />
==Other Files==<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have, at minimum, the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
gate.edf ''(starting gate model)''<br />
<br />
<br />
:The gate edf can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to your '''mods\tracks''' folder<br />
<br />
Extra files you should include for final tracks:<br />
<br />
marshals.cfg ''(trackside marshals placement file)''<br />
mytrack.tsc ''(trackside cameras)''<br />
checkleft.tl & checkright.tl ''(reset lines at the track edges)''<br />
maxrace.tl & minrace.tl ''(auto-generated for resetting the bike to track)''<br />
<br />
==Distribution & Registration==<br />
For distribution, '''zip up your track folder''' and rename the zip file to '''.pkz'''. The folder must be zipped, '''not just the files'''. Now users only need to drop the single .pkz file into their mods\tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide&diff=135MXB Track Creation Guide2020-01-13T15:24:17Z<p>PiBoSo: </p>
<hr />
<div>'''[http://www.mx-bikes.com/downloads/mxb_track_example.zip Download the example track files]'''<br />
<br />
<br />
==Basic Workflow==<br />
*[[#Heightmap|Create Heightmap]], save as 16-bit .raw<br />
*[[#track.hmf|Create texture map]], assign to a texture layer in the hmf file and check terrain sizes & scaling<br />
*[[#Terrained|Run map.bat]] (terrained + source files must be in the same folder) to generate .map file<br />
*[[#track.tht|Edit tht file]] if necessary to match size & scale of hmf<br />
*[[#Terrained|Run trh.bat]] to generate .trh file<br />
*[[#TrackEd|Open trh in TrackEd]], create a centerline, merge and save trh<br />
*Use [[TrackEd]] to create all track data files<br />
<br />
==Heightmap==<br />
:Heightmap must be '''16bpp IBM RAW'''.<br />
:The heightmap dimensions must be a power of 2 +1. 2049x2049 is recommended. Rectangular heightmaps are supported; for example, the straight rhythm heightmap is 4097x257!<br />
<br />
==Track Data files==<br />
<br />
===track.hmf===<br />
'''samples_x''' = 2049 ''(RAW image width)''<br />
'''samples_y''' = 2049 ''(RAW image height)''<br />
'''data''' = heightmap.raw ''(RAW image filename)''<br />
<br />
'''size_x''' = 480 ''(track size in meters)''<br />
'''size_z''' = 480 ''(track size in meters)''<br />
'''scale''' = 3.2 ''(total track height in meters)''<br />
<br />
'''num_layers''' = 2 ''(number of texture layers)''<br />
<br />
layer0<br />
{<br />
'''map''' = track.tga ''(for example, the base terrain texture name)''<br />
'''repetitions''' = 1 ''(texture tiling)''<br />
}<br />
<br />
layer1<br />
{<br />
'''map''' = grass.tga ''(second texure layer name)''<br />
'''repetitions''' = 50 ''(if you are using a shader for this texture, this value should match the one in the .shd file)''<br />
'''mask''' = grass_mask.tga ''(the alpha channel will be a mask that shows / hides this layer)''<br />
'''thickness''' = 0.1 ''(the layer thickness, in meters)''<br />
<br />
'''grass''' ''(enables 3d grass for this layer)''<br />
{<br />
'''max_density''' = 8<br />
'''height''' = 0.15<br />
'''height_diff''' = 0.1 ''(randomise the grass height by this much)''<br />
'''width''' = 0.2<br />
'''width_diff''' = 0.1 ''(randomise the grass width by this much)''<br />
'''texture''' = grassfx.tga ''(this map is split into 4 horizontal sections - so 1024x256 is split into 4 separate 256x256 textures)''<br />
'''densitymap''' = mask.tga ''(alpha channel controls the grass density)''<br />
}<br />
}<br />
<br />
scene0 (here you add the scenery model)<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
If different texture tiling is needed on the X and Z axes, "repetitions" must be replaced with, for example:<br />
'''repetitions_x''' = 1<br />
'''repetitions_z''' = 2<br />
<br />
===track.tht===<br />
'''samples_x''' = 2049 ''(must be the same as value in .hmf file)''<br />
'''samples_z''' = 2049 ''(must be the same as value in .hmf file)''<br />
<br />
'''data''' = heightmap.raw ''(must be the same as value in .hmf file)''<br />
<br />
'''size_x''' = 480 ''(must be the same as value in .hmf file)''<br />
'''size_z''' = 480 ''(must be the same as value in .hmf file)''<br />
'''scale''' = 3.2 ''(must be the same as value in .hmf file)''<br />
<br />
'''num_surface_layers''' = 3 ''(surface layers define different areas on your track)<br />
<br />
surface_layer0<br />
{<br />
'''surface''' = off ''(This defines the offtrack areas)''<br />
'''mask''' = area_off.tga<br />
}<br />
<br />
surface_layer1<br />
{<br />
'''surface''' = pit ''(This defines the pit)''<br />
'''mask''' = area_pits.tga<br />
}<br />
<br />
surface_layer2<br />
{<br />
'''surface''' = start ''(This defines the start gate area)''<br />
'''mask''' = area_start.tga<br />
}<br />
<br />
'''num_material_layers''' = 3 ''(material layers define the track physics surfaces. You can also use masks, like in the hmf file)<br />
<br />
material_layer0 (the base layer, doesn't need a thickness)<br />
{<br />
'''material''' = compact soil<br />
}<br />
<br />
material_layer1<br />
{<br />
'''material''' = soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
material_layer2<br />
{<br />
'''material''' = soft soil<br />
'''thickness''' = 0.1<br />
}<br />
<br />
scene0 ''(here you add the scenery model)''<br />
{<br />
'''name''' = scenery.edf ''(name of the scenery model file)''<br />
'''pos''' ''(use these values to change the position and rotation of the scenery)''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
'''rot'''<br />
{<br />
x = 0<br />
y = 0<br />
z = 0<br />
}<br />
}<br />
<br />
====Material Layers====<br />
Due to the dynamic track surface in MXB, bikes will 'dig through' the material layers over time. In the above example, the top layer is soft, loose soil. Just underneath is regular soil, and then the bottom layer is a compact soil. This generally works best as the softer soils erode faster. Each material type has unique grip characteristics, and generates it's own particle effects.<br />
You can also have material types '''sand''' and '''gravel'''.<br />
<br />
==Terrain Textures & Shaders==<br />
Textures must be in TGA or BMP truecolor format.<br />
Size must be power of 2 (256, 512, 1024, 2048, 4096).<br />
Textures can be rectangle ( for example: 256x512, 1024x64 )<br />
===SHD files===<br />
These allow you to use specular & normal maps.<br />
Must be named the same as the texture it will be applied to (for example, mud.tga & mud.shd)<br />
bump<br />
{<br />
'''map''' = mud_n.tga ''(normal map filename, specular level must be in alpha channel)''<br />
'''repetitions''' = 46<br />
}<br />
<br />
specular<br />
{<br />
'''shininess''' = 12 ''(sharpness of the specular highlight)''<br />
}<br />
<br />
Please note that if "repetitions" is missing it is automatically set to 1. If, instead, it is explicitly set to 0 then the texture repetitions are used.<br />
<br />
===Masks===<br />
If you want to use a tiled ground texture, you can use a mask to specify on which parts of the terrain it should appear.<br/><br />
The mask '''MUST BE IN THE ALPHA CHANNEL''' of the dedicated mask tga. All colour channels are ignored.<br/><br />
Then you can assign it to the correct texture layer in the HMF file:<br/><br />
layer1<br />
{<br />
map = mud.tga<br />
repetitions = 50<br />
mask = mud_mask.tga<br />
thickness = 0.1<br />
}<br />
The base layer ('''layer0''') should not have a mask.<br />
<br />
==TerrainEd==<br />
TerrainEd is a command-line program.<br />
It is needed to generate a '''.map''' (graphics) file and a '''.trh''' (collisions) file.<br />
Shadows are generated automatically during the .map export.<br />
Arguments:<br />
TerrainEd inputfile outputfile [params]<br />
<br />
===params.ini===<br />
Here you can change light / shadows settings.<br />
[params]<br />
'''lightdir_x''' = 2 ''(position of the sun east)''<br />
'''lightdir_y''' = 10 ''(position of the sun up [can be left at 10 usually])''<br />
'''lightdir_z''' = -7 ''(position of th sun north)''<br />
'''shadowvolumes_create''' = 1 ''(enable shadow volumes generation, turn off for faster exports for testing)'' <br />
'''shadowvolumes_supersampling''' = 4 ''(quality of the shadow volumes, can usually be left at 4)''<br />
'''shadowmaps_create''' = 1 ''(enable shadows generation, turn off for faster exports for testing)'' <br />
'''shadowmaps_scale''' = 0.2 ''(can usually be left at 0.2)''<br />
'''shadowmaps_supersampling''' = 4 ''(quality of the shadow volumes, reduce for faster exports)''<br />
'''shadowmaps_terraincast''' = 1 ''(the terrain self-casts shadows)''<br />
<br />
*Run '''map.bat''' to generate a track.map file<br />
*Run '''trh.bat''' to generate a track.trh file<br />
<br />
Rename these files to your chosen track name.<br />
<br />
==TrackEd==<br />
*Open your .trh file in tracked.<br />
*You will need to create a centerline, merge it, and then save the trh.<br />
*You must place the pits, starting gates, finish line, and pitboards.<br />
*You can also place marshals and replay cameras.<br />
*For instructions on using TrackEd, go here: [[TrackEd]]<br />
<br />
==Environment Sounds==<br />
It is possible to place sounds sources around a track, creating a text file with SSC extension in the track folder.<br />
numsources = 3<br />
source0<br />
{<br />
data = *crowd.wav<br />
pos = 0,0,0<br />
mindistance = 10<br />
}<br />
source1<br />
{<br />
data = *crowd.wav<br />
pos = 1,1,1<br />
mindistance = 10<br />
}<br />
source2<br />
{<br />
data = test.wav<br />
pos = 2,2,2<br />
mindistance = 5<br />
}<br />
''mindistance'' is the distance under which volume is the max.<br/><br />
Samples must be in '''.wav''' format and mono channel.<br/><br />
The files must be placed in the track folder.<br />
If the filename has a '''*''' prefix, then the file must be placed in the '''effects/sounds/''' directory.<br />
<br />
==Extra Files==<br />
*If desired, you can adjust the sun position & colour, fog amount & colour, ambient light colour, and sky rotation 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.<br />
*You should edit the .ini file to change the track name, author, location etc.<br />
*Update the track.tga screenshot and the track_map.tga.<br />
*Use the skies provided, or create new skydomes.<br />
<br />
==Packing==<br />
:All final track files should go in a folder of the same name.<br />
:For example, mytrack/<br />
<br />
You should have the following files in the folder:<br />
<br />
mytrack.map ''(track graphics)''<br />
mytrack.trh ''(track collision)''<br />
mytrack.rdf ''(race data - pits, startgates, finishline etc.)''<br />
mytrack.ini ''(track information)''<br />
mytrack.tsc ''(trackside cameras)''<br />
mytrack.amb ''(lighting and environment settings)''<br />
mytrack_map.tga ''(map of the track for the UI)''<br />
mytrack.tga ''(screenshot of the track for the UI)''<br />
clearsky.edf ''(sunny skydome)''<br />
cloudysky.edf ''(cloudy skydome)''<br />
rainysky.edf ''(rainy skydome'')<br />
gate.edf ''(starting gate model)''<br />
marshals.cfg ''(trackside marshals placement file)''<br />
<br />
:The skies and the gate edf files can be copied from the practice track.<br />
:To test your track in MXB, copy this folder to the '''tracks''' folder in the MX Bikes installation directory.<br />
<br />
==Distribution & Registration==<br />
For distribution, zip up your track folder and rename the zip file to '''.pkz'''. The folder must be zipped, not just the files. Now users only need to drop the single .pkz file into their MX Bikes/tracks folder.<br />
<br />
You can register your track for online records here:<br />
http://www.piboso.com/trackreg/trackreg.php<br />
<br />
Look in code.txt (in the same folder as your trh file) for your unique track code. You only need to enter 'Prev. Track Code' if you are updating a previously registered track.<br />
Once successfully registered, do a couple of laps online and your fastest lap should appear in the records: http://stats.mx-bikes.com/records.php</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Main_Page&diff=134Main Page2020-01-13T15:17:56Z<p>PiBoSo: </p>
<hr />
<div>__NOTOC__<br />
==User Manuals==<br />
<br />
===[[Kart Racing Pro]]===<br />
===[[GP Bikes]]===<br />
===[[World Racing Series]]===<br />
===[[MX Bikes]]===<br />
<br />
==Modding Guides==<br />
===[[Track Creation Guide]]===<br />
===[[MXB Track Creation Guide]]===<br />
===[[Bike Creation Guide]]===<br />
<br />
==Tools Manuals==<br />
===[[FBX2EDF]]===<br />
===[[Track Tools]]===<br />
===[[PaintEd]]===<br />
===[[Dedicated Server]]===<br />
===[[BikeEd]]===<br />
===[[Tyres]]===<br />
===[[Dash]]===<br />
<br />
==Tools & Resources Downloads==<br />
====[http://www.kartracing-pro.com/downloads/tt.zip FBX2EDF, MapView, 3dsmax plugins, TerrainEd, TrackEd]====<br />
====[http://www.kartracing-pro.com/downloads/painted.zip PaintEd]====<br />
====[http://mx-bikes.com/downloads/templates.zip MXB Bike & Rider templates]====<br />
====[http://gp-bikes.com/downloads/gpb_templates.zip GPB Bike & Rider templates]====<br />
====[http://kartracing-pro.com/downloads/krp_templates.zip KRP Kart & Driver templates]====<br />
====[http://www.worldracingseries.net/downloads/wrs_templates.zip WRS Cars & Drivers templates]====<br />
====[http://www.kartracing-pro.com/downloads/track_lights.zip Track startlights and pit lights templates]====</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Main_Page&diff=133Main Page2020-01-13T15:00:17Z<p>PiBoSo: /* Tools Manuals */</p>
<hr />
<div>__NOTOC__<br />
==User Manuals==<br />
<br />
===[[Kart Racing Pro]]===<br />
===[[GP Bikes]]===<br />
===[[World Racing Series]]===<br />
===[[MX Bikes]]===<br />
<br />
==Modding Guides==<br />
===[[Track Creation Guide]]===<br />
===[[MXB Track Creation Guide]]===<br />
===[[Bike Creation Guide]]===<br />
<br />
==Tools Manuals==<br />
===[[FBX2EDF]]===<br />
===[[Track Tools]]===<br />
===[[PaintEd]]===<br />
===[[Dedicated Server]]===<br />
===[[BikeEd]]===<br />
===[[Tyres]]===<br />
===[[Dash]]===</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=FBX2EDF&diff=132FBX2EDF2020-01-13T14:58:40Z<p>PiBoSo: Created page with "File:fbx2edf.jpg ==Exporter Options== ====Type==== :'''Mesh''' : Export mesh object ('''.edf''') file :'''Map''' : Export the track geometry, textures & lighting ('''.map..."</p>
<hr />
<div>[[File:fbx2edf.jpg]]<br />
<br />
==Exporter Options==<br />
====Type====<br />
:'''Mesh''' : Export mesh object ('''.edf''') file<br />
:'''Map''' : Export the track geometry, textures & lighting ('''.map''') file for mesh-only tracks<br />
:'''Collision''' : Export the track collision data ('''.trp''') file for meshh-only tracks. Only correctly named objects will be exported (for example, TRKASPH)<br />
<br />
====Merge====<br />
:'''Merge Vertices''' : The tolerance to automatically merge nearby vertices in your mesh<br />
<br />
====Normals====<br />
Normals are automatically converted from the fbx file. However, you can overwrite all normals if necessary using the following options:<br />
:'''Flat shading''' : No smoothing<br />
:'''Recalculate''' : Overwrite smoothing based on the specified angle<br />
<br />
====Shadow Volumes====<br />
Used only when creating Map files to show shadows on vehicles.<br />
:'''Supersampling''' : 1 = no sampling, 2 = 2x 3 = 4x. Higher values are not advised and will take a long time to export.<br />
<br />
====Shadowmaps====<br />
Used only when creating Map files to generate shadows on the track.<br />
:'''Scale''' : 0.1 = Very High, 0.2 = Medium, 0.3 = Low, 0.4 = Very Low. It is advised to use 0.4 for test exports and 0.1 for final exports.<br />
:'''Supersampling''' : 1 = no sampling, 2 = 2x 3 = 4x. Higher values are not advised and will take a long time to export.<br />
<br />
==Converting FBX==<br />
#Click '''Load''' and select your fbx file<br />
#Choose the type of conversion. Select '''Mesh''' for all model files (vehicles, helmets, skydomes etc.). For non-heightmap (road) tracks use '''Map''' and '''Collision'''<br />
#Click the '''Save''' button and name your track file<br />
#Click '''OK''' to start the conversion. You can see the progress notifications in the separate window.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=File:Fbx2edf.jpg&diff=131File:Fbx2edf.jpg2020-01-13T14:30:22Z<p>PiBoSo: </p>
<hr />
<div></div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Export_Plugin&diff=130Export Plugin2020-01-13T14:26:52Z<p>PiBoSo: </p>
<hr />
<div>EDFexp is a legacy exporter for 3DS MAX 2010. For all other software use [[FBX2EDF]]<br />
<br />
==Exporter Options==<br />
:'''Mesh''' : Export Skydomes ('''.edf''') file<br />
:'''Map''' : Export the track geometry, textures & lighting ('''.map''') file. Everything in the scene is exported<br />
:'''Collision''' : Export the track collision data ('''.trp''') file. Only correctly named objects will be exported (for example, TRKASPH)<br />
<br />
==Installation==<br />
#Download the EDFexp plugin<br />
#Place EdfExp2010p.dle in the 3DSMAX plugins folder (typically C:\Program Files\Autodesk\3ds Max 2010\plugins\)<br />
#Load 3DSMAX<br />
<br />
==Exporting Track==<br />
#Delete anything from the scene that you don't want exported - everything in scene is exported including hidden objects.<br />
#Ensure all collidable surfaces and objects are named correctly (refer to Track Creation Rules)<br />
#File -> Export. Select EDFexp from the list. Name your track file, click save. This will bring up the exporter options window.<br />
#For track geometry, you need to generate a graphics '''(MAP)''' file and a collision '''(TRP)''' file. Name all files the same.<br />
#Now you should have 2 files in your export folder, track.map & track.trp. You can now open your track in TrackEd!</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide&diff=129Track Creation Guide2020-01-13T14:23:14Z<p>PiBoSo: </p>
<hr />
<div>:The model must be converted from an fbx file using [[FBX2EDF]] or exported from 3DSMAX (up to version 2010).<br />
:3 different skydome models are required (in separate .edf files): clear sky, cloudy sky, rainy sky.<br />
:1 background model, if desired.<br />
<br />
<br />
==Naming==<br />
<br />
You must name the '''objects''' in a certain way for them to be physically collidable ('''material names are irrelevant''').<br />
<br />
The terrain objects the bike can collide with ( asphalt, grass, kerbs, etc... ) must have the '''TRK''' prefix followed by the material code ( eg: TRKASPH ):<br />
*asphalt -> '''ASPH''' (Use this for main track surface)<br />
*asphalt 2 -> '''BASPH''' (Same as ASPH, but slightly less grip)<br />
*asphalt 3 -> '''CASPH''' (Slightly less grip than BASPH)<br />
*grass -> '''GRAS'''<br />
*concrete -> '''CONC'''<br />
*kerb -> '''KERB'''<br />
*sand -> '''SAND'''<br />
*soil -> '''SOIL'''<br />
*paint -> '''LINE''' (Use for lines at edges of track and painted asphalt, less grip than tarmac, especially with wet)<br />
*artificial turf -> '''TURF'''<br />
<br />
<br />
Wall objects the vehicles can collide with must have the '''WLL''' prefix, followed by the material code ( eg: WLLCONC ):<br />
*concrete -> '''CONC'''<br />
*wire fences -> '''WIRE'''<br />
*tyres -> '''TYRE'''<br />
*armco -> '''ARMC'''<br />
*haybale -> '''HAYB'''<br />
*plastic -> '''PLAS'''<br />
<br />
<br />
To identify surfaces an additional prefix must be added to asphalt/concrete objects name ( eg: PIT_TRKASPH ):<br />
*pit entrance -> '''PITIN_'''<br />
*pit exit -> '''PITOUT_'''<br />
*pit lane -> '''PIT_'''<br />
*non-racing -> '''OFF_'''<br />
<br />
<br />
Groove and skid objects laying over terrain must have '''SKIDS''' prefix. This prevents them from casting shadows, and also makes them non-collidable.<br />
<br />
All paints ( eg: starting grid, start/finish line, pit lines, ... ) lying on track surface must have '''DECAL_''' prefix.<br />
<br />
By default only '''TRK''' and '''WLL''' objects will receive shadows. To force an object as shadows receiver use the '''SHAD_''' prefix (useful for parts of the track which are visible but not drivable).<br />
<br />
To make an object invisible ( but still collidable ) its name must include the keyword '''INVISIBLE''' ( eg: WLLCONCINVISIBLE )<br />
<br />
The crowds must have the '''CROWD''' prefix<br />
<br />
Note: having a single object ( eg: TRKASPH ) or 10.000 ( eg: TRKASPH0000, TRKASPH0001, TRKASPH0002, TRKASPH0003, ... ) is exactly the same, performance-wise.<br />
<br />
==Textures==<br />
<br />
Supported texture formats:<br />
*truecolor '''TGA'''<br />
*truecolor '''BMP'''<br />
*DXT1, DXT3 or DXT5 '''DDS'''<br />
<br />
Every texture must have '''power of 2''' (eg:''' 256, 512, 1024, 2048''') dimensions. They can be rectangular (eg: 32x128)<br />
<br />
Textures with only 2 alpha values (0 and 255) are automatically treated as color-key. It's possible to force it using the prefix '''CK_''' in the texture name (eg: CK_TREE.TGA)<br />
<br />
Trees leafs must have the '''TREE''' string inside the name (eg: CK_TREE.TGA)<br />
<br />
'''For tyre marks, a second texture can be defined using Opacity channel and a secondary UV mapping.''' Textures with alpha channel will be drawn with alpha blending, while ones without alpha channel will be drawn with multiply blending.<br />
<br />
'''For rain puddles (track reflections) a third texture can be set in the Glossiness or Specular Level channel, and a secondary UV mapping.''' The alpha channel is used to define puddles on wet surfaces (asphalt and concrete).<br />
<br />
It is possible to change texture parameters creating a text file with the same name of the texture and extension FLG ( and placed in the same directory ).<br />
<br />
Available flags:<br />
<br />
*'''clampu = 1''' : disables repetitions along U direction<br />
*'''clampv = 1''' : disables repetitions along V direction<br />
*'''nocompress = 1''' : the texture will not be compressed at load time ( use it WISELY )<br />
<br />
==Shaders==<br />
<br />
Shaders are linked to textures. To apply a shader to a texture, create a text file with extensions '''SHD''' in the same directory and the same name of the texture file.<br />
<br />
Specular map must be in alpha channel of normal map. If specular only is required, specular must still be in alpha channel.<br />
<br />
An example shader file that uses a normal map:<br />
<br />
bump<br />
{<br />
map = normal_map.tga<br />
}<br />
specular<br />
{ <br />
shininess = 6<br />
}<br />
<br />
An example shader file that uses specular map only: <br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
An example shader that uses a static cubic reflection:<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
}<br />
<br />
:'''factormin''' : The minimum amount of reflection (looking directly towards the surface)<br />
:'''factormax''' : The maximum amount of reflection (as the viewing angle to the surface increases, reflection will get stronger)<br />
:'''factorexp''' : The falloff curve between min and max<br />
:'''envmap''' :<br />
env.tga is a code that sets base.extension. The loaded files then are:<br />
<br />
:env_back.tga<br />
:env_bottom.tga<br />
:env_front.tga<br />
:env_left.tga<br />
:env_right.tga<br />
:env_top.tga<br />
<br />
All faces must be square and have the same size.<br />
<br />
<br />
It is possible to set<br />
envmap_add = 1<br />
to enable "add" reflection.<br />
<br />
<br />
An example shader that combines reflections and specular:<br />
<br />
specular<br />
{<br />
map = specular_map.tga<br />
shininess = 6<br />
}<br />
<br />
reflection<br />
{<br />
factormin = 0<br />
factormax = 0.9<br />
factorexp = 1.2<br />
envmap = env.tga<br />
map = reflection_map.tga<br />
}<br />
<br />
Reflection map only uses the alpha channel.<br />
<br />
<br />
==3D Grass==<br />
<br />
To enable 3D grass create create a text file with extensions '''GRS''' in the same directory and the same name of the texture file.<br />
<br />
An example:<br />
<br />
max_density = 12<br />
height = 0.15<br />
height_diff = 0.1<br />
width = 0.3<br />
width_diff = 0.03<br />
texture = grass_blades.tga<br />
colormap = grass_color.tga<br />
densitymap = grass_density.tga<br />
<br />
:'''height''' : minimum blades height, in meters<br />
:'''height_diff''' : random height added<br />
:'''texture''' : 4 textures with power of 2 size, for the blades of grass, horizontally packed into one ( for example, 4 128x64 textures packed into one 512x64 )<br />
:'''colormap''' defines the color of the grass blades ( size can and should be lower than the base texture )<br />
:'''densitymap''' (optional) defines the density of grass blades. Only alpha channel is used. White = max_density, black = no grass.<br />
<br />
<br />
==Starting Lights==<br />
<br />
Download the '''[http://www.kartracing-pro.com/downloads/track_lights.zip Track Lights example files]'''<br />
<br />
These files can be used directly in your track, or you can use them as a starting point for you own custom lights.<br />
<br />
Each light surface must be mapped with a texture using the following names:<br />
<br />
:Start red light 1 : '''Starting_LightR1_Off.tga'''<br />
:Start red light 2 : '''Starting_LightR2_Off.tga'''<br />
:Start red light 3 : '''Starting_LightR3_Off.tga'''<br />
:Start red light 4 : '''Starting_LightR4_Off.tga'''<br />
:Start green lights : '''Starting_LightG_Off.tga'''<br />
<br />
:Pit red light : '''Pit_LightR_Off.tga'''<br />
:Pit green light : '''Pit_LightG_Off.tga'''<br />
<br />
A TXT file with the same name of the texture specifies corresponding ON texture.<br />
<br />
==Texture Animation==<br />
<br />
It is possible to create a texture animation of a few frames:<br />
<br />
*Create a text file in the same folder and with the same name of the 1st texture, but with extension .TXT ( for example, screen01.txt )<br />
*Add the name of the other textures of the animations to the TXT file, one texture per line. For example:<br />
screen02.tga<br />
screen03.tga<br />
screen04.tga<br />
screen05.tga<br />
*Export the MAP file<br />
*Create another text file, in the same folder and with the same name of the MAP file, but with extension .SCR<br />
*For each animated texture, add the following structure:<br />
<br />
texture0<br />
{<br />
name = screen01<br />
loop_time = 200<br />
}<br />
<br />
where name is the name of the base texture ( without the extension ), and loop_time is the length of the animation, in milliseconds.<br />
<br />
<br />
==Notes==<br />
<br />
:Walls must lay ( with no lower face ) on the terrain, with no holes.<br />
:Walls ( except wire fences ) must always have the correct width and the upper face.<br />
:All the objects ( walls, bridges, etc... ) must also have the faces invisible from the track.<br />
:The textures with alpha channel should be used carefully; excluding paddock glasses, trees and wire fences all the object should be modelled.<br />
:Trees should be modelled in 3D.<br />
:Leafs' textures should use the CK_ prefix.<br />
:Tyres walls and armcos should have a 3D shape.</div>PiBoSohttps://docs.piboso.com/wiki/index.php?title=Track_Tools&diff=128Track Tools2020-01-10T18:50:24Z<p>PiBoSo: </p>
<hr />
<div>__notoc__<br />
===[[Export Plugin]]===<br />
===[[FBX2EDF]]===<br />
===[[Map Viewer]]===<br />
===[[TrackEd]]===<br />
===[[Track Information]]===<br />
===[[Track Release]]===</div>PiBoSo