HowTo/Build Procedural Track for T:ANE

From TrainzOnline
< HowTo(Difference between revisions)
Jump to: navigation, search
 
(39 intermediate revisions by 5 users not shown)
Line 2: Line 2:
  
 
T:ANE introduces a new track component structure that can be configured to support automatic procedural modification wherever junctions are encountered. To enable this feature a track asset of KIND Procedural-track is required.  Unlike KIND Track, the individual components are exported as separate assets, ideally derived from a single mesh library.
 
T:ANE introduces a new track component structure that can be configured to support automatic procedural modification wherever junctions are encountered. To enable this feature a track asset of KIND Procedural-track is required.  Unlike KIND Track, the individual components are exported as separate assets, ideally derived from a single mesh library.
 +
 +
==Example Assets==
 +
You can download the source assets for this tutorial here. Be sure to get the correct build version for your Trainz installation:
 +
 +
[http://download.trainzportal.com/tutorials/procedural_track_4.5_180428.zip Procedural Track 4.5 v180428 (TANE)]
 +
 +
[http://download.trainzportal.com/tutorials/procedural_track_4.6_180428.zip Procedural Track 4.6 v180428 (Trainz NEXT)]
 +
 +
Use and modify them to create new versions of procedural track for Trainz 4.5 or above. You can import .FBX files into any 3D software to manipulate them to how you want them or simply just update the .tga textures to give the current examples a new look. The structure of the assets should give you a complete working set of procedural track assets to learn and build from.
 +
 +
[[File:protrack_comparison.jpg|1024px]]
 +
 +
Also here are the old example source files that are still handy to look at. Download the source files for the original TANE procedural track "Trk OAK" here: [[File:Trk_Oak.zip]]
 +
 +
 +
==Textures==
 +
You can lay your textures out however you like but it is important to use as few textures as possible. This means atlasing images into a single texture where possible. Our texture setup for this procedural track asset looks like the following:
 +
 +
NOTE: The above examples have normal (can call it summer) and snow versions of our textures. The snow textures are used when the mesh is above the routes snow line.
 +
 +
===Procedural Track 4.5===
 +
[[File:protrack_ballast_450.jpg|1024px]]
 +
 +
[[File:protrack_rail_450.jpg|1024px]]
 +
 +
===Procedural Track 4.6===
 +
[[File:protrack_ballast_460.jpg|1024px]]
 +
 +
[[File:protrack_rail_460.jpg|1024px]]
 +
  
 
==Ballast==
 
==Ballast==
 +
 +
Mesh FBX files in examples above:
 +
- Tracklod0n.FBX
 +
- Tracklod1n.FBX
 +
- Tracklod2n.FBX
 +
  Snow versions:
 +
  - Tracklod0ns.FBX
 +
  - Tracklod1ns.FBX
 +
  - Tracklod2ns.FBX
 +
 +
Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.
 +
 +
[[File:protrack_ballast_mesh.jpg|1024px]]
 +
 +
You can see on lod level 1 and 2 the middle section of the mesh is using the rails.m.tbumptex. This is because we are making it look like the sleepers as the actual sleepers are culled shortly after lod level 1 of the ballast starts to render. Even though lod level 1 and 2 might have more polys or draw calls, we are still gaining a lot in doing so as they are longer in length and also the sleepers and chairs are dropped at these levels which is why we have to make it look like they are still there in the distance.
 +
 +
There are 2 materials used in the ballasts
 +
 +
ballast.m.tbumptex - This is used on each of the lod levels.
 +
 +
rails.m.tbumptex – This is only used on lod level 1 and 2, not lod level 0.
 +
  
 
The ballast spline is the parent or base asset to which the other components are attached using the attached-splines container. Endcaps for the other components can be combined into a single mesh in the parent asset. When converting from a KIND Track asset the existing track-lod-tree can be retained for the ballast spline.  
 
The ballast spline is the parent or base asset to which the other components are attached using the attached-splines container. Endcaps for the other components can be combined into a single mesh in the parent asset. When converting from a KIND Track asset the existing track-lod-tree can be retained for the ballast spline.  
Line 76: Line 128:
 
==Sleepers (Ties)==
 
==Sleepers (Ties)==
  
The sleeper spline is a child of the ballast spline, attached using the attached-splines container in the ballast spline. The spline consists only of 3D sleepers. Meshes can be culled as desired at lower lods simply by specifying no mesh at the low-detail node of the track-lod-tree. To preserve the correct spacing at the desired mesh length some additional tags are available.
+
The sleeper spline is a child of the ballast spline, attached using the attached-splines container in the ballast spline. The spline consists only of 3D sleepers.  
 +
Meshes can be culled as desired at lower lods simply by specifying no mesh at the low-detail node of the track-lod-tree. To preserve the correct spacing at the desired mesh length some additional tags are available.
  
 +
A sleeper in this example is just a rectangle. You can make these meshes detailed as you like as long as you have LODs and your lowest LOD is only a few polys. Since we are working with 10 polys for our rectangle we won’t go beyond LOD0.
 +
 +
Material used: rails.m.tbumptex
 +
 +
===Single Sleeper===
 +
Mesh FBX files:
 +
- SleeperSinglelod0n.FBX
 +
  Snow version:
 +
  - SleeperSinglelod0ns.FBX
 +
 +
Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.
 +
 +
This single sleeper mesh is used for 2 parts of the track. You will find them used in procedural junctions (the sleeper is stretched width ways so be sure your mesh looks good when stretched) and you’ll also find them used rarely during spline points when the length of the “sleepers” mesh doesn’t quite fit.
 +
 +
[[File:protrack_single_sleeper_mesh.jpg|666px]]
 +
 +
===Sleepers===
 +
Mesh FBX files:
 +
- Sleeperslod0n.FBX
 +
  Snow version:
 +
  - Sleeperslod0ns.FBX
 +
 +
Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.
 +
 +
This is our mesh that is used for rendering sleepers outside the conditions of the above single sleeper. The majority of track will use this sleeper mesh. We are only using LOD0 in this example but we recommend creating several LOD levels. As well as decreasing poly counts with your LOD levels you should increase the mesh length with lower LODs also. LOD0 is 3 meters but we could create a 6 meter LOD1 and a 12 meter LOD2 to reduce the number of meshes needed as the distance gets further away from the camera.
 +
 +
[[File:protrack_sleepers_mesh.jpg|564px]]
 
   
 
   
 
<i>Basic configuration of the Sleeper asset is as follows:</i>
 
<i>Basic configuration of the Sleeper asset is as follows:</i>
Line 168: Line 248:
 
==Chairs-left / Chairs-right (Plates)==
 
==Chairs-left / Chairs-right (Plates)==
  
Separate left and right splines for rail chairs or baseplates are children of the ballast spline, attached and laterally offset using the attached-splines container in the ballast spline. These splines consist only of 3D chairs. Configuration is similar to the sleepers spline above in that meshes can be culled as desired at lower lods; and the correct spacing between repeats is achieved using the tags <b>spacing-length-before</b> and <b>spacing-length-after</b> in the asset’s track container. This will also ensure that chairs and sleepers are correctly aligned.
+
Separate left and right splines for rail chairs or baseplates are children of the ballast spline, attached and laterally offset using the attached-splines container in the ballast spline. These splines consist only of 3D chairs.
 +
 
 +
===Single Chair===
 +
Mesh FBX files:
 +
- ChairSingleLeftlod0n.FBX
 +
- ChairSingleRightlod0n.FBX
 +
  Snow version:
 +
  - ChairSingleLeftlod0ns.FBX
 +
  - ChairSingleRightlod0ns.FBX
 +
 
 +
Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.
 +
 
 +
Single Chairs are only used with single sleepers. This means during procedural junctions or to fill small gaps in the sleeper spline calculation. The single chair doesn’t support LOD yet but the internal code culls these single chairs at a set distance to avoid them rendering for long distances from the camera.
 +
 
 +
[[File:protrack_single_chair_mesh.jpg|364px]]
 +
 
 +
===Chairs===
 +
Mesh FBX files:
 +
- ChairsLeftlod0n.FBX
 +
- ChairsLeftlod1n.FBX
 +
- ChairsLeftlod2n.FBX
 +
- ChairsRightlod0n.FBX
 +
- ChairsRightlod1n.FBX
 +
- ChairsRightlod2n.FBX
 +
  Snow versions:
 +
    - ChairsLeftlod0ns.FBX
 +
    - ChairsLeftlod1ns.FBX
 +
    - ChairsLeftlod2ns.FBX
 +
    - ChairsRightlod0ns.FBX
 +
    - ChairsRightlod1ns.FBX
 +
    - ChairsRightlod2ns.FBX
 +
 
 +
Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.
 +
 
 +
The Chairs mesh is used in conjunction with the sleepers mesh. We have 3 LOD levels in this example. LOD0 shows the detail up close and the low LODs show enough for the eye to not notice the transitions in the distance.
 +
 
 +
[[File:protrack_chairs_mesh.jpg|1024px]]
 +
 
 +
===Slidechair===
 +
Mesh FBX files:
 +
- SlideChairLeftlod0n.FBX
 +
- SlideChairRightlod0n.FBX
 +
  Snow versions:
 +
    - SlideChairLeftlod0ns.FBX
 +
    - SlideChairRightlod0ns.FBX
 +
 
 +
Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.
 +
 
 +
The Slide Chair isn’t rendered yet but it’s still important to include them in your procedural track so that when the code is activated they are ready to be used. Slide chairs don’t support LOD yet but the internal code culls them at a set distance to avoid them rendering for long distances from the camera.
 +
 
 +
[[File:protrack_slidechair_mesh.jpg|362px]]
 +
 
 +
Configuration is similar to the sleepers spline above in that meshes can be culled as desired at lower lods; and the correct spacing between repeats is achieved using the tags <b>spacing-length-before</b> and <b>spacing-length-after</b> in the asset’s track container. This will also ensure that chairs and sleepers are correctly aligned.
  
 
<b>fig.e </b>- the correct position of the mesh relative to the origin in the 3D modeling environment.<br>
 
<b>fig.e </b>- the correct position of the mesh relative to the origin in the 3D modeling environment.<br>
Line 242: Line 374:
  
 
Separate left and right splines for rails are children of the ballast spline, attached and laterally offset using the attached-splines container in the ballast spline. At the top LOD the geometry should be segmented at approximately 5cm intervals in the modeler to facilitate precise procedural truncation and bending where rails cross each other at junctions. Note that unlike sleepers and chairs, the same rail mesh is used both on plain line and in junctions.
 
Separate left and right splines for rails are children of the ballast spline, attached and laterally offset using the attached-splines container in the ballast spline. At the top LOD the geometry should be segmented at approximately 5cm intervals in the modeler to facilitate precise procedural truncation and bending where rails cross each other at junctions. Note that unlike sleepers and chairs, the same rail mesh is used both on plain line and in junctions.
 +
 +
===Rails===
 +
Mesh FBX files:
 +
- RailLeftlod0n.FBX
 +
- RailLeftlod1n.FBX
 +
- RailLeftlod2n.FBX
 +
- RailRightlod0n.FBX
 +
- RailRightlod1n.FBX
 +
- RailRightlod2n.FBX
 +
  Snow versions:
 +
    - RailLeftlod0ns.FBX
 +
    - RailLeftlod1ns.FBX
 +
    - RailLeftlod2ns.FBX
 +
    - RailRightlod0ns.FBX
 +
    - RailRightlod1ns.FBX
 +
    - RailRightlod2ns.FBX
 +
 +
Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.
 +
 +
There are 3 LOD levels in this example. LOD0 has several poly sections to it as the procedural track uses it to fit the correct length of track when needed. The other LODs you can see reduce dramatically.
 +
 +
[[File:protrack_rails_mesh.jpg|1024px]]
  
 
<i>Basic configuration of the Rail-left asset is as follows:</i>
 
<i>Basic configuration of the Rail-left asset is as follows:</i>
Line 260: Line 414:
  
  
<i>We adhere to the following naming convention for the meshes:</i>
+
<i>We adhere to the following naming convention for the meshes:</i><br>
[[File:PT img5.png]]<br>
+
[[File:GlobalNamingDiagram.png|800px]]<br>
  
 
==Check Rails==
 
==Check Rails==
  
 
The body of the check rail should be segmented at approximately 10cm intervals to allow for precise procedural bending. The term <b>checkrail</b> is specifically required in the mesh-table, the mesh file itself can be named as desired.
 
The body of the check rail should be segmented at approximately 10cm intervals to allow for precise procedural bending. The term <b>checkrail</b> is specifically required in the mesh-table, the mesh file itself can be named as desired.
 +
 +
Mesh FBX files:
 +
- CheckrailLeftlod0n.FBX
 +
- CheckrailRightlod0n.FBX
 +
  Snow versions:
 +
    - CheckrailLeftlod0ns.FBX
 +
    - CheckrailRightlod0ns.FBX
 +
 +
Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.
 +
 +
The checkrail has several poly sections to it as the procedural track uses it to fit the correct length needed in a procedural junction. The checkrail doesn’t support LOD yet but the internal code culls them at a set distance to avoid them rendering for long distances from the camera.
 +
 +
[[File:protrack_checkrails_mesh.jpg|631px]]
  
 
The correct position of the meshes relative to the origin in the 3D modeling environment:
 
The correct position of the meshes relative to the origin in the 3D modeling environment:
Line 272: Line 439:
 
==Wing Rails==
 
==Wing Rails==
 
As these are procedurally attached to the closure rails, the cross section should therefore be identical to that of the stock / running rails. The body of the wing rail should be segmented at approximately 10cm intervals to allow for precise procedural bending. The term <b>wingrail</b> is specifically required in the mesh-table, the file itself can be named as desired.
 
As these are procedurally attached to the closure rails, the cross section should therefore be identical to that of the stock / running rails. The body of the wing rail should be segmented at approximately 10cm intervals to allow for precise procedural bending. The term <b>wingrail</b> is specifically required in the mesh-table, the file itself can be named as desired.
 +
 +
Mesh FBX files:
 +
- WingrailLeftlod0n.FBX
 +
- WingrailRightlod0n.FBX
 +
  Snow versions:
 +
    - WingrailLeftlod0ns.FBX
 +
    - WingrailRightlod0ns.FBX
 +
 +
Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.
 +
 +
The wingrail has several poly sections to it as the procedural track uses it to fit the correct length needed in a procedural junction. The wingrail doesn’t support LOD yet but the internal code culls them at a set distance to avoid them rendering for long distances from the camera.
 +
 +
[[File:protrack_wingrails_mesh.jpg|604px]]
  
 
<i>The correct position of the meshes relative to the origin in the 3D modeling environment:</i>
 
<i>The correct position of the meshes relative to the origin in the 3D modeling environment:</i>
Line 279: Line 459:
 
==Blades==
 
==Blades==
 
As these are procedurally bent to the required curvature the blades should be modeled straight and segmented at least every 25cm. The length of the tapered section should be roughly 50% of the total blade length. The contour of the tapered edge should be free of any chamfer such that it will mate seamlessly with the stock rail. Note that custom stock rails are not currently supported.
 
As these are procedurally bent to the required curvature the blades should be modeled straight and segmented at least every 25cm. The length of the tapered section should be roughly 50% of the total blade length. The contour of the tapered edge should be free of any chamfer such that it will mate seamlessly with the stock rail. Note that custom stock rails are not currently supported.
 +
 +
===Blades===
 +
 +
Mesh FBX files:
 +
- BladeLeftlod0n.FBX
 +
- BladeRightlod0n.FBX
 +
  Snow versions:
 +
    - BladeLeftlod0ns.FBX
 +
    - BladeRightlod0ns.FBX
 +
 +
Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.
 +
 +
The blade has several poly sections to it as the procedural track uses it to fit the correct length needed in a procedural junction. The blade doesn’t support LOD yet but the internal code culls them at a set distance to avoid them rendering for long distances from the camera.
 +
 +
[[File:protrack_blades_mesh.jpg|631px]]
  
 
Animation must be a simple rotation with a single bone positioned at the origin. In order to be adaptable to a range of junction angles, a rotation of 5° should be employed, clockwise for the right blade, anti-clockwise for the left. Other arrangements are not currently supported. A length of 150 frames is recommended. The animation will be partially played through in game according to the required angle.
 
Animation must be a simple rotation with a single bone positioned at the origin. In order to be adaptable to a range of junction angles, a rotation of 5° should be employed, clockwise for the right blade, anti-clockwise for the left. Other arrangements are not currently supported. A length of 150 frames is recommended. The animation will be partially played through in game according to the required angle.
Line 285: Line 480:
  
 
[[File:PT img8.png]]<Br>
 
[[File:PT img8.png]]<Br>
 +
 +
===Stretcher===
 +
 +
Mesh FBX files:
 +
- Stretcherlod0n.FBX
 +
  Snow version:
 +
    - Stretcherlod0ns.FBX
 +
 +
Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.
 +
 +
The Stretcher doesn’t support LOD yet but the internal code culls them at a set distance to avoid them rendering for long distances from the camera.
 +
 +
[[File:protrack_stretcher_mesh.jpg|444px]]
 +
  
 
Stretcher:  Also known as a ‘tie bar’. Animation is required to be a simple translation of 0.5 metres along the positive X axis with a single bone positioned at the origin. Other arrangements are not currently supported.  A length of 150 frames is recommended to match that of the blade animation. The animation will be partially played through in game according to the required distance.
 
Stretcher:  Also known as a ‘tie bar’. Animation is required to be a simple translation of 0.5 metres along the positive X axis with a single bone positioned at the origin. Other arrangements are not currently supported.  A length of 150 frames is recommended to match that of the blade animation. The animation will be partially played through in game according to the required distance.
Line 353: Line 562:
 
Additional tags are available for specifying some critical dimensions of rail-left and rail-right components:
 
Additional tags are available for specifying some critical dimensions of rail-left and rail-right components:
  
 +
<b>track-condition </b>- (TOP LEVEL SPLINE) This is the smoothness of the track, 0% being terrible, 100% being perfect. Without this tag, the track defaults to 50%.<br>
 
<b>check-gauge </b>- (TOP LEVEL SPLINE) This is the distance between the inside face of one running rail, and the outside face of the check rail positioned next to the other running rail.<br>
 
<b>check-gauge </b>- (TOP LEVEL SPLINE) This is the distance between the inside face of one running rail, and the outside face of the check rail positioned next to the other running rail.<br>
<b>sleepers-orientation</b> - (TOP LEVEL SPLINE) the way the unified sleepers at the junction are oriented by default (later, it will be possible to override this setting per junction in the interface). The possible values for this tag are “average” (average direction of the two tracks) or “straightest” (follow the direction of the straightest track).
+
<b>sleepers-orientation</b> - (TOP LEVEL SPLINE) the way the unified sleepers at the junction are oriented by default (later, it will be possible to override this setting per junction in the interface). The possible values for this tag are “average” (average direction of the two tracks) or “straightest” (follow the direction of the straightest track).<br>
 
<b>rail-width </b>- (RAIL SPLINE) Width over the head of the rail. see fig.n below<br>
 
<b>rail-width </b>- (RAIL SPLINE) Width over the head of the rail. see fig.n below<br>
 
<b>checkrail-body-length</b> - (RAIL SPLINE) Length of the ‘body’ section of the check rail. This is the straight part, not including the flared ends.  see fig.g  above<br>
 
<b>checkrail-body-length</b> - (RAIL SPLINE) Length of the ‘body’ section of the check rail. This is the straight part, not including the flared ends.  see fig.g  above<br>
 
<b>wingrail-body-length </b>- (RAIL SPLINE) Length of the ‘body’ section of the wing rail. This is the straight part, not including the flared end.  see fig.i  above<br>
 
<b>wingrail-body-length </b>- (RAIL SPLINE) Length of the ‘body’ section of the wing rail. This is the straight part, not including the flared end.  see fig.i  above<br>
<b>blade-smallest-width </b>- (RAIL SPLINE) Minimum width of the head of the blade rail.  see fig.k  above
+
<b>blade-smallest-width </b>- (RAIL SPLINE) Minimum width of the head of the blade rail.  see fig.k  above<br>
 
<b>blade-taper-length </b>- (RAIL SPLINE) the length of the taper of the blade. see fig.k<br>
 
<b>blade-taper-length </b>- (RAIL SPLINE) the length of the taper of the blade. see fig.k<br>
 
<b>sleeper-pitch </b>- (SLEEPERS SPLINE) Distance from the center of a sleeper to the next sleeper, see fig in the sleepers section. Note : this value is just used for the custom sleepers positioning as an indication, it may be scaled according to the tracks configuration.<br>
 
<b>sleeper-pitch </b>- (SLEEPERS SPLINE) Distance from the center of a sleeper to the next sleeper, see fig in the sleepers section. Note : this value is just used for the custom sleepers positioning as an indication, it may be scaled according to the tracks configuration.<br>
Line 367: Line 577:
 
[[File:PT img10.png]]<Br>
 
[[File:PT img10.png]]<Br>
 
[[File:PT img11.png]]<Br>
 
[[File:PT img11.png]]<Br>
 +
 
==Future improvements==
 
==Future improvements==
  
Line 380: Line 591:
 
* Additional junction types including diamond crossings etc.
 
* Additional junction types including diamond crossings etc.
  
=Example Config File=
+
=Example Config Files=
Following are the config files for each of the track components:
+
Following are the config files for each of the track components:<br>
 
<kuid2:30501:1001:10> TANE Trk Oak
 
<kuid2:30501:1001:10> TANE Trk Oak
  
Line 398: Line 609:
 
check-gauge                            1.395
 
check-gauge                            1.395
 
sleepers-orientation                    "average"
 
sleepers-orientation                    "average"
 +
track-condition                        0.9
  
 
mesh-table
 
mesh-table
Line 1,489: Line 1,701:
 
  </nowiki>
 
  </nowiki>
  
=See Also=
+
=Trouble Shooting=
 +
 
 +
This information might help you to determine a fix for any of the below visuals issues, warnings or errors:
 +
 
 +
 
 +
'''VE189: Collision data exceeds 64KB and has been simplified. Consider using a different generation method or a simplified mesh.'''
 +
 
 +
*Try adding a "[["mesh-table"_container#collision-data-generation-mode|collision-data-generation-mode]]" tag for the mesh in question as there are several options to choose from to generate a collision mesh that is less complex.
 +
 
 +
or;
 +
 
 +
*You can add the "[[KIND_Track#enable-pfx-collisions|enable-pfx-collisions]]" tag to the root of the config.txt and give it a 0 value to turn off collision.
 +
 
 +
 
 +
'''Ballast Stretching'''
 +
 
 +
[[File:ballast_stretching.jpg|626px]]
 +
 
 +
If you are seeing stretched track in your track placement you can try the following:
 +
- inserting spline points to adjust the track spline length (note this could mess with existing sessions)
 +
 
 +
- move the spline points to adjust the track spline length (note this could mess with existing sessions)
 +
 
 +
- add the tag [http://online.ts2009.com/mediaWiki/index.php/Track_Part_Container#padding-length padding-length] to your kind "procedural-track", track-type "ballast" in the track-lod-tree container.
 +
  You might want to set padding-length to the length of your highest ballast LOD (i.e your shortest ballast mesh).
 +
 
 +
=Return to Index=
 +
 +
[[HowToGuides|<< How To Guides]]
  
[[TrainzOnline:HowToGuides]]
+
[[Category:How-to guides]]
[[Category:Help]]
+

Latest revision as of 15:20, 8 October 2019

Contents

[edit] Track Asset Requirements for Procedural Junction Support

T:ANE introduces a new track component structure that can be configured to support automatic procedural modification wherever junctions are encountered. To enable this feature a track asset of KIND Procedural-track is required. Unlike KIND Track, the individual components are exported as separate assets, ideally derived from a single mesh library.

[edit] Example Assets

You can download the source assets for this tutorial here. Be sure to get the correct build version for your Trainz installation:

Procedural Track 4.5 v180428 (TANE)

Procedural Track 4.6 v180428 (Trainz NEXT)

Use and modify them to create new versions of procedural track for Trainz 4.5 or above. You can import .FBX files into any 3D software to manipulate them to how you want them or simply just update the .tga textures to give the current examples a new look. The structure of the assets should give you a complete working set of procedural track assets to learn and build from.

Protrack comparison.jpg

Also here are the old example source files that are still handy to look at. Download the source files for the original TANE procedural track "Trk OAK" here: File:Trk Oak.zip


[edit] Textures

You can lay your textures out however you like but it is important to use as few textures as possible. This means atlasing images into a single texture where possible. Our texture setup for this procedural track asset looks like the following:

NOTE: The above examples have normal (can call it summer) and snow versions of our textures. The snow textures are used when the mesh is above the routes snow line.

[edit] Procedural Track 4.5

Protrack ballast 450.jpg

Protrack rail 450.jpg

[edit] Procedural Track 4.6

Protrack ballast 460.jpg

Protrack rail 460.jpg


[edit] Ballast

Mesh FBX files in examples above:

- Tracklod0n.FBX
- Tracklod1n.FBX
- Tracklod2n.FBX
  Snow versions:
  - Tracklod0ns.FBX
  - Tracklod1ns.FBX
  - Tracklod2ns.FBX

Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.

Protrack ballast mesh.jpg

You can see on lod level 1 and 2 the middle section of the mesh is using the rails.m.tbumptex. This is because we are making it look like the sleepers as the actual sleepers are culled shortly after lod level 1 of the ballast starts to render. Even though lod level 1 and 2 might have more polys or draw calls, we are still gaining a lot in doing so as they are longer in length and also the sleepers and chairs are dropped at these levels which is why we have to make it look like they are still there in the distance.

There are 2 materials used in the ballasts

ballast.m.tbumptex - This is used on each of the lod levels.

rails.m.tbumptex – This is only used on lod level 1 and 2, not lod level 0.


The ballast spline is the parent or base asset to which the other components are attached using the attached-splines container. Endcaps for the other components can be combined into a single mesh in the parent asset. When converting from a KIND Track asset the existing track-lod-tree can be retained for the ballast spline.

The correct position of the mesh relative to the origin in the 3D modeling environment. Spline rendering starts at the origin and proceeds along the -Y axis:

PT img1.png


Basic configuration of the Ballast asset is as follows:

kind                                	"procedural-track"
istrack                             	1
trainz-build                        	3.9
track-type                          	"ballast"
 

The attached splines container is configured as follows:

attached-splines
{

  sleepers
  {
	lateral-offset                  	0
	use-same-direction              	1
	spline-kuid                     	<kuid:523:19723515>
	visual-only                     	1
  }

  chairs_left
  {
	lateral-offset                  	-0.751
	use-same-direction              	1
	spline-kuid                     	<kuid:523:19723516>
	visual-only                     	1
  }
 
  chairs_right
  {
	lateral-offset                  	0.751
	use-same-direction              	1
	spline-kuid                     	<kuid:523:19723517>
	visual-only                     	1
  }

 
 rails_left
  {
	lateral-offset                  	-0.751
	use-same-direction              	1
	spline-kuid                     	<kuid:523:19723518>
	visual-only                     	1
  }
 
  rails_right
  {
	lateral-offset                  	0.751
	use-same-direction              	1
	spline-kuid                     	<kuid:523:19723519>
	visual-only                     	1
  }
}
 

lateral-offset: defines the number of metres that the child spline is offset sideways from its parent's origin. Positive values offset to the right, and negative values offset to the left.

use-same-direction: causes the child spline to face in the same direction as the parent. (see on the wiki)

spline-kuid: unique identifier for the attached spline asset.

visual-only: Removes the functional aspects of the child spline, preventing for example, the ballast and the rail splines being treated as separate stretches of track. Also prevents undesired manual editing of the individual components in Surveyor.

[edit] Sleepers (Ties)

The sleeper spline is a child of the ballast spline, attached using the attached-splines container in the ballast spline. The spline consists only of 3D sleepers. Meshes can be culled as desired at lower lods simply by specifying no mesh at the low-detail node of the track-lod-tree. To preserve the correct spacing at the desired mesh length some additional tags are available.

A sleeper in this example is just a rectangle. You can make these meshes detailed as you like as long as you have LODs and your lowest LOD is only a few polys. Since we are working with 10 polys for our rectangle we won’t go beyond LOD0.

Material used: rails.m.tbumptex

[edit] Single Sleeper

Mesh FBX files:

- SleeperSinglelod0n.FBX
  Snow version:
  - SleeperSinglelod0ns.FBX

Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.

This single sleeper mesh is used for 2 parts of the track. You will find them used in procedural junctions (the sleeper is stretched width ways so be sure your mesh looks good when stretched) and you’ll also find them used rarely during spline points when the length of the “sleepers” mesh doesn’t quite fit.

Protrack single sleeper mesh.jpg

[edit] Sleepers

Mesh FBX files:

- Sleeperslod0n.FBX
  Snow version:
  - Sleeperslod0ns.FBX

Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.

This is our mesh that is used for rendering sleepers outside the conditions of the above single sleeper. The majority of track will use this sleeper mesh. We are only using LOD0 in this example but we recommend creating several LOD levels. As well as decreasing poly counts with your LOD levels you should increase the mesh length with lower LODs also. LOD0 is 3 meters but we could create a 6 meter LOD1 and a 12 meter LOD2 to reduce the number of meshes needed as the distance gets further away from the camera.

Protrack sleepers mesh.jpg

Basic configuration of the Sleeper asset is as follows:

kind                                	"procedural-track"
istrack                             	0
trainz-build                        	3.9
track-type                          	"sleepers"

 

The mesh-table for the sleeper asset includes a single sleeper instance which is used by the procedural junction system. The sleeper_single mesh is not referenced through the track-lod-tree. The term sleeper_single is specifically required in the mesh-table, the mesh file itself can be named as desired. The sleeper_single mesh is always used under junctions, the track-lod-tree is always used when not inside a junction. For this reason, we recommend you provide different lengths of spline section in the track-lod-tree, including down to a single sleeper length.

We do not currently support LOD on the sleeper_single mesh. This is planned in future. Do not use a .lm.txt file - this will stop the track from stitching, and make it slower.

mesh-table
{
  sleepers-lod0
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"sleepers_lod0.im"
  }
 
  sleepers-lod1
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"sleepers_lod1.im"
  }
 
  sleeper_single
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"sleeper_single.im"
  }
}

 

Some extra tags in the track container are used to set the desired position of the sleeper mesh...

fig.b - the correct position of the mesh relative to the origin in the 3D modeling environment.
fig.c - the position as adjusted in the spline’s track container for correct sleeper spacing.
PT img2.png
Note the use of the tags spacing-length-before and spacing-length-after in the track container below. Note also that no mesh has been specified at the lowest detail node in the track-lod-tree. This can be used to transition from 3D sleepers to 2D sleepers that are simply textured on to the ballast spline.

track
{
  mesh-length                       	                3
  spacing-length-before             	0.2
  spacing-length-after              	0.2
 
  track-lod-tree
  {
     lod-distance                    	              200
	
     high-detail
     {
         lod-distance                                 50
  	
         high-detail
         {
            mesh                                        "track-lod0"
         }
  	
         low-detail
         {
         mesh                        	               "track-lod1"
         }
     }
	
     low-detail
     {
     }
  }
 

PT img3a.png

The tag sleeper-pitch determines the spacing of single sleepers at junctions. It is measured from the centre of a sleeper to the centre of the next sleeper. The sleeper-pitch is only used for the junctions. It is not relevant for plain line tracks.


The privileges container is used to prevent the asset from being displayed in the Surveyor asset picker:

privileges
{
  permit-listing                    	0
}
 

[edit] Chairs-left / Chairs-right (Plates)

Separate left and right splines for rail chairs or baseplates are children of the ballast spline, attached and laterally offset using the attached-splines container in the ballast spline. These splines consist only of 3D chairs.

[edit] Single Chair

Mesh FBX files:

- ChairSingleLeftlod0n.FBX
- ChairSingleRightlod0n.FBX
  Snow version:
  - ChairSingleLeftlod0ns.FBX
  - ChairSingleRightlod0ns.FBX

Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.

Single Chairs are only used with single sleepers. This means during procedural junctions or to fill small gaps in the sleeper spline calculation. The single chair doesn’t support LOD yet but the internal code culls these single chairs at a set distance to avoid them rendering for long distances from the camera.

Protrack single chair mesh.jpg

[edit] Chairs

Mesh FBX files:

- ChairsLeftlod0n.FBX
- ChairsLeftlod1n.FBX
- ChairsLeftlod2n.FBX
- ChairsRightlod0n.FBX
- ChairsRightlod1n.FBX
- ChairsRightlod2n.FBX
  Snow versions:
   - ChairsLeftlod0ns.FBX
   - ChairsLeftlod1ns.FBX
   - ChairsLeftlod2ns.FBX
   - ChairsRightlod0ns.FBX
   - ChairsRightlod1ns.FBX
   - ChairsRightlod2ns.FBX

Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.

The Chairs mesh is used in conjunction with the sleepers mesh. We have 3 LOD levels in this example. LOD0 shows the detail up close and the low LODs show enough for the eye to not notice the transitions in the distance.

Protrack chairs mesh.jpg

[edit] Slidechair

Mesh FBX files:

- SlideChairLeftlod0n.FBX
- SlideChairRightlod0n.FBX
  Snow versions:
   - SlideChairLeftlod0ns.FBX
   - SlideChairRightlod0ns.FBX

Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.

The Slide Chair isn’t rendered yet but it’s still important to include them in your procedural track so that when the code is activated they are ready to be used. Slide chairs don’t support LOD yet but the internal code culls them at a set distance to avoid them rendering for long distances from the camera.

Protrack slidechair mesh.jpg

Configuration is similar to the sleepers spline above in that meshes can be culled as desired at lower lods; and the correct spacing between repeats is achieved using the tags spacing-length-before and spacing-length-after in the asset’s track container. This will also ensure that chairs and sleepers are correctly aligned.

fig.e - the correct position of the mesh relative to the origin in the 3D modeling environment.
fig.f - the position as adjusted in the spline’s track container for correct chair spacing.
PT img3.png


Basic configuration of the Chairs-left asset is as follows:

kind                                	"procedural-track"
istrack                             	0
trainz-build                        	3.9
track-type                          	"chairs-left"
 

Basic configuration of the Chairs-right asset is as follows:

kind                                	"procedural-track"
istrack                             	0
trainz-build                        	3.9
track-type                          	"chairs-right"

 

The mesh-tables for the chair assets include a single chair instance which is used by the procedural junction system where multiple rails are in close proximity to allow for precise control over angle and position. The single chair mesh is not referenced in the track-lod-tree.

The term chair_single is specifically required in the mesh-table, the mesh file itself can be named as desired. The chair_single is always and only used with the single_sleeper.

A slide-chair for supporting the turnout blade is also included in the mesh-table for each chair asset. This must have the same height as a regular chair.

The term blade_slidechair is specifically required in the mesh-table, the mesh file itself can be named as desired. The blade_slidechair will be used in the future, but it can be provided now so the assets won’t need to be updated. The blade_slidechair is provided in the same format as the chair_single, and will attach to the stock rail.

PT img4.png

mesh-table
{
  chairs-left-lod0
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"chairs_left_lod0.im"
  }
 
   chairs-left-lod1
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"chairs_left_lod1.im"
  }
 
 chair_single
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"chair_left_single.im"
  }

 blade_slidechair
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"slidechair_left.im"
  }
}
 

The privileges container is used to prevent the assets from being displayed in the Surveyor asset picker:

privileges
{
  permit-listing                    	0
}
 

[edit] Rail-left / Rail-right

Separate left and right splines for rails are children of the ballast spline, attached and laterally offset using the attached-splines container in the ballast spline. At the top LOD the geometry should be segmented at approximately 5cm intervals in the modeler to facilitate precise procedural truncation and bending where rails cross each other at junctions. Note that unlike sleepers and chairs, the same rail mesh is used both on plain line and in junctions.

[edit] Rails

Mesh FBX files:

- RailLeftlod0n.FBX
- RailLeftlod1n.FBX
- RailLeftlod2n.FBX
- RailRightlod0n.FBX
- RailRightlod1n.FBX
- RailRightlod2n.FBX
  Snow versions:
   - RailLeftlod0ns.FBX
   - RailLeftlod1ns.FBX
   - RailLeftlod2ns.FBX
   - RailRightlod0ns.FBX
   - RailRightlod1ns.FBX
   - RailRightlod2ns.FBX

Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.

There are 3 LOD levels in this example. LOD0 has several poly sections to it as the procedural track uses it to fit the correct length of track when needed. The other LODs you can see reduce dramatically.

Protrack rails mesh.jpg

Basic configuration of the Rail-left asset is as follows:

kind                                	"procedural-track"
istrack                             	0
trainz-build                        	3.9
track-type                          	"rail-left"
 

Basic configuration of the Rail-right asset is as follows:

kind                                	"procedural-track"
istrack                             	0
trainz-build                        	3.9
track-type                          	"rail-right"
 

The mesh-tables for the rail assets include the remaining components required to form the turnouts...


We adhere to the following naming convention for the meshes:
GlobalNamingDiagram.png

[edit] Check Rails

The body of the check rail should be segmented at approximately 10cm intervals to allow for precise procedural bending. The term checkrail is specifically required in the mesh-table, the mesh file itself can be named as desired.

Mesh FBX files:

- CheckrailLeftlod0n.FBX
- CheckrailRightlod0n.FBX
  Snow versions:
   - CheckrailLeftlod0ns.FBX
   - CheckrailRightlod0ns.FBX

Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.

The checkrail has several poly sections to it as the procedural track uses it to fit the correct length needed in a procedural junction. The checkrail doesn’t support LOD yet but the internal code culls them at a set distance to avoid them rendering for long distances from the camera.

Protrack checkrails mesh.jpg

The correct position of the meshes relative to the origin in the 3D modeling environment: PT img7.png

[edit] Wing Rails

As these are procedurally attached to the closure rails, the cross section should therefore be identical to that of the stock / running rails. The body of the wing rail should be segmented at approximately 10cm intervals to allow for precise procedural bending. The term wingrail is specifically required in the mesh-table, the file itself can be named as desired.

Mesh FBX files:

- WingrailLeftlod0n.FBX
- WingrailRightlod0n.FBX
  Snow versions:
   - WingrailLeftlod0ns.FBX
   - WingrailRightlod0ns.FBX

Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.

The wingrail has several poly sections to it as the procedural track uses it to fit the correct length needed in a procedural junction. The wingrail doesn’t support LOD yet but the internal code culls them at a set distance to avoid them rendering for long distances from the camera.

Protrack wingrails mesh.jpg

The correct position of the meshes relative to the origin in the 3D modeling environment:

PT img6.png

[edit] Blades

As these are procedurally bent to the required curvature the blades should be modeled straight and segmented at least every 25cm. The length of the tapered section should be roughly 50% of the total blade length. The contour of the tapered edge should be free of any chamfer such that it will mate seamlessly with the stock rail. Note that custom stock rails are not currently supported.

[edit] Blades

Mesh FBX files:

- BladeLeftlod0n.FBX
- BladeRightlod0n.FBX
  Snow versions:
   - BladeLeftlod0ns.FBX
   - BladeRightlod0ns.FBX

Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.

The blade has several poly sections to it as the procedural track uses it to fit the correct length needed in a procedural junction. The blade doesn’t support LOD yet but the internal code culls them at a set distance to avoid them rendering for long distances from the camera.

Protrack blades mesh.jpg

Animation must be a simple rotation with a single bone positioned at the origin. In order to be adaptable to a range of junction angles, a rotation of 5° should be employed, clockwise for the right blade, anti-clockwise for the left. Other arrangements are not currently supported. A length of 150 frames is recommended. The animation will be partially played through in game according to the required angle.

The term blade is specifically required in the mesh-table, the mesh and animation files can be named as desired.

PT img8.png

[edit] Stretcher

Mesh FBX files:

- Stretcherlod0n.FBX
  Snow version:
   - Stretcherlod0ns.FBX

Found in asset “<kuid:661281:44147> Procedural Track 4.5 - Library” or asset "<kuid:661281:44154> Procedural Track 4.6 - Library" depending on the example you are following.

The Stretcher doesn’t support LOD yet but the internal code culls them at a set distance to avoid them rendering for long distances from the camera.

Protrack stretcher mesh.jpg


Stretcher: Also known as a ‘tie bar’. Animation is required to be a simple translation of 0.5 metres along the positive X axis with a single bone positioned at the origin. Other arrangements are not currently supported. A length of 150 frames is recommended to match that of the blade animation. The animation will be partially played through in game according to the required distance.

The term blade_stretcher is specifically required in the mesh-table, the mesh and animation files can be named as desired.

The correct position of the mesh relative to the origin in the 3D modeling environment:
PT img9.png

mesh-table
{
  rail-left-lod0
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"rail_left_lod0.im"
  }
 
  rail-left-lod1
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"rail_left_lod1.im"
  }
 
  rail-left-lod2
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"rail_left_lod2.im"
  }
 
  wingrail
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"wingrail_left.im"
  }
 
  checkrail
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"checkrail_left.im"
  }
 
  blade
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"blade_left.im"
	anim                            	"blade_left.kin"
  }
 
  blade_stretcher
  {
	mesh-asset                      	<kuid:523:19723520>
	mesh                            	"stretcher.im"
	anim                            	"stretcher.kin"
  }
}
 

The privileges container is used to prevent the assets from being displayed in the Surveyor asset picker:

privileges
{
  permit-listing                    	0
}
 

Additional tags are available for specifying some critical dimensions of rail-left and rail-right components:

track-condition - (TOP LEVEL SPLINE) This is the smoothness of the track, 0% being terrible, 100% being perfect. Without this tag, the track defaults to 50%.
check-gauge - (TOP LEVEL SPLINE) This is the distance between the inside face of one running rail, and the outside face of the check rail positioned next to the other running rail.
sleepers-orientation - (TOP LEVEL SPLINE) the way the unified sleepers at the junction are oriented by default (later, it will be possible to override this setting per junction in the interface). The possible values for this tag are “average” (average direction of the two tracks) or “straightest” (follow the direction of the straightest track).
rail-width - (RAIL SPLINE) Width over the head of the rail. see fig.n below
checkrail-body-length - (RAIL SPLINE) Length of the ‘body’ section of the check rail. This is the straight part, not including the flared ends. see fig.g above
wingrail-body-length - (RAIL SPLINE) Length of the ‘body’ section of the wing rail. This is the straight part, not including the flared end. see fig.i above
blade-smallest-width - (RAIL SPLINE) Minimum width of the head of the blade rail. see fig.k above
blade-taper-length - (RAIL SPLINE) the length of the taper of the blade. see fig.k
sleeper-pitch - (SLEEPERS SPLINE) Distance from the center of a sleeper to the next sleeper, see fig in the sleepers section. Note : this value is just used for the custom sleepers positioning as an indication, it may be scaled according to the tracks configuration.
track-gauge - (TOP LEVEL SPLINE) Distance between the inner faces of the running rails. see fig.o below It's the 'real railway' way of measuring this - and is done this way because the actual track gauge can, and does, vary, but this distance must not expand with a widened track gauge.

Consequently, people will find this number published and discussed, but the actual dimension you want is not generally published.
PT img10.png
PT img11.png

[edit] Future improvements

This document provides the format for the first version of the procedural assets. The next version will bring, amongst others, these main improvements :

  • Less restrictions on the blades animations and meshes
  • The slide chairs are required in the asset but they are currently not displayed : this feature will be enabled by a future patch. However, you can already include the slide chairs meshes in your assets so they won’t require any update when this feature will be enabled.
  • Non-uniform spacing of sleepers is currently not supported. We will be looking at this issue in more detail.
  • Additional junction types including diamond crossings etc.

[edit] Example Config Files

Following are the config files for each of the track components:
<kuid2:30501:1001:10> TANE Trk Oak


kuid                                    <kuid2:30501:1001:10>
username                                "TANE Trk Oak"
kind                                    "procedural-track"
istrack                                 1
trainz-build                            3.9
category-era                            "1920s"
category-class                          "TR"
category-region                         "00"
track-type                              "ballast"
track-gauge                             1.436
check-gauge                             1.395
sleepers-orientation                    "average"
track-condition                         0.9

mesh-table
{
  track-lod0
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "track_lod0.im"
  }
  
  track-lod1
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "track_lod1.im"
  }
  
  track-lod2
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "track_lod2.im"
  }
  
  track-lod3
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "track_lod3.im"
  }
  
  endcap_prev
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "endcap_lod0.im"
  }
  
  endcap_next
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "endcap1_lod0.im"
  }
  
  endcap_prev_lo
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "endcap_lod1.im"
  }
  
  endcap_next_lo
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "endcap1_lod1.im"
  }
}

track
{
  mesh-length                           18
  adjust-cross-section-to-ground        0
  
  track-lod-tree
  {
    lod-distance                        400
    
    high-detail
    {
      subdivisions                      3
      lod-distance                      45
      
      high-detail
      {
        lod-distance                    10
        subdivisions                    2
        
        high-detail
        {
          mesh                          "track-lod0"
        }
        
        low-detail
        {
          mesh                          "track-lod1"
        }
      }
      
      low-detail
      {
        mesh                            "track-lod2"
      }
    }
    
    low-detail
    {
      mesh                              "track-lod3"
    }
  }
}

endcap-prev
{
  mesh-length                           0.82
  adjust-cross-section-to-ground        0
  
  track-lod-tree
  {
    lod-distance                        400
    
    high-detail
    {
      lod-distance                      100
      
      high-detail
      {
        lod-distance                    10
        
        high-detail
        {
          mesh                          "endcap_prev"
        }
        
        low-detail
        {
          mesh                          "endcap_prev_lo"
        }
      }
      
      low-detail
      {
      }
    }
    
    low-detail
    {
    }
  }
}

endcap-next
{
  mesh-length                           0.82
  adjust-cross-section-to-ground        0
  
  track-lod-tree
  {
    lod-distance                        400
    
    high-detail
    {
      lod-distance                      100
      
      high-detail
      {
        lod-distance                    10
        
        high-detail
        {
          mesh                          "endcap_next"
        }
        
        low-detail
        {
          mesh                          "endcap_next_lo"
        }
      }
      
      low-detail
      {
      }
    }
    
    low-detail
    {
    }
  }
}

thumbnails
{
  default
  {
    width                               240
    height                              180
    image                               "thumbnail.jpg"
  }
}

attached-splines
{
  rail_left
  {
    lateral-offset                      -0.751
    use-same-direction                  1
    spline-kuid                         <kuid:523:19723342>
    visual-only                         1
  }
  
  rail_right
  {
    lateral-offset                      0.751
    use-same-direction                  1
    spline-kuid                         <kuid:523:19723343>
    visual-only                         1
  }
  
  sleepers
  {
    lateral-offset                      0
    use-same-direction                  1
    spline-kuid                         <kuid:523:19723344>
    visual-only                         1
  }
  
  chairs_left
  {
    lateral-offset                      -0.751
    use-same-direction                  1
    spline-kuid                         <kuid:523:19723345>
    visual-only                         1
  }
  
  chairs_right
  {
    lateral-offset                      0.751
    use-same-direction                  1
    spline-kuid                         <kuid:523:19723346>
    visual-only                         1
  }
}
username-pl                             "TANE tor dąb"

kuid-table
{
  0                                     <kuid:523:19723341>
  1                                     <kuid:523:19723342>
  2                                     <kuid:523:19723343>
  3                                     <kuid:523:19723344>
  4                                     <kuid:523:19723345>
  5                                     <kuid:523:19723346>
}

 

<kuid2:523:19723345:7> TANE Trk Oak Chairs-Left


kuid                                    <kuid2:523:19723345:7>
kind                                    "procedural-track"
istrack                                 0
username                                "TANE Trk Oak Chairs-Left"
trainz-build                            3.9
category-era                            "1920s"
category-class                          "TR"
category-region                         "00"
track-type                              "chairs-left"

mesh-table
{
  chairs-left-lod0
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "chairs_left_lod0.im"
  }
  
  chairs-left-lod1
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "chairs_left_lod1.im"
  }
  
  chair_single
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "chair_single_left_lod0.im"
  }
  
  blade_slidechair
  {
    mesh-asset                          <kuid2:523:19723341:2>
    mesh                                "slidechair_left.im"
  }
}

track
{
  mesh-length                           3
  padding-length                        0.706
  spacing-length-before                 0.277
  spacing-length-after                  0.277
  adjust-cross-section-to-ground        0
  dont-scale-mesh-to-fit-length         0
  
  track-lod-tree
  {
    lod-length                          2
    
    high-detail
    {
      subdivisions                      4
      mesh                              "chair_single"
    }
    
    low-detail
    {
      lod-distance                      200
      
      high-detail
      {
        subdivisions                    1
        lod-distance                    45
        
        high-detail
        {
          lod-distance                  10
          subdivisions                  1
          
          high-detail
          {
            mesh                        "chairs-left-lod0"
          }
          
          low-detail
          {
            mesh                        "chairs-left-lod1"
          }
        }
        
        low-detail
        {
        }
      }
      
      low-detail
      {
      }
    }
  }
}

privileges
{
  permit-listing                        0
}

thumbnails
{
  default
  {
    width                               240
    height                              180
    image                               "thumbnail.jpg"
  }
}

kuid-table
{
  0                                     <kuid:523:19723341>
  1                                     <kuid2:523:19723341:2>
}

 

<kuid2:523:19723346:7> TANE Trk Oak Chairs-Right


kuid                                    <kuid2:523:19723346:7>
kind                                    "procedural-track"
istrack                                 0
username                                "TANE Trk Oak Chairs-Right"
trainz-build                            3.9
category-era                            "1920s"
category-class                          "TR"
category-region                         "00"
track-type                              "chairs-right"

mesh-table
{
  chairs-right-lod0
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "chairs_right_lod0.im"
  }
  
  chairs-right-lod1
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "chairs_right_lod1.im"
  }
  
  chair_single
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "chair_single_right_lod0.im"
  }
  
  blade_slidechair
  {
    mesh-asset                          <kuid2:523:19723341:2>
    mesh                                "slidechair_right.im"
  }
}

track
{
  mesh-length                           3
  padding-length                        0.706
  spacing-length-before                 0.277
  spacing-length-after                  0.277
  adjust-cross-section-to-ground        0
  dont-scale-mesh-to-fit-length         0
  
  track-lod-tree
  {
    lod-length                          2
    
    high-detail
    {
      subdivisions                      1
      mesh                              "chair_single"
    }
    
    low-detail
    {
      lod-distance                      200
      
      high-detail
      {
        subdivisions                    1
        lod-distance                    45
        
        high-detail
        {
          lod-distance                  10
          subdivisions                  1
          
          high-detail
          {
            mesh                        "chairs-right-lod0"
          }
          
          low-detail
          {
            mesh                        "chairs-right-lod1"
          }
        }
        
        low-detail
        {
        }
      }
      
      low-detail
      {
      }
    }
  }
}

privileges
{
  permit-listing                        0
}

thumbnails
{
  default
  {
    width                               240
    height                              180
    image                               "thumbnail.jpg"
  }
}

kuid-table
{
  0                                     <kuid:523:19723341>
  1                                     <kuid2:523:19723341:2>
}

 

<kuid2:523:19723341:7> TANE Trk Oak Mesh


kuid                                    <kuid2:523:19723341:7>
username                                "TANE Trk Oak Mesh"
kind                                    "mesh"
trainz-build                            3.7
category-era                            "1920s"
category-class                          "HM"
category-region                         "00"

mesh-table
{
  track-lod0
  {
    mesh                                "track_lod0.im"
    auto-create                         1
  }
  
  track-lod1
  {
    mesh                                "track_lod1.im"
  }
  
  track-lod2
  {
    mesh                                "track_lod2.im"
  }
  
  track-lod3
  {
    mesh                                "track_lod3.im"
  }
  
  sleepers-lod0
  {
    mesh                                "sleepers_lod0.im"
  }
  
  sleepers-lod1
  {
    mesh                                "sleepers_lod1.im"
  }
  
  sleepers-lod2
  {
    mesh                                "sleepers_lod2.im"
  }
  
  sleepers-lod3
  {
    mesh                                "sleepers_lod3.im"
  }
  
  sleeper_single-lod0
  {
    mesh                                "sleeper_single_lod0.im"
  }
  
  sleeper_single-lod1
  {
    mesh                                "sleeper_single_lod1.im"
  }
  
  chairs-left-lod0
  {
    mesh                                "chairs_left_lod0.im"
  }
  
  chairs-left-lod1
  {
    mesh                                "chairs_left_lod1.im"
  }
  
  chairs-right-lod0
  {
    mesh                                "chairs_right_lod0.im"
  }
  
  chairs-right-lod1
  {
    mesh                                "chairs_right_lod1.im"
  }
  
  chair_single_left-lod0
  {
    mesh                                "chair_single_left_lod0.im"
  }
  
  chair_single_left-lod1
  {
    mesh                                "chair_single_left_lod1.im"
  }
  
  chair_single_right-lod0
  {
    mesh                                "chair_single_right_lod0.im"
  }
  
  chair_single_right-lod1
  {
    mesh                                "chair_single_right_lod1.im"
  }
  
  rail_left-lod0
  {
    mesh                                "rail_left_lod0.im"
  }
  
  rail_left-lod1
  {
    mesh                                "rail_left_lod1.im"
  }
  
  rail_left-lod2
  {
    mesh                                "rail_left_lod2.im"
  }
  
  rail_right-lod0
  {
    mesh                                "rail_right_lod0.im"
  }
  
  rail_right-lod1
  {
    mesh                                "rail_right_lod1.im"
  }
  
  rail_right-lod2
  {
    mesh                                "rail_right_lod2.im"
  }
  
  endcap_prev
  {
    mesh                                "endcap_lod0.im"
  }
  
  endcap_next
  {
    mesh                                "endcap1_lod0.im"
  }
  
  endcap_prev_lo
  {
    mesh                                "endcap_lod1.im"
  }
  
  endcap_next_lo
  {
    mesh                                "endcap1_lod1.im"
  }
  
  wingrail_left
  {
    mesh                                "wingrail_left.im"
  }
  
  wingrail_right
  {
    mesh                                "wingrail_right.im"
  }
  
  checkrail_left
  {
    mesh                                "checkrail_left.im"
  }
  
  checkrail_right
  {
    mesh                                "checkrail_right.im"
  }
  
  blade_left
  {
    mesh                                "blade_left.im"
    anim                                "blade_left.kin"
    animation-loop-speed                0.25
  }
  
  blade_right
  {
    mesh                                "blade_right.im"
    anim                                "blade_right.kin"
    animation-loop-speed                0.25
  }
  
  blade_stretcher
  {
    mesh                                "stretcher.im"
    anim                                "stretcher.kin"
    animation-loop-speed                0.25
  }
  
  blade_slidechair_left
  {
    mesh                                "slidechair_left.im"
  }
  
  blade_slidechair_right
  {
    mesh                                "slidechair_right.im"
  }
}

thumbnails
{
  default
  {
    width                               240
    height                              180
    image                               "thumbnail.jpg"
  }
}
username-de                             "TANE Trk Oak Mesh"
username-fr                             "TANE Voie Chêne Maille"

kuid-table
{
}

 

<kuid2:523:19723342:8> TANE Trk Oak Rail-Left


kuid                                    <kuid2:523:19723342:8>
username                                "TANE Trk Oak Rail-Left"
kind                                    "procedural-track"
istrack                                 0
trainz-build                            3.9
category-era                            "1920s"
category-class                          "TR"
category-region                         "00"
track-type                              "rail-left"
rail-width                              0.066
checkrail-body-length                   2.533
wingrail-body-length                    1.53
blade-smallest-width                    0.003
blade-taper-length                      1.982

mesh-table
{
  rail_left-lod0
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "rail_left_lod0.im"
  }
  
  rail_left-lod1
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "rail_left_lod1.im"
  }
  
  rail_left-lod2
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "rail_left_lod2.im"
  }
  
  wingrail
  {
    mesh-asset                          <kuid2:523:19723341:2>
    mesh                                "wingrail_left.im"
  }
  
  checkrail
  {
    mesh-asset                          <kuid2:523:19723341:2>
    mesh                                "checkrail_left.im"
  }
  
  blade
  {
    mesh-asset                          <kuid2:523:19723341:2>
    mesh                                "blade_left.im"
    anim                                "blade_left.kin"
    animation-loop-speed                0.25
  }
  
  blade_stretcher
  {
    mesh-asset                          <kuid2:523:19723341:2>
    mesh                                "stretcher.im"
    anim                                "stretcher.kin"
    animation-loop-speed                0.25
  }
}

track
{
  mesh-length                           6
  adjust-cross-section-to-ground        0
  
  track-lod-tree
  {
    lod-distance                        400
    
    high-detail
    {
      subdivisions                      2
      lod-distance                      65
      
      high-detail
      {
        lod-distance                    10
        subdivisions                    2
        
        high-detail
        {
          mesh                          "rail_left-lod0"
        }
        
        low-detail
        {
          mesh                          "rail_left-lod1"
        }
      }
      
      low-detail
      {
        mesh                            "rail_left-lod2"
      }
    }
    
    low-detail
    {
    }
  }
}

privileges
{
  permit-listing                        0
}

thumbnails
{
  default
  {
    width                               240
    height                              180
    image                               "thumbnail.jpg"
  }
}

kuid-table
{
  0                                     <kuid:523:19723341>
  1                                     <kuid2:523:19723341:2>
}

 

<kuid2:523:19723343:8> TANE Trk Oak Rail-Right


kuid                                    <kuid2:523:19723343:8>
username                                "TANE Trk Oak Rail-Right"
kind                                    "procedural-track"
istrack                                 0
trainz-build                            3.9
category-era                            "1920s"
category-class                          "TR"
category-region                         "00"
track-type                              "rail-right"
rail-width                              0.066
checkrail-body-length                   2.533
wingrail-body-length                    1.53
blade-smallest-width                    0.003
blade-taper-length                      1.982

mesh-table
{
  rail_right-lod0
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "rail_right_lod0.im"
  }
  
  rail_right-lod1
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "rail_right_lod1.im"
  }
  
  rail_right-lod2
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "rail_right_lod2.im"
  }
  
  wingrail
  {
    mesh-asset                          <kuid2:523:19723341:2>
    mesh                                "wingrail_right.im"
  }
  
  checkrail
  {
    mesh-asset                          <kuid2:523:19723341:2>
    mesh                                "checkrail_right.im"
  }
  
  blade
  {
    mesh-asset                          <kuid2:523:19723341:2>
    mesh                                "blade_right.im"
    anim                                "blade_right.kin"
    animation-loop-speed                0.25
  }
  
  blade_stretcher
  {
    mesh-asset                          <kuid2:523:19723341:2>
    mesh                                "stretcher.im"
    anim                                "stretcher.kin"
    animation-loop-speed                0.25
  }
}

track
{
  mesh-length                           6
  adjust-cross-section-to-ground        0
  
  track-lod-tree
  {
    lod-distance                        400
    
    high-detail
    {
      subdivisions                      2
      lod-distance                      65
      
      high-detail
      {
        lod-distance                    10
        subdivisions                    2
        
        high-detail
        {
          mesh                          "rail_right-lod0"
        }
        
        low-detail
        {
          mesh                          "rail_right-lod1"
        }
      }
      
      low-detail
      {
        mesh                            "rail_right-lod2"
      }
    }
    
    low-detail
    {
    }
  }
}

privileges
{
  permit-listing                        0
}

thumbnails
{
  default
  {
    width                               240
    height                              180
    image                               "thumbnail.jpg"
  }
}

kuid-table
{
  0                                     <kuid:523:19723341>
  1                                     <kuid2:523:19723341:2>
}

 

<kuid2:523:19723344:6> TANE Trk Oak Sleepers


kuid                                    <kuid2:523:19723344:6>
kind                                    "procedural-track"
istrack                                 0
username                                "TANE Trk Oak Sleepers"
trainz-build                            3.9
category-era                            "1920s"
category-class                          "TR"
category-region                         "00"
track-type                              "sleepers"
sleeper-pitch                           0.707

mesh-table
{
  sleepers-lod0
  {
    mesh-asset                          <kuid2:523:19723341:1>
    mesh                                "sleepers_lod0.im"
  }
  
  sleepers-lod1
  {
    mesh-asset                          <kuid2:523:19723341:1>
    mesh                                "sleepers_lod1.im"
  }
  
  sleepers-lod2
  {
    mesh-asset                          <kuid2:523:19723341:1>
    mesh                                "sleepers_lod2.im"
  }
  
  sleepers-lod3
  {
    mesh-asset                          <kuid2:523:19723341:1>
    mesh                                "sleepers_lod3.im"
  }
  
  sleeper_single
  {
    mesh-asset                          <kuid:523:19723341>
    mesh                                "sleeper_single_lod0.im"
  }
}

track
{
  mesh-length                           3
  padding-length                        0.706
  spacing-length-before                 0.2
  spacing-length-after                  0.2
  adjust-cross-section-to-ground        0
  dont-scale-mesh-to-fit-length         0
  
  track-lod-tree
  {
    lod-length                          2
    
    high-detail
    {
      subdivisions                      4
      mesh                              "sleeper_single"
    }
    
    low-detail
    {
      lod-distance                      200
      
      high-detail
      {
        subdivisions                    1
        lod-distance                    45
        
        high-detail
        {
          lod-distance                  10
          subdivisions                  1
          
          high-detail
          {
            mesh                        "sleepers-lod0"
          }
          
          low-detail
          {
            mesh                        "sleepers-lod1"
          }
        }
        
        low-detail
        {
          mesh                          "sleepers-lod2"
        }
      }
      
      low-detail
      {
        mesh                            "sleepers-lod3"
      }
    }
  }
}

thumbnails
{
  default
  {
    width                               240
    height                              180
    image                               "thumbnail.jpg"
  }
}

privileges
{
  permit-listing                        0
}
username-de                             "TANE Trk Oak Sleepers"
username-fr                             "TANE Voie Chêne Traverses"

kuid-table
{
  0                                     <kuid2:523:19723341:1>
  1                                     <kuid:523:19723341>
}

 

[edit] Trouble Shooting

This information might help you to determine a fix for any of the below visuals issues, warnings or errors:


VE189: Collision data exceeds 64KB and has been simplified. Consider using a different generation method or a simplified mesh.

  • Try adding a "collision-data-generation-mode" tag for the mesh in question as there are several options to choose from to generate a collision mesh that is less complex.

or;

  • You can add the "enable-pfx-collisions" tag to the root of the config.txt and give it a 0 value to turn off collision.


Ballast Stretching

Ballast stretching.jpg

If you are seeing stretched track in your track placement you can try the following:

- inserting spline points to adjust the track spline length (note this could mess with existing sessions)
- move the spline points to adjust the track spline length (note this could mess with existing sessions)
- add the tag padding-length to your kind "procedural-track", track-type "ballast" in the track-lod-tree container.
  You might want to set padding-length to the length of your highest ballast LOD (i.e your shortest ballast mesh).

[edit] Return to Index

<< How To Guides

Personal tools