• 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.

FSXA Model file format

  • Thread starter Thread starter GHD
  • Start date Start date

GHD

Messages
12,244
Country
england
I am attempting to write a program to identify which library a particular model is defined in. I have drilled down to the model data but then I am lost.

Can someone please tell me which bytes in the model data contain the Friendly name and GUID?
 
OK, I can see the friendly name, but in which section is the GUID?
 
Hi,

The mdl format is on the wiki. The guid is in the MDLG section, the friendly name in MDLN.
 
What language are you coding in? I have a simple C# class that can read the basic information from a mdl file.
 
What language are you coding in? I have a simple C# class that can read the basic information from a mdl file.
I write in C++, but given the correct RIFF sections, I can easily extract the name and GUID.
 
Ok. Only name and guid is not that hard to extract indeed.
 
Just to let you know that I have been able to extract the GUIDs from FSX library files.

However, how do FS9 libraries work when there are no GUIDs in the model data?
 
However, how do FS9 libraries work when there are no GUIDs in the model data?

You need to read the section that contains the modelData. The SDK tells us that the name is the guid assigned to the model in that library.

Code:
<ModelData
name=”4a5ceec84f2a9e27f12ee7a40f0c856c”
sourceFile=”MyModel.MDL”
fileOffset=”0”/>

Of course this means different libraries can have the same object with different GUIDs which is an ongoing problem in FS9.

I assume you are extracting models from a library? If you are reading mdl files directly this works for FSX but not for FS9.

You find a general section with the ID for ModelData. The format of this for FS9 is:

8 Model data []
The model data structure has a fixed length of 24 bytes

Code:
offset 	length 	format 	description 	contents
0	16 	GUID 	name	
16 	4 	DWORD 	mdl file offset from the start of this subsection	
20 	4 	DWORD 	mdl file length


As I recall this structure is the same in FSX so the GUID is still stored in the first 16 bytes.

If you need some code email me George.
 
Last edited:
Thanks Jon,

I do read the ModelData section but it didn't seem to contain a valid GUID, I'll re-check.
 
Thanks to Jon forcing me to re-examine my code, I now have it working with 10 lines of code instead of 48 :D
 
If you are reading from the BGL I think the code is the same for FSX and FS2004. In FSX the GUID is stored in the MDL file, but it seems it is still stored in the BGL file like in FS2004 as well.
 
If you are reading from the BGL I think the code is the same for FSX and FS2004. In FSX the GUID is stored in the MDL file, but it seems it is still stored in the BGL file like in FS2004 as well.
Yes, that is what Jon said and it is true.
 
Back
Top