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

FS2004 BGL data format within FS2004 aircraft MDL Files

Messages
20
Country
england
As I've mentioned on a previous thread in these forums, I received some FS2004 aircraft with missing main wheel animations that I'd like to fix.

I've tried fixing them using ModelConverterX, but while I was able to get the main wheels turning I also noticed that most of the plane's control surfaces are animated incorrectly: I suspect this is because ModelConverterX is really designed for FSX native (and newer) MDL files.

I'm wondering if I may be better off trying to fix the MDL files directly, as that way I'll be able to have fine control and only make changes where they're actually needed, but to do this of course I need to know the format of the MDL files in question.

I've already established that FS2004 aircraft MDL files are RIFF files containing the following:
  • RIFF header: contains "MDL8" (same as FS2004, unlike the "MDL9" found in FS2004 scenery MDLs)
  • MDLH block: much as described in the wiki for scenery MDLs, except that the fixed "152" is incremented by the total size of the data records described in the DICT block next.
  • DICT block: this seems to list animations referenced within the main BGL block, and is divided into records of 28 bytes as follows:
    • Data Type: 1 = FLOAT32, 2 = UINT32, 4 = UINT16, 6 = FLAGS16
    • Data Offset: For the first record this is 152, while for subsequent records it is incremented for each record's data size (for example if the first record is a FLOAT32 then the second record's offset will be 156).
    • Data Size: This is 2 for UINT16 or FLAGS16 records, or 4 for FLOAT32 or UINT32 records.
    • Data GUID: This identifies the parameter in the dictionary, and are listed within ModelConverterX's ASToFra.FSUtils.dll: note though that the final 4 and 12-bytes segments in those GUIDs must be treated as big-endian though!
    • I've also noticed some MDL files have GUIDs which are not listed in ASToFra.FSUtils.dll which seem to be used for "custom" animations.
      • Custom animations built into models using a MakeMDL.parts.xml file seem to have the GUID {CFCBF645-206F-456C-A86C-0C0FAEC544C9}, while those added by ModelConverterX seem to have {0C30F248-0F3C-43AE-83FA-CD29F790AA3E}.
      • In both cases the string describing the custom animation (in Reverse Polish Notation as used in FS2004 XML gauges) is stored in one or more extra records after the main record: these extra records have a Data Type of 0, with the other 24 bytes (replacing the offset, size and GUID) replaced by the string data. padded with \00 bytes as necessary.
  • BBOX block: this always seems to contain 36 bytes all equal to \00: maybe this is used in scenery MDL8 (and contains perhaps a centre co-ordinate unlike MDL9 data, explaining why 36 instead of 24 bytes) but not aircraft ones?
  • ISFT block: contains "MakeMDL - FS90 (9.00.030612.02)"
  • BGL block: presumably this contains the actual 3D modelling data which contains (amongst other things) the animation data that I want to fix!
My question is where can I find information on how to decode the BGL data, so that I can work out how the animation variables referenced in the DICT block affect the model itself?

While you do have documentation on the BGL file format it seems like it's completely different from what FS2004 aircraft MDLs use: for example your documentation suggests that all BGL data starts with a header beginning with the "magic number" bytes 01 02 92 19 from FS2004 onwards, but (given that FS2004 aircraft are MDL8 like FS2002 aircraft) I wonder if the BGL data is in an older FS2002 format. In the models I've seen the first bytes after the "block size" DWORD found within the RIFF file's BGL block are the (rather 16-bit looking) 3A 00 38 00 00 00 XX 00 00 00 04 00 8E 00 64 00 39 00 4A 00, where the "XX" is the same as the "radius of object" byte from the MDLH block.

Where can I find information on this different BGL format used by the FS2004 MDL files? Please advise.

(And by the way, what would I need to do to log into the FsDeveloper wiki, in case I wanted to post information like the above there? The login I use for these forums doesn't seem to work there, but I can't find any way to create a wiki account either!)

George
 
Last edited:
Hi,

Most of the data is in the BGL section, which is a collection of BGL opcodes that contain all kind of commands (define vertices, define materials, draw triangles, transformations, animations, etc.). It is not as simple as the FSX format to understand.

If you download the old bglc_9 tool it comes with a html file that defines all the opcodes.

I can create a wiki account for you if you want to add content there.
 
Hi,

Most of the data is in the BGL section, which is a collection of BGL opcodes that contain all kind of commands (define vertices, define materials, draw triangles, transformations, animations, etc.). It is not as simple as the FSX format to understand.

If you download the old bglc_9 tool it comes with a html file that defines all the opcodes.

I can create a wiki account for you if you want to add content there.
Thanks for that, but the file I think you're referring to (BGLC_9_Source.htm) is indeed just a list of opcodes: where can I find information on how the BGL data itself is structured?

Am I looking at the wrong HTML file?
 
The BGL section is just a sequence of BGL opcodes. There is no further structure. There are BGL opcodes that allow you to jump or call specific locations in this opcode list.
 
Back
Top