Elvas Tower: ESD_SubObj ( ) -> does it really show the first sub_obj in the shape? - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

ESD_SubObj ( ) -> does it really show the first sub_obj in the shape? Rate Topic: -----

#1 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 19 December 2023 - 11:01 AM

Hi,

Does anyone know exactly which sub_object of an s-file is addressed by the line ESD_SubObj ( ) in the sd-file?
It says here that it is the first sub_object of an s-file. But in the MSTS s-file "US2lamp1.s", for example, it is the second sub_object, which is then "switched on" at night.
Does "sub-object" even mean a sub_object entry in the s-files?

Greetings
Jonas


EDIT, Dec. 29, 2023: My last findings to the above questions are here.

#2 User is offline   Jovet 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 2,251
  • Joined: 14-January 08
  • Gender:Male
  • Location:Omaha, Nebraska.
  • Simulator:MSTS/Open Rails
  • Country:

Posted 20 December 2023 - 11:45 PM

View Postjonas, on 19 December 2023 - 11:01 AM, said:

Does anyone know exactly which sub_object of an s-file is addressed by the line ESD_SubObj ( ) in the sd-file?
It says here that it is the first sub_object of an s-file. But in the MSTS s-file "US2lamp1.s", for example, it is the second sub_object, which is then "switched on" at night.
Does "sub-object" even mean a sub_object entry in the s-files?


Hi Jonas,
It's definitely only the first sub-object. Additional sub-objects are not affected. The US2lamp1.s file only has one sub-object, named LIGHTPOOL. (The part name shouldn't matter, though.)
https://msts.jovet.net/files/images/US2LampHierarchy1.png

I just tested a shape with multiple sub-objects (e.g. the bright icon in the hierarchy list) and only the first one is affected, both in MSTS and Open Rails.

#3 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 21 December 2023 - 11:01 AM

Ok, thanks for the answer.
So sub-objects mean the first matrix that is subordinate to the root matrix?
And sub-objects does not mean the (first) so called "sub_object" listed in the shape files?
...

				distance_level (
					distance_level_header (
						dlevel_selection ( 1500 )
						hierarchy ( 2 -1 0 )
					)
					sub_objects ( 4
						sub_object (
							sub_object_header ( 00000400 -1 -1 000001d2 000001c4
...


#4 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 22 December 2023 - 10:51 AM

View PostJovet, on 20 December 2023 - 11:45 PM, said:

...It's definitely only the first sub-object. ...

I have created this shape and have this ESD_SubObj ( ) problem in OR:
Attached Image: Open Rails 2023-12-22 12-30-36 600er Breite.jpg
The reception building shape consists of 2 matrices: "Main" and "Night". "Night" is the first and only child matrix and consists of 1 primitive which is textured with "BlendATex". The root matrix "Main" consists of 3 primitives, which are all textured with "TexDiff".
OR apparently considers the first primitive (80 polys, texture "BfTrglw_Jm.ace") of the root matrix to be the first sub-object and therefore does not draw it on the day.
In the shape's code, the first "sub_object" in the "sub_objects" section is the 8 poly primitive of the "Night" matrix. The second "sub_object" is the 80-poly-"sub_object" of the root marix "Main".
I come to the conclusion that OR is incorrectly using the second "sub_object" listed in the shape as being switched day/night by "ESD_SubObj ( )".
OR does not seem to evaluate the matices but the primitives - more precisely: the 2nd "sub_object" in the shapes code with its primitive.

Since it works correctly in MSTS, I think it should be treated as an OR bug.
Do I see this correctly or what is wrong with my shape? -> Attached File  BfTrglw_Jm.zip (158.04K)
Number of downloads: 35

#5 User is offline   Jovet 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 2,251
  • Joined: 14-January 08
  • Gender:Male
  • Location:Omaha, Nebraska.
  • Simulator:MSTS/Open Rails
  • Country:

Posted 23 December 2023 - 07:26 AM

View Postjonas, on 21 December 2023 - 11:01 AM, said:

So sub-objects mean the first matrix that is subordinate to the root matrix?
And sub-objects does not mean the (first) so called "sub_object" listed in the shape files?

Yes, and yes. The terminology gets confusing because a lot of it is used inappropriately. That's one reason I like the nice, generic term part.

View Postjonas, on 22 December 2023 - 10:51 AM, said:

I have created this shape and have this ESD_SubObj ( ) problem in OR:
OR apparently considers the first primitive (80 polys, texture "BfTrglw_Jm.ace") of the root matrix to be the first sub-object and therefore does not draw it on the day.
That is correct. The part labeled as "1" in the hierarchy icon is the part affected by ESD_SubObj().
It may help to know which software you used to create this building shape?

View Postjonas, on 22 December 2023 - 10:51 AM, said:

In the shape's code, the first "sub_object" in the "sub_objects" section is the 8 poly primitive of the "Night" matrix. The second "sub_object" is the 80-poly-"sub_object" of the root marix "Main".
I have never really paid much attention as to how "sub_objects" in shape files relate to their matrices. It could be the order in which they're created or attached to one another in your modeling software but it doesn't matter because the Matrix entries are what matter. The only time I've noticed the order matters is when polygons at a distance don't get culled properly if they're not in the "right" order.

I don't really understand why your part Night shows 8 "static" polygons and none of the other parts seem related to or peers of that. I don't believe your shape is structured or exported correctly. When you click on the "1" node in the hierarchy list, the part you show that disappears highlights.

Additionally, you say things work in MSTS, but in MSTS shape textures must be sized to a square power of two. Maybe you've lucked out somehow, but that's definitely not a supported design.

#6 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 23 December 2023 - 12:57 PM

View PostJovet, on 23 December 2023 - 07:26 AM, said:

...
Additionally, you say things work in MSTS, but in MSTS shape textures must be sized to a square power of two. Maybe you've lucked out somehow, but that's definitely not a supported design.

Sorry, I reduced the size of the texture files of the shape in order to let the download here not become too big. Here again the shape with the original sized texture files: Attached File  BfTrglw_Jm.zip (1.3MB)
Number of downloads: 41

#7 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 23 December 2023 - 01:38 PM

The shape is exported from 3dsmax as a 3DS file and then converted into an s-file with Conv3DS.exe (just like I have been creating the most of my shapes for my AddOn for years).

About the terms: Because "sub_object" is used by Kuju in the shape code, I assumed that "ESD_SubObj ( )" might refer to ... might refer to.
In fact, however, it seems to refer to the first sub-matrix, at least in MSTS.

What does the "1" in an orange primitiv cube shown in the Model Hierarchy window actually mean? Is that known?
I can't read anything about the meaning of the numbers in the Shape Viewer help. It only says about the orange cubes: "Orange indicates a primitive in the higher sub-objects - these are usually alpha textured (translucent) parts."

#8 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 23 December 2023 - 04:57 PM

I have varied 5 times the material hierarchy in 3dsmax and learned that the order of the materials directly determines the order of the sub_objects in the shape.
This order can be recognized by the numbers in the orange cubes of the primitive (the orange parts ;-). The brown cube is part of the order stands for the number 0, i.e. the first sub_object in the shape, the number 1 for the second and so on.
It is now interesting that MSTS hides the first sub_object/primitive, OR the second sub_object/primitive because of ESD_subObj () on the day:
Attached Image: Vergleich.jpg
The matrices and their hierarchy seem to play no role at all for the ESD_subObj () parameter!

OR differ and does not correctly simulate the MSTS-ESD_subObj functionality in my eyes.

#9 User is offline   Jovet 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 2,251
  • Joined: 14-January 08
  • Gender:Male
  • Location:Omaha, Nebraska.
  • Simulator:MSTS/Open Rails
  • Country:

Posted 24 December 2023 - 01:32 AM

View Postjonas, on 23 December 2023 - 01:38 PM, said:

The shape is exported from 3dsmax as a 3DS file and then converted into an s-file with Conv3DS.exe (just like I have been creating the most of my shapes for my AddOn for years).
Okay, that makes sense. I suspected something like that, as I have never gone that route and have not known how much control one has in the shape hierarchy creation. Obviously this method works, since it's what Kuju used to make the original game. Do you have the Conversion of Shapes and Textures 1.01.doc that came with MSTS? It outlines the specifics of what you need in your scene to get a smooth conversion. This seems to be a resource you need to clear up this confusion.

View Postjonas, on 23 December 2023 - 01:38 PM, said:

What does the "1" in an orange primitiv cube shown in the Model Hierarchy window actually mean? Is that known?
I can't read anything about the meaning of the numbers in the Shape Viewer help. It only says about the orange cubes: "Orange indicates a primitive in the higher sub-objects - these are usually alpha textured (translucent) parts."
A shape file has a main part, and then can have up to 32 subordinate parts (e.g. "sub objects") which have their own pivot point, rotation, animation, etc. In certain situations, such as this topic or as signals or locomotives or such, the parts will be specifically animated or hidden/shown by the game. I believe that more than 33 total parts are supported, but only 32 first-level child parts are supported.

The Shape Viewer Hierarchy window will show special numbered icons for the first four subordinate parts, which the MSTS documentation does call "subobjects". The rest of the subordinate parts have generic icons, as I suspect the program's creator did not want to take the time to make and manage all 32 custom icons.


View Postjonas, on 23 December 2023 - 04:57 PM, said:

I have varied 5 times the material hierarchy in 3dsmax and learned that the order of the materials directly determines the order of the sub_objects in the shape.
This order can be recognized by the numbers in the orange cubes of the primitive (the orange parts ;-). The brown cube is part of the order stands for the number 0, i.e. the first sub_object in the shape, the number 1 for the second and so on.
It is now interesting that MSTS hides the first sub_object/primitive, OR the second sub_object/primitive because of ESD_subObj () on the day:
The matrices and their hierarchy seem to play no role at all for the ESD_subObj () parameter!
OR differ and does not correctly simulate the MSTS-ESD_subObj functionality in my eyes.

My modeling avenue of choice has been Gmax. When I export to shape files from Gmax, I can explicitly control which parts are which "subobjects" in the final shape. For example, to test functionality for this thread, I made this test shape:
https://msts.jovet.net/files/images/TestEsdSubObject1.png

With this shape, I can confirm that MSTS and Open Rails behave identically, and only the first "sub-object" SUB1 is hidden during the day for ESD_SubObj.

Please notice that the bright, numbered icon polygons are all listed subordinate to the part names. This is how it should look, as those polygons belong to those parts. The same is true of the US2Lamp1.s shape I posted above. Your shape's hierarchy does not look like this, which is what I believe is causing you problems. If you don't have the Conversion of Shapes and Textures 1.01.doc file to review, I will be happy to send it to you.

#10 User is offline   Jovet 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 2,251
  • Joined: 14-January 08
  • Gender:Male
  • Location:Omaha, Nebraska.
  • Simulator:MSTS/Open Rails
  • Country:

Posted 24 December 2023 - 01:40 AM

If you should want to examine the shape I made for testing, here it is.

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users