• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FsX MDL format description

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I have put a page on the Wiki that describes the FsX MDL format. It is certainly not complete yet, but it contains the parts that I understand now and which allow me to read simple scenery objects.

Hopefully it is also useful to others and if you know things not yet on the page, please feel free to update it.
 
Messages
284
Country
us-newyork
Hey Arno,

I just updated the wiki page with a bit of my knowledge. Don't expect much :D , but it beats nothing at all. I have been hacking the MDL format since FS2002 so I will try to add as much info as possible as I slowly learn the internals of the FSX format.

Cheers,
Sean
 
Messages
175
Country
panama
I have put a page on the Wiki that describes the FsX MDL format. It is certainly not complete yet, but it contains the parts that I understand now and which allow me to read simple scenery objects.

THANKS ARNO!!!, it is absolutly very GOOD NEWS!, had been searching for the new FSX MDL format, because some of my programs reads the old FS9 MDLs to get information for charts,...but now that FSX came out i cannt get this information....now im seeing some LIGHT AT THE END OF THE DARK TUNNEL lol :D....step by step ...:)


Hopefully it is also useful to others and if you know things not yet on the page, please feel free to update it.

ABSOLUTLY, usefull....hehe :D...AND THANKS AGAIN, Arno


Best Regards,

Manuel Ambulo
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I just updated the wiki page with a bit of my knowledge. Don't expect much :D , but it beats nothing at all. I have been hacking the MDL format since FS2002 so I will try to add as much info as possible as I slowly learn the internals of the FSX format.

Thanks Sean. Hopefully I can do some more tests with animated objects soon, so that I can update the relevant sections as I learn more.
 
Messages
156
Country
france
Thanks for the documentation Arno !

Concerning the differences between aircraft and scenery MDL, are we really ready to swap from one type to another ?
In aircraft.cfg files we can use the visual_model_guid command to use a library object instead of the providen mdl. I tried some objects from the default library ...

My first try was a total fsx crash. I think that it was because the object i used (arianne_bourget) was geo-locked.
The second try was successful (a F-22 raptor from the library). Of course it was not really flyable, and has incorrect contact points, no moving parts etc. But nothing that cannot be solved easily.

Another test with PPL_RussianVillain (735a6aeb-368a-4ae5-a4bc-bcb4f5b88626). No crash, but rendering is incorrect :
ppl.jpg

Doesn't really looks like a russian :rolleyes:
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
It looks interesting indeed. I expect there are some sections of the MDL format that are only used by aircraft and not by scenery, but the fact that they seem interchangable is great news.

Also, I think the Russian villain I found a while back looks better (see screenshot) :D. I can't remember the GUID, but it was in the PPL section.
 

Attachments

  • RussianVillain.jpg
    RussianVillain.jpg
    14.4 KB · Views: 661
Messages
156
Country
france
The problem may be elsewhere. If I copy the MDL extracted from its library BGL to the aircraft directory, then it shows correctly. visual_model_guid does not seems to work for all models.

BTW some MDL files exists in both "aircraft" and "scenery" versions. For instance ANI_GiraffeWalk_Mature can be found in SimObjects/Animals and in scenery/global/animals.bgl. The files look barely identical, but there is a slight size difference.
 
Last edited:
Messages
284
Country
us-newyork
Thanks Sean. Hopefully I can do some more tests with animated objects soon, so that I can update the relevant sections as I learn more.

Sweet. I'll be doing some tests with aircraft animations this weekend. Keep you posted.

Cheers,
Sean
 
Messages
175
Country
panama
Hi,

I have a little question of how to draw the 3D model, ehh...for example: if i want to draw a PART, in the wiki page says it has these parameters:

int (?)
int (?)
int material_index
int scene_ref (?)
int vertex_offset
int vertex_count
int index_offset
int index_count
int mouse_rectangle_ref (?)

Then, i get the index_offet and divide by 3 (index_offset / 3) then that gives me (the result) the index number of the triangle that i must get from the INDE section? (im correct? or i misunderstood it?..hehe). And also the index_count is the number of triangles needed to draw that part of the 3D model?...do i need to divide the index_count by 3 too? (i dont think so...but if im wrong then correct me)...

And another question, then the vertex_offet and vertex_count, how they are related or what role they play in the part's drawing?...(just asking if someone knows...if not...no problem..hehe)

i would appreciate if someone could tell me if im wrong or in the good way..hehehe...thanks again...

Best Regards,

Manuel Ambulo

NOTE: Sorry by my "rookie" questions...
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi Manual,

Yes, that is sort of how it works.

The index_offset will tell you where to start in the index list. If you count each triangle as three indices you have to divide the number by three to get the triangle count. If you just count each index as an integer, you can just use the value given.

The index count also has to be divided by three if you are counting the triangles. But if you are just counting the integers you can use the value given.

In the index list you will find the vertex numbers used by each triangle. This is were the vertex_offset comes in, as the vertex count usually starts at zero for each part. So to get the correct vertex you need to add the vertex_offset to the vertex number from the index list. Once you know the vertices it is rather easy to draw the triangle of course.

I don't know were the vertex_count is used. I guess you might need to know this when you want to extract the vertices from the list, but I did not use it in my code to render a MDL object.

I hope this makes it a bit clearer :).
 
Messages
175
Country
panama
Hi Manual,

Yes, that is sort of how it works.

The index_offset will tell you where to start in the index list. If you count each triangle as three indices you have to divide the number by three to get the triangle count. If you just count each index as an integer, you can just use the value given.

The index count also has to be divided by three if you are counting the triangles. But if you are just counting the integers you can use the value given.

In the index list you will find the vertex numbers used by each triangle. This is were the vertex_offset comes in, as the vertex count usually starts at zero for each part. So to get the correct vertex you need to add the vertex_offset to the vertex number from the index list. Once you know the vertices it is rather easy to draw the triangle of course.

I don't know were the vertex_count is used. I guess you might need to know this when you want to extract the vertices from the list, but I did not use it in my code to render a MDL object.

I hope this makes it a bit clearer .

THANKS...MANY THANKS...arno, yes, now i see more clearly how it works...i need to do some tests to see how i can draw the model, but i still have a little question, the TRAN section which contains the matrices, are they found in scenery 3D models MDLs files?, i mean, i know that back to the old format the matrices used to be declared just before the commands used for draw a specified part of an object, i dont know if here it applies the same thing, i mean if it is needed some transformation before drawing a part (of a SCENERY 3D model), or it is something that only appears in aircraft's MDL :confused: .....and i want to know if in the TRAN section there are multiple 4x4 matrices or there is only one 4x4 matrix?....sorry by my english...i hope you got what i meant, ...i mean...if the TRAN section can be also found in 3D scenery MDLs, or if it is only reserved for aircrafts MDLs?? :confused: ...

Best Regards,

Manuel Ambulo
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi Manual,

The simple scenery objects I looked at until now only have one transformation matrix in the TRAN section. So they are to be found in scenery objects as well. When using animations and probably also attachpoints I expect more transformation matrices to show up, but I have not yet studied those in detail.
 
Messages
74
Country
germany
Unknown section

Hi,
I just looked to some mdl files which I extracted from land vehicles library, I will add one to this post. It has the usual sequence of sections. Within the MDLD section you find a LODT section at offset 0x23aa2, which in turn has 4 LODE sections with several PART sections ending at offset 0x23d6e. But the MDLD section does not end at that point, instead there is a SHAM section following covering the rest of the file. In that SHAM section there are again MATE, INDE , VERB etc sections ending again with LODT. Has anyone an idea what that could be ?? The name could suggest that it has something to do with drawing the shadow.
 

Attachments

  • vehicles_land_101.mdl
    165.2 KB · Views: 613
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi Winfried,

That sounds like a vary logical explaination. In the Fs2004 format non-default shadow models are stored in a similar way. I'll try to explore the MDL file you attached a bit more.
 
Messages
284
Country
us-newyork
There's more!

Ok folks,

As some of you might of guessed by now I'm a bit of a hacker... ok more than a bit (I almost became a CEH until I decided to go into the aviation industry).:D

So last night I was digging through another MDL file when I bulb lit up in my head and I thought 'Hey, why not look through xtomdl.exe instead?' So I ran through it and made some startling discoveries. The first of which I'll share with you now:

Attached is a list of ALL of the possible RIFF tags that can be found in a MDL file. Yes, all, No more, no less. Most of these will be unfamiliar to you so I'll try to get a description of each up on the wiki in the next few days.

Legal note - This type of hacking is NOT illegal, or at least in the United States anyways. Reverse engineering code for the sole purpose of program interoperability is legal. And that is exactly what I did.

Ok. please enjoy and feel free to edit/redistribute/add to it/feed it to your dog!

Sean
 

Attachments

  • mdl.txt
    342 bytes · Views: 818
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Thanks, that is a nice starting point. There are quite a few new ones in that list indeed. Now we only have to find out what their relation is (as which one is nested in the other one) and what they actually do :).
 
Messages
120
Hi guys,

I've updated some parts of FSX MDL Wiki document. The text file attached contains descriptions of most MDL signatures posted by theisomizer.

Actually I'm able to draw most of default objects although there still is a problem with static matrices in animated models. When applied, most (but not all) animated parts are positioned correctly except that they are alligned to different axis - 90 degress to non-animated as seen on attached images. Probably resolving of animation structure will bring more light on.

I see that the last post in this thread is more than a year old. Is there any progress? Is anybody still interested?
 

Attachments

  • MDLRIFFSignatures.txt
    1.5 KB · Views: 743
  • NoMatrix.jpg
    NoMatrix.jpg
    18.4 KB · Views: 665
  • WsMatrix.jpg
    WsMatrix.jpg
    21.6 KB · Views: 721
Messages
859
Country
australia
you guys just gave me an idea, thatwould likely make the guys at ACES laugh...

how hard would it be to turn an animated animal or human into a 'pilotable' mdl, and create an online session sometime ala people walking through the scenery lol...
 
Messages
41
Country
unitedkingdom
I'm able to draw most of default objects although there still is a problem with static matrices in animated models. When applied, most (but not all) animated parts are positioned correctly except that they are alligned to different axis - 90 degress to non-animated as seen on attached images. Probably resolving of animation structure will bring more light on.
The SCEN structure describes a hierarchy of matrices that need to be multiplied together to form the final matrix for the part. The top matrix in the hierarchy is often a matrix that converts between left and right handed co-ordinate systems. It sounds like you're just applying a single matrix, instead of following the hierarchy, and so you're missing out on that top matrix.

Each SCEN entry consists of 4 16bit words:
(child, peer, offset of matrix in AMAP section, unknown - bone index?)
where child and peer point to other entries within the SCEN section. Sorry I haven't documented this on the wiki - I'm waiting to see how animations fit into this. But see the file FSXImport.py from here for example code.
 
Last edited:
Top