Scenery creators: please move or rename your modelLib.BGL

I was trying to troubleshoot some scenery conflicts that were causing CTDs yesterday when I noticed something concerning. It seems that a lot of scenery creators are not changing the location of the modelLib.BGL that is output by default for an ArtProj. I wrote a quick python script to scan every layout.json in my airport folder, and out of 170-some add-on airports that I have almost 40 are shipping a file named scenery/global/scenery/modelLib.BGL. This is less than ideal.

For those who don’t understand how the MSFS VFS works, the short version is that when the sim starts it loads all its own files first, then it reads the layout.json of everything in the Community folder in alphabetical order and “stacks” those layouts on top of each other. If ever two packages have files with exactly the same name in exactly the same path whichever one was loaded first does not get its own copy – it gets the other package’s copy.

This is the output from my script just for the path scenery/global/scenery/modelLib.BGL. Each line represents an airport that is trying to put something in that location. There are 38 of these. That means if everything is enabled, 37 of those airports are not going to have that file contain what they want it to contain. Needless to say, that can cause problems.

>> scenery/global/scenery/modelLib.BGL
    fd24c6b5792a3ccde5d1359fe992fde6	./Asia Pacific/airport-ychl-charlton/layout.json
    7d27df7dfa23670bf513cc01490cbd4f	./Asia Pacific/airport-ymav-avalon/layout.json
    2314c2dad9ce30e8427cf87b3ca86245	./Asia Pacific/airport-yred/layout.json
    5fde84dfa0b3d65cdab4aeee31bd297b	./Asia Pacific/NZA-Discord_YPKG_Kalgoorlie-Boulder-Scenery-Pack-1.0/layout.json
    8b28bed6741ad34264e71d1a30325753	./Asia Pacific/ykbn/layout.json
    f7ffd330b88bd57b0f4aa16d8984766e	./Bush League Legends/stageonelabs-35me-matinicus-island-v1.1/layout.json
    e4e7059cba3e29f7dc5b7ea335217318	./Bush League Legends/stageonelabs-bc02-moh-creek-v1.1/layout.json
    91353f4aedaa8264a09882b66f9148f3	./Bush League Legends/stageonelabs-bc04-middle-lake-v1.1/layout.json
    b30931f841a5b6e69f38795db0982c1c	./Bush League Legends/stageonelabs-bc05-north-tsuniah-lake-v1.1/layout.json
    46dfdce0022df32cde7d2a047786e574	./Bush League Legends/stageonelabs-c01a-boneyard-v1.1/layout.json
    cb9e79fa18cc4bd46bad5c6aa6960376	./Bush League Legends/stageonelabs-caf4-tsuniah-lake-lodge-v1.1/layout.json
    ba9646e9bb771d04ad4a7442fe0cdbd0	./Bush League Legends/stageonelabs-cyjt-stephenville-v1.1/layout.json
    eaf02ec3c4769f740afefaf22a5f7612	./Bush League Legends/stageonelabs-cyyr-goose-bay-v1.1/layout.json
    57fdf49b7d75e72a79b6bd6ff32b0c32	./Bush League Legends/stageonelabs-ida1-mile-hi/layout.json
    57fdf49b7d75e72a79b6bd6ff32b0c32	./Bush League Legends/stageonelabs-ida1-mile-hi-v1.1/layout.json
    45f70c076cf9832ca7c430527351af55	./Bush League Legends/stageonelabs-kpvc-provincetown-v1.2/layout.json
    afdd16c01ea352d0aa419adc82369881	./Bush League Legends/stageonelabs-ns01-atlantic-skydiving-v1.2/layout.json
    cd4158f9abb995494e2d777f09aca7e8	./Europe/dwp-lfro/layout.json
    0ec410e8b80e1df8c7c7a75b205687a7	./Europe/ehhv_new/layout.json
    6251ea16bbd5a854b9d6ddb0b38d8627	./Europe/kjh-engs/layout.json
    a5550f14384ee261a70f6d1dddaf337c	./Europe/kjh-enr1/layout.json
    126d20d1a6178591fd69737307b58cc6	./Europe/kjh-ens1/layout.json
    08a50bacf047ec1d1ddac9e72bf275cb	./Europe/kjh-envu/layout.json
    1247e6734c044d949e19d7949a9ff28f	./Europe/LFPD BERNAY/layout.json
    c1f5990dd00d992c71ce9d40fea9c299	./Europe/lhbs/layout.json
    cdac58c429832af0836cef6738805c8b	./Europe/lhfh/layout.json
    bc51039252cba35383db579e54a78e1c	./Europe/liri/layout.json
    98a7fa6787f73b4216efb9be06f613ac	./Europe/OthertonAirfield/layout.json
    ad5e65858c9f57989483eb4d28b3ee58	./Europe/piotrkol-airport-epnl-lososina2/layout.json
    b164e6bf72331d6e2e7fd28207c6425a	./Europe/pyreegue-lytv/layout.json
    dd4087e1cfad54cd116184662f2c2251	./Europe/tailrotor-lidn/layout.json
    748f363a7ff97b63dec79645d3b9d562	./Europe/UK Farm Fields/gate/layout.json
    646c0af11d239e5dd5b041913db77c59	./Europe/UK Farm Fields/glider/layout.json
    937f6c4bf56d70095d48ecea3b111ed6	./Europe/UK Farm Fields/t3/layout.json
    735ad2341a5be4cd144df985d26e05b6	./North America/USA/campbell/layout.json
    f40aa7468018924e06ba80281deadec6	./North America/USA/julysfire-airport-talkeetna-area-pack/layout.json
    d78a430fde95bedd96f8fab80093a6c1	./North America/USA/u60-u60/layout.json
    43fd8524c9a04a8123d77e51015598c7	./North America/USA/verticalsim-kittyhawk-first-flight/layout.json

I’m an avionics developer (you may recognize me from such favorites as the Working Title G1000 and G3X), not a scenery developer, but after talking to a couple folks who do scenery it sounds like the problem is coming from folks who do net set unique paths for their ArtProj project in this window:

I believe that simply adding a unique path for your own scenery, like this, should solve that problem:

Doing that will make sure that your scenery gets exactly what it expects, and that you don’t step on anyone else’s stuff. It’s only neighborly. :slight_smile:

I hope this helps some folks. If I got anything wrong, please feel free to correct me. And to be clear: I doin’t blame the content creators at all for this. I blame the incomplete SDK documentation combined with a ■■■■■■ interface.

Thanks for your time.

43 Likes

Thanks for posting this!

I am not so sure about that. I had problems with missing textures and found the reason to be that I did NOT have my bgl and textures in the scenery/global/scenery path! When I changed the path to scenery/global/scenery for my buildings and objects the textures returned. They worked in a non-standard folder structure up until MSFS version 1.9.3 but after that the correct, standard folder structure is essential.

BUT - I am using a unique name for the BGL (not modelLib.BGL, but ICAO_lib.BGL) and that works fine and should cause no conflicts. You should not use ANY default names for your files, please rename them (MyAirport, MyCompany etc.) to somthing starting with your airfields ICAO code or something else unique!

Like this:
image image image

5 Likes

Yeah Wild lynx, good points. I prefer to do something like this, which is similar:

PackageSources\airportxxxx-ModelLib
Scenery\airportxxxxObjects

This seems to work well for me.

1 Like

This problem is appearing in several places now and in-development ADE for MSFS encourages it. I am going to change the code

3 Likes

Thanks for this thread! I was completely unaware of this issue until thankfully linked to this in flightsim.to. Great reading this and getting some more understanding on the libs. When I was learning and watching tutorials, I was under the impression that the modelLib folder must be that in order to load models. Good to know that that is not the case. I have changed one of my packages and I will be changing my other ones and sending updates out tonight.

2 Likes

Do you think this logic applies to Airports as well? Since the latest patch today, my created airport has lost ATC, Approaches, ILS and created Waypoints. I use the standard folders you mentioned. Perhaps the SDK now requires updating

1 Like

For those who have an interest in ADE I have changed the code to include the airport package name in the ModelLib source folder

4 Likes

Is ADE available to use for MSFS? The site only has a link for an older version.

It’s in alpha. There is more work than I had hoped for but it is in progress. :slight_smile:

4 Likes

Fantastic, glad to hear you are progressing, I can imagine all the complications this new sim has added.

If you need any guinea pigs, give me a shout :grinning:

Thank you :slight_smile:

Count me in too if you like. Retirement has provided unexpected spare time :grin:

1 Like

I will - many thanks

Could doubled and sunken runways you can see in the attched screenshots be a result of what you experienced people discuss in this thread? This happens when I use Navigraph Beta AIRAC 2011 v7 for MSFS2020 along with our custom scenery for LTFM.
PS. I shared all these screenshots in Navigraph forums yesterday. This was a problem during initial beta stages but then it was sorted out somehow. Now it re-appeared (Sunken and Doubled runways).

EDIT: My problem solved by changing the hierarchy of the add-ons in Community folder ie. I lovered my scenery folder to go below navigraph-navdata folder and problem solved.

1 Like

Best option is to rename it, don’t move or delete it. All models seems to be located in that file now as of SDK update 0.7 mostly to prevent assets from being stolen by other people.

Just encountered this issue because it is breaking fsdreamteam’s Key West pay-ware. The conflict isn’t a direct one, but somehow conflicts between freeware add-ons are affecting Key West. Here are more details.

I am SO GLAD I found this thread! In the past, when troubleshooting and discussing CTD events, all too often, I hear comments to clear the community folder, since addons can cause crashes. Of course, when I ask WHY, I rarely receive anything specific other than some addons can be built in a non-ideal way. So I think this thread gets to one of the possible roots of many frustrating CTD issues.

So to summarize, as a well-informed user of the sim, I should be inspecting all of my community folder addons (scenery AND airports) to insure they do NOT have the modelLib.BGL file inside a path: AddonName/scenery/global/scenery/modelLib.BGL

If that is correct, then what is the corrective action? I surmise that I can simply change the path. So, if I just replace the word “global” in the above path, with something like “mycompany”, then that should eliminate the issue? Is that all that is required? Another idea might be to rename the .BGL to something other than the default modelLib.BGL, in order to further avoid any possibility of conflict?

If the above is not fully correct, then please respond. My suspicion upon thinking about this further, is that the layout.json file probably needs to include the proper path of the .BGL file(s). So the maker of the addon scenery, would need to rebuild the project, and issue an updated version for users to download and replace?

It is so great that we have an open platform for users to create an unlimited amount of content via the SDK. If done correctly, its an awesome thing!! But if done incorrectly, it just perpetuates the perception of a “buggy” system which is not the fault of the sim itself, rather an addon that was built in a non-ideal way.

Thanks again!! Great post.

Hi all!

If I understand all the above right,can I myself just go to the “layout.json” files change the name of the
modelLib.BGL to something unique and than go to that path and rename that BGL file??
Is it that simple? I am asking, because I have 86 modelLib.BGL in my Community folder and do not want to wait for the different authors to do that.

Scotty

1 Like

Then all textures will be lost