Seasonal splines;Track NODE for seasons

jankvis

Somewhere in the layout..
Calling for the big guns...

Seasonal splines are supported in build 3.7. The code is as follows:

"

track </br>{ mesh-length 4</br> track-lod-tree </br>{</br> lod-distance 250</br> high-detail</br> { lod-season-index 1</br> high-detail</br> { mesh "track-lod0w" }</br> low-detail</br> { mesh "track-lod0" }</br> } low-detail </br>{ </br> lod-season-index 1 </br> high-detail</br> {</br> mesh "track-lod1w"</br> } </br> low-detail { mesh "track-lod1" }</br> }</br> }</br> }"

This code generates 2 LOD's with winter and summer season. This works fine and it's a nice addition to have seasonal change in splines.

Now my question is how will the code be for 3 or 4 seasons?? Any help appreciated...

Regards, Jan
 
Consider the 'high detail' pathas "is season-index 1" and the 'low detail' path as "not season-index 1". Test again within the low detail path to isolate a different season.

An example for three seasons would be:

Code:
track
{
  mesh-length 4
  track-lod-tree
  {
    lod-distance 250

    high-detail
    {
      lod-season-index 1

      high-detail
      {
        mesh "track-lod0w"
      }
      
      low-detail
      {
        lod-season-index 2

        high-detail
        {
          mesh "track-lod0s"
        }
      
        low-detail
        {
          mesh "track-lod0a"
        }
      }
    }

    low-detail
    {
      lod-season-index 1

      high-detail
      {
        mesh "track-lod1w"
      }

      low-detail
      {
        lod-season-index 2

        high-detail
        {
          mesh "track-lod1s"
        }

        low-detail
        {
          mesh "track-lod1a"
        }
      }
    }
  }
}

Obviously you'll need an appropriate season-selector with three seasons to make this work.

To add more seasons, keep expanding the inner most 'low detail' path with new choices. It's effectively an if/elsif/elsif/elsif/else chain - you can have as many 'elsif's as you like. Note though that choices with few tests are more efficiently selected than choices with many tests, so for best performance consider which season is the most likely for the user to be in, and test for that one first. Then test for the next most likely, and so on.

Also, consider if you really need all the seasonal variations at the lowest LOD points. If the differences are subtle enough that you can get away with the lowest LOD level covering several seasons, then culling the seasonal choices at the extreme range will be good for performance. Most of the performance is gained at the furthest range.
 
THX for this update, much appreciated. Seasonal Splines for Trainz is a great feature...

Jan
 
Back
Top