Which BGL file format does MSFS use?

Hi folks,

I want to extract airport data from the BGL-files of MSFS to process it further in an external app.
I’ve found the following description on the internet, which is originally meant for older sims :

https://fsdeveloper.com/wiki/index.php?title=BGL_File_Format

My simple question is : Can I also use this file format for the new MSFS?

Not really. The MSFS bgl format is based on the FSX one but many elements have new attributes which change records lengths and there are also a number of new elements. Some parts of the old FSX format still compile but are not recognized by the MSFS sim.

Thank you for your reply!

I’ll do my best then to find and to extract the data I need.
I know, the creator of ‘Little Navmap’ already managed to do a lot…
Let’s do this! :slight_smile:

Well, I almost could find all that I need :
ICAO-Codes, coordinates of the airports, altitudes, number of the runways, their lengths, widths, if and which lights they have, which approach lights, VASI types, ILS, offset thresholds, all the APRONs of the airport and their coordinates ect.pp…
It was a long riddle, almost all IDs have changed, the sizes of the subrecords and sub-subrecords have changed, and the hardest riddle was that a couple of fixed sizes of records have changed which are saved or mentioned nowhere.

Well, I got them all (at least those, that I need).
The only thing I couldn’t find, which is weird, is the type of the SURFACE of the runways ?!
It looks like an easy thing, but I just can’t find it… :confused:

The type of the surface of the runways was the most inconvenient one to find out.
The surfaces are not stocked in 2 bytes, like in old FSX, but in 16 bytes.
The range of the sequence has an offset of 0x4c - 0x5b in the fixed part of the “Runway”-subrecord, which now has a length of 0x60 (FSX = 0x34).

The sequences for the different types of surfaces were practically always the same for the 502 default airports(*1), I looked into :

    private readonly ushort[] Surface_ASPHALT = { 59455, 11789, 47002, 17461, 23696, 48092, 50666, 22876 };
    private readonly ushort[] Surface_Cement = { 14094, 8084, 57543, 18771, 41651, 17630, 15665, 28896 };
    private readonly ushort[] Surface_BITUMINOUS = { 23329, 34821, 49144, 18417, 25277, 44209, 40715, 51673 };
    private readonly ushort[] Surface_GRASS = { 6491, 3602, 19024, 17105, 51384, 31511, 3879, 43834 };
    private readonly ushort[] Surface_DIRT = { 58763, 29424, 5524, 17657, 5029, 19817, 2915, 23939 };

*1 : There were 2 exceptions : 1 runway of KJFK and the runway of LPMA (Madeira).

Surfaces are now in the form of a GUID as you found. These represent a material.

How did you find the data in the end? Was just trial and error, or did you find some documentation somewhere?

There exists no documentation that I know of. Only the documentation of the older Sims, that I linked in my first post.

I played a bit Sherlock Holmes, set up traps for values that could make sense and handcuffed them finally.
It makes fun for a little while, but it’s very time consuming.
It was some sort of side effect of Covid-19. It’s not the way one should work.

1 Like

It should still be able to load a bgl. There’s another link on fsdeveloper (maybe recent ?), sais this

Much of the original BGL File Format > information still applies in terms of BGL format and a number of the mathematical transformations used to decode certain data types.

This page should be used in conjunction with that page for a more full understanding of the FS20 BGL format, in particular everything in BGL Common Format still holds.

Note that BGL section IDs are encoded in FSSectType, which are largely identical to FSX with a couple of additions.

… so maybe this is usable ? page is

https://www.fsdeveloper.com/wiki/index.php/FS20_BGL_File_Format

Yes - that’s the latest understanding of the format and there are a couple of utilities that I am aware of that can generate XML source from MSFS bgl files