The major problem with moving old content to TRS19 standards N3vs 500 limit [solved]

In both cases here, you seem to have one extra number. These are transition distances: with two transitions, there are three LOD levels.

If you have only one mesh and you want to turn it off at some distance, use a single number (which is the cutoff distance).

chris

Thanks Chris, I have actually just twigged, result of looking at someone else's config, found out it weren't quite right on checking in the Preview. Think I've got it now!

Presumably it would be good for performance to use this method even on an asset with lod under 500 polys?
 
One person said here to use a LM.txt file, others gave different other solutions such as using a cube, and I see conflicting examples and information from N3V on their site. And they wonder why some of us not-so-experienced content designers are confused by all this regarding meeting LOD requirements.

While it may be clear to you, it isn't at all to me at this point.

Use of LM.Txt:

http://online.ts2009.com/mediaWiki/index.php/LM.txt_file

Level of Detail:

http://online.ts2009.com/mediaWiki/index.php/Level_of_Detail

A conflicting example:

http://online.ts2009.com/mediaWiki/index.php/LOD_Example

Another tutorial which is apparently out of date but seems the best example:

http://online.ts2009.com/mediaWiki/index.php/HowTo/Make_your_first_Trainz_Asset

Can anyone provide me clear and concise config.txt CODE here in this thread as an example for a scenery item (ie; building or structure) with just one single mesh only?

Assumptions for this code:

1. You will not see the building past 1000 meters.
2. It must not generate the 500 polygon error message.
3. It must work in build 4.6 or later.

Thanks for any help!

Bob
 
Last edited:
One person said here to use a LM.txt file, others gave different other solutions such as using a cube, and I see conflicting examples and information from N3V on their site. And they wonder why some of us not-so-experienced content designers are confused by all this regarding meeting LOD requirements.

While it may be clear to you, it isn't at all to me at this point.

Use of LM.Txt:

http://online.ts2009.com/mediaWiki/index.php/LM.txt_file

Level of Detail:

http://online.ts2009.com/mediaWiki/index.php/Level_of_Detail

A conflicting example:

http://online.ts2009.com/mediaWiki/index.php/LOD_Example

Another tutorial which is apparently out of date but seems the best example:

http://online.ts2009.com/mediaWiki/index.php/HowTo/Make_your_first_Trainz_Asset

Can anyone provide me clear and concise config.txt CODE here in this thread as an example for a scenery item (ie; building or structure) with just one single mesh only?

Assumptions for this code:

1. You will not see the building past 1000 meters.
2. It must not generate the 500 polygon error message.
3. It must work in build 4.6 or later.

Thanks for any help!

Bob

There are two slightly different methods. The first uses lm.txt and requires a low poly lod mesh which is referenced in the lm.txt file the second slightly more sophisticated method uses an lm.txt file but this time there is only one mesh and you use the cut off in lm.txt file to effectively remove the asset at whatever distance you set it to.

I don't think N3V ever had been very good at documentation.

Cheerio John
 
To my knowledge, the use of an lm.txt file is only intended for rolling stock.
As a result, I would not be surprised if that one day turns into an error (for everything not being rolling stock).

Happy to be pointed at documentation that proves me wrong.
 
Try:

mesh-table {
lod0 {

LOD-level 0
autocreate 1
mesh "my_mesh"
}
lod1 {
lod-level 1
autocreate 0
mesh ""
}
}
mesh-table-LOD-transition-distances 1000,2000



I'm away from my PC so can't verify.


edit: The mesh-detail-level-count has gone for TB4.6
 
Last edited:
Bob

I would be inclined to use the new method used for TRS19 outlined by Malc at #37. You may want to use a simple one metre cube using a blender material so that you have a positive second mesh which you know will be less than 500 polys.
You could do as Malc suggests and find a 4.6 scenery item in CM that uses the new distance tag and study it.

Ken

Edit see Paul's posting #45 that coincided with mine
 
Last edited:
Try:

mesh-table {
lod0 {

LOD-level 0
autocreate 1
mesh "my_mesh"
}
lod1 {
lod-level 1
autocreate 0
mesh ""
}
}
mesh-table-LOD-transition-distances 1000,2000



I'm away from my PC so can't verify.


edit: The mesh-detail-level-count has gone for TB4.6

Thanks but that did not work. The mesh name cannot be null or empty (ie;""). At least in did not work for me in TRS19. Here are the errors that were reported by TRS19:

- <kuid:439337:103168> VE26: The tag 'mesh' in container 'lod1' is empty.
- <kuid:439337:103168> VE27: The tag 'mesh' in 'lod1' must have a mesh file extension.

I have taken a look at some of the existing DLS TRS19 structures that are out there. One of the ones I looked at was <kuid2:458053:100011:2> SGLM Washing plant 5. I modified his config.txt code for my just released <kuid2:439337:103071:1> SAP Exterior Structure Light Fixture as a test. Here is the code as I used it.

Code:
mesh-table-lod-transition-distances     50,100

mesh-table
{
  lod0
  {
    mesh                                "light_fixture_high_poly.im"
    auto-create                         1
    lod-level                             0
  }
  
  lod1
  {
    mesh                                "light_fixture_low_poly.im"
    auto-create                         1
    lod-level                             1
  }
  
  night0
  {
    mesh                                "nightmode/nightmode_high_poly.im"
    night-mesh-base                     "lod0"
    
    effects
    {
      shine
      {
        kind                            "corona"
        att                             "a.corona0"
        texture-kuid                    <kuid:439337:101400>
        max-intensity                   0.1
        directional                     0
      }
    }
  }
  
  night1
  {
    mesh                                "nightmode/nightmode_low_poly.im"
    night-mesh-base                     "lod1"
    
    effects
    {
      shine
      {
        kind                            "corona"
        att                             "a.corona0"
        texture-kuid                    <kuid:439337:101400>
        max-intensity                   0.1
        directional                     0
      }
    }
  }
}

This code worked for build 4.6 without producing any errors or warnings. All the N3V documentation I have seen to date appears to not support just having a single mesh only under LOD. I attempted to do this using just a single mesh and got the 500 polygon error message. For the second mesh you will, it seems, have to have at least two meshes, although perhaps that is where the invisible cube someone discussed earlier comes into play. In my case I used the decimate modifier in Blender to reduce the lamp mesh to under 500 triangles for my LOD1 mesh.

I appreciate everyone's help on this and would like to refine this further so I can produce a short-and-to-the-point tutorial for content developers for overcoming the 500 polygon error message to be eventually posted in the Content Creation Support section of the forum so others who are new to LOD, such as myself, don't have the frustration I have had over this issue.

Bob
 
Last edited:
Bob
Did you see my post where I suggested a simple one metre cube textured in blender so that this same cube can be used in any asset you wish to update.

Ken
 
This works, OK its actually under 500 polys, 475 to be precise however used it as a test, might just do this anyway even on low poly items.


Code:
mesh-table-lod-transition-distances     2000

mesh-table
{
  default
  {
    mesh                                "coal_stage.im"
    auto-create                         1
    lod-level                           0
  }
}
 
These are transition distances: with two transitions, there are three LOD levels.
Only because it's been redefined from the original documentation.
"The "mesh-table-lod-transition-distances" tag (float array) determines the distances in meters at which each Level of Detail mesh-table LOD level ends.
This change is incorrect. The change that should have been made is what was assumed above - that the array defines the termination point of each each lod. This is a transition distance for all but the last lod, and a termination distance for the last lod. Then there will be a match between the array count and the number of lod, and the above error is much less likely. That was the advice at the time, which was ignored.
 
Presumably it would be good for performance to use this method even on an asset with lod under 500 polys?

My take on this is that if you've got a good set of LOD meshes, you shouldn't generally need to supply a manual cut-off distance. The mesh detail will be low enough that performance shouldn't be a major issue, and the game will cut the object off at the user-selected draw distance anyway. If you force a cut-off then that's bad for people whose systems aren't having performance difficulties and who want to turn up the detail a bit.

There are exceptions. For example, if you have a mesh which is both very small and very heavily used, then it may be that the mesh is effectively invisible beyond 1km (because it's smaller than one pixel at that point) while simultaneously still consuming a fair bit of performance (either in terms of polygon count, or even if that's sufficiently low, in terms of stitching large numbers of small meshes together). An example of this might be small bushes or grasses (you should ideally be using clutter of TurfFX for those, but let's assume that you have a case where that doesn't apply) or perhaps small manually-placed trackwork components.

Even here, it's important to consider that "size is below one pixel" is still dependant on your screen resolution. A mesh which is a single pixel on a 1024x768 screen is still going to be about 19 pixels on a 5K screen, for example. So don't go overboard with culling things.

Your best bet is generally to fall back to a really simple mesh at extreme range, and (where appropriate) try to atlas the materials with other assets that will be used in the same scene, so that you end up with less than one material per asset in the scene.

chris
 
To my knowledge, the use of an lm.txt file is only intended for rolling stock.
As a result, I would not be surprised if that one day turns into an error (for everything not being rolling stock).

Happy to be pointed at documentation that proves me wrong.

This is fairly accurate.

More accurate would be to say that LM.txt is best suited for larger moving or animated objects, especially where the animations are gameplay-relevant or notably visible at large distances (ie. Vehicles, Industries, massive cranes, etc.) LM.txt offers certain features which can be beneficial in these scenarios, but comes with a performance cost.

Mesh-table LOD is best suited for high-performance LOD where the full power of LM.txt isn't required. Foliage, non-animated scenery, and so on.

Where unlikely to ever "ban" the use of LM.txt, because there are times where you really need it, but we might at some point (eg) provide performance rankings for all content, so that users get feedback on which content is well built, and which ones are sapping performance for no good reason.

chris
 
The mesh name cannot be null or empty (ie;""). At least in did not work for me in TRS19. Here are the errors that were reported by TRS19:

- <kuid:439337:103168> VE26: The tag 'mesh' in container 'lod1' is empty.
- <kuid:439337:103168> VE27: The tag 'mesh' in 'lod1' must have a mesh file extension.

You can't specify that a mesh is present but then forget to provide the mesh file.

You can omit the mesh altogether. There is no rule about how many meshes need to be present at a given LOD level. You can have multiple (this is common-place). You can have one. You can even have zero. If you specify two LOD levels (ie. one transition) but then only provide meshes for LOD level 0, then LOD level 1 will simply be empty (aka. invisible).

chris
 
.. the array defines the termination point of each each lod. This is a transition distance for all but the last lod, and a termination distance for the last lod.

You're defining the final LOD level as non-existant, which isn't actually accurate. In reality, the final LOD level is always present, but you have the option to assign no meshes to that LOD level.

chris
 
Interesting topic. I have to agree that documentation of such important details is rather poor thought. For me VE109 error is less annoying than min 20% polys count difference LOD to next up/down LOD limitation error. This forced me to modify lot of cars from LOD x level to LOD x-2 or even x-3 level while updating them to the 4.5 standard by deleting error causing meshes, which means I was forced to modify it the way resulting in worse performance to get it errorless in TANE. I understand that limitation to be intended for the creators but makes troubles for updating older content, which N3V is still obviously massively depended on.
 
20% polys count difference LOD to next up/down LOD limitation error.
I had that problem a few times. Though the technical solution made me feel a bit weird the first time, it ended up improving my content:
Add more details to the first LOD.

If it has more details (read triangles), it is easier to loose 20+%.
For example: Add bolts instead of the image of a bolt (only for very close range of course).
Don't add triangles just for the sake of triangles. The last thing you want is killing performance (more triangles) for the sake of improving performance (LOD).
 
You can't specify that a mesh is present but then forget to provide the mesh file. You can omit the mesh altogether. There is no rule about how many meshes need to be present at a given LOD level. You can have multiple (this is common-place). You can have one. You can even have zero. If you specify two LOD levels (ie. one transition) but then only provide meshes for LOD level 0, then LOD level 1 will simply be empty (aka. invisible).chris

Chris:

Thanks! Very interesting and you are correct based on my test.

Here is the revised code that worked and did not produce errors or warnings in build 4.6 using my 1,072 triangle lamp object mesh as a test:

Code:
mesh-table-lod-transition-distances     50

mesh-table
{
  lod0
  {
    mesh                                "light_fixture_high_poly.im"
    auto-create                         1
    lod-level                           0
  }
  
  night0
  {
    mesh                                "nightmode/nightmode_high_poly.im"
    night-mesh-base                     "lod0"
    
    effects
    {
      shine
      {
        kind                            "corona"
        att                             "a.corona0"
        texture-kuid                    <kuid:439337:101400>
        max-intensity                   0.1
        directional                     0
      }
    }
  }
}

My thanks also to Malc who provided similar insights regarding this as well as code pointing me in the right direction!

Bob
 
Last edited:
I have enough information now to create a short tutorial on the subject, with config.txt code, which can be found at the following location link in the Content Creation Support section of this forum:

https://forums.auran.com/trainz/sho...-error-or-warning-message-for-scenery-objects

Since a solution has been found for overcoming the original issue/complaint that started this thread in the first place, I propose, in fairness to N3V, that we now close this thread, and carry any further conversations on the subject at the new tutorial thread.

My thanks to everyone who helped me on this!

Bob
 
Back
Top