Jump to content
Sign in to follow this  
Pete Dowson

Please, can someone explain how scenery add-on priorities (layers) work?

Recommended Posts

I asked this over in the L-M Support Forum, but no one is answering. I assume no one can explain?

This is delaying my updates to MakeRunways to handle the new complex add-on structures.

===========================================

I've been trying to get my head around the new (complex to me) system for add-on sceneries. Does any one have an idiot's guide I can use please?

What I haven't yet grasped is where I start (Add-Ons.cfg in the PROGRAMDATA folder?), and the priority (layering) of each Scenery add-on package. I assume they all follow on from an existing SCENERY.CFG file, but then the SDK lists the order as LOCALAPPDATA then APPDATA then PROGRAMDATA Add-On.xml files. Are the respective supplier folders in those always pointed to by the Add-Ons.cfg file, and if so is the order in that cfg file then irrelevant?

And then what is the use of the Add-Ons folders in the user's Documents folder?

Finally, if Layer parameters are explicitly given in each package, as they can be, are those absolute or relative? i.e. is Layer=1 then the very first (lowest priority, base) processed scenery, or is 1 the first add-on after the default scenery layers, or even after all those in the existing SCENERY.CFG?

And what if there are several packages stating Layer=1? Are they considered 1, 2, 3, in order, or does each take 1 and push the others up?

I'm sure all this must be written somewhere, but finding all the bits in the SDK and trying to put them together is a nightmare. Maybe it's my failing aging brain?

Thanks in advance to anyone who can help me here. i was planning on revising my MakeRunways freeware program to cope, but I was about to start planning the changes when I realised I didn't know even where to start! Processing in that program must be done in the same order that P3D now does it.

Pete

 


Win10: 22H2 19045.2728
CPU: 9900KS at 5.5GHz
Memory: 32Gb at 3800 MHz.
GPU:  RTX 24Gb Titan
2 x 2160p projectors at 25Hz onto 200 FOV curved screen

Share this post


Link to post

Good luck, Pete.  I've been asking in a roundabout way how it's supposed to work too.  And have been getting chastised for even asking.

Seems if a developer uses the "recommended" LM XML installation method, NO layer is entered in the XML file for the scenery addon (when adding a scenery addon).  And NO entry is made in the scenery.cfg file for the addon either.  And even though the addon will get added to the Scenery Library GUI list, you can't do anything with it as far as editing it using the GUI, or changing it's priority in the list.

I've been told "That's not a problem! You can still change the priority of it by SIMPLY (???) manually editing the XML file for it by adding a "Layer" entry in the XML file!"

Uh...OK.  So if I have 100+ addon sceneries, all I have to do is manually edit 100+ separate XML files every time I add a new scenery?

How does P3D know how to layer any sceneries using the XML method as of now?

I'm still as lost as you are as to how much "better" this is supposed to be.     


Rick Ryan

Share this post


Link to post
3 hours ago, Pete Dowson said:

I asked this over in the L-M Support Forum, but no one is answering. I assume no one can explain?

This is delaying my updates to MakeRunways to handle the new complex add-on structures.

===========================================

I've been trying to get my head around the new (complex to me) system for add-on sceneries. Does any one have an idiot's guide I can use please?

What I haven't yet grasped is where I start (Add-Ons.cfg in the PROGRAMDATA folder?), and the priority (layering) of each Scenery add-on package. I assume they all follow on from an existing SCENERY.CFG file, but then the SDK lists the order as LOCALAPPDATA then APPDATA then PROGRAMDATA Add-On.xml files. Are the respective supplier folders in those always pointed to by the Add-Ons.cfg file, and if so is the order in that cfg file then irrelevant?

And then what is the use of the Add-Ons folders in the user's Documents folder?

Finally, if Layer parameters are explicitly given in each package, as they can be, are those absolute or relative? i.e. is Layer=1 then the very first (lowest priority, base) processed scenery, or is 1 the first add-on after the default scenery layers, or even after all those in the existing SCENERY.CFG?

And what if there are several packages stating Layer=1? Are they considered 1, 2, 3, in order, or does each take 1 and push the others up?

I'm sure all this must be written somewhere, but finding all the bits in the SDK and trying to put them together is a nightmare. Maybe it's my failing aging brain?

Thanks in advance to anyone who can help me here. i was planning on revising my MakeRunways freeware program to cope, but I was about to start planning the changes when I realised I didn't know even where to start! Processing in that program must be done in the same order that P3D now does it.

Pete

 

Hi Pete,

You have three entry points to look for scenery:

  • C:\ProgramData\Lockheed Martin\Prepar3D v4\scenery.cfg (does what it always did).
  • C:\Users\...\AppData\Roaming\Lockheed Martin\Prepar3D v4\add-ons.cfg (this contains the automatically discovered add-on.xml's)
  • C:\ProgramData\Lockheed Martin\Prepar3D v4\add-ons.cfg (this contains the add-on.xml that have been added by an installer)

First, you read the scenery.cfg, then the cfg file from AppData and finally the cfg file from Program Data. If no layer tag has been assigned, this is the order in which scenery will appear, bottom to top priority. 

From the cfg files you read the packages, open the corresponding add-on.xml, parse the contents for Category "Scenery" nodes, navigate to the designated Path and read the BGLs. If an AddonPackage has a layer attached, then it will precede a scenery in the scenery.cfg that has the same layer. Otherwise (I assume) that the order in which P3D reads the files defines their layering. At least that is what it looks like when you check the Scenery Library dialog in P3D.

I have written a management tool for this, and I am more or less confident that I know how all of this works. New things are discovered all the time though. The organizer could supply a fully featured (temporary) scenery.cfg for your MakeRunways to parse if you want (I know, this is clunky. Just a thought).

If you want, contatct me with a PM here, then I can share the more technical details.

Best regards


LORBY-SI

Share this post


Link to post
49 minutes ago, Lorby_SI said:

You have three entry points to look for scenery:

The SDK blurb seems to imply that %LOCALAPPDATA% might be used too, making 4?

51 minutes ago, Lorby_SI said:

If an AddonPackage has a layer attached, then it will precede a scenery in the scenery.cfg that has the same layer.

Right. So Layer=1 will come before ALL of the default layers?

This system seems very clunky to me. Does it to you?

52 minutes ago, Lorby_SI said:

I have written a management tool for this, and I am more or less confident that I know how all of this works. New things are discovered all the time though. The organizer could supply a fully featured (temporary) scenery.cfg for your MakeRunways to parse if you want (I know, this is clunky. Just a thought).

That's very kind of you, thanks! It would help users of MakeRunways until I can get to making the right changes to it. Could I include it in the MakeRunways download, and auto-execute it before doing my thing?

I am away next Wednesday till the following Tuesady, so I cannot really get down to doing anything serious with my program for a while yet.

petedowson@btconnect.com is the email for any attachments, please.

55 minutes ago, Lorby_SI said:

If you want, contatct me with a PM here, then I can share the more technical details.

I'm not good with PMs and they are difficult to refer back to at a later date. Would email be okay? Don't post yors here, but if you send me your file and will have it. ;-)

Thank you very VERY much!

Pete

 


Win10: 22H2 19045.2728
CPU: 9900KS at 5.5GHz
Memory: 32Gb at 3800 MHz.
GPU:  RTX 24Gb Titan
2 x 2160p projectors at 25Hz onto 200 FOV curved screen

Share this post


Link to post
1 minute ago, Pete Dowson said:

Right. So Layer=1 will come before ALL of the default layers?

Theoretically yes. But in reality a layer node with value 1 is ignored, the lowest that you can push an xml based addon package is layer 2. (right above Scenery\World\ and before all the others)

I will add the export to my app and be in touch.

Best regards

 

 


LORBY-SI

Share this post


Link to post
1 hour ago, Lorby_SI said:

From the cfg files you read the packages, open the corresponding add-on.xml, parse the contents for Category "Scenery" nodes, navigate to the designated Path and read the BGLs.

There's no need to parse the two add-ons.cfg files each separate add-on.xml file to look for sceneries.

P3D does that for you, because it creates a file named scenery_addons.xml under %PROGRAMDATA% which is always kept updated by the sim and IT IS sorted by the package order the sceneries appears in the add-ons.cfg files so, instead of opening the 2 addons.cfg file and each subfolder containing the add-on.xml file and looking for sceneries, it's enough to open this one, which is way easier and faster to parse.

Of course, in your case, since you are working on a management utility, you would still have to open the add-on.xml to read or write the Layers but, in case of Pete, if he only needed to have an update list of all the scenery areas, it might be simpler to just read the scenery_addons.xml

Share this post


Link to post
1 hour ago, FalconAF said:

How does P3D know how to layer any sceneries using the XML method as of now?

With the Layer property, EXACTLY like the scenery.cfg.

 

1 hour ago, FalconAF said:

I'm still as lost as you are as to how much "better" this is supposed to be.     

As I've said, so many time alreadys, it would be nice if LM would allow to rearrange those areas together in the Scenery Library, because it CAN be one, by setting the Layer property in the add-on.xml file so, it's only a limitation of the UI, which might eventually be improved. Don't you think we have been already asked for this feature many times ? You should ask it to, if enough users would ask for it, they might eventually listen.

But even without the ability to rearrange the library, the system is already WASTLY superior to the old one as it is now, because:

- It allows to install anything outside the sim folder, including Effects, Sounds, Landclasses, Autogen, which wasn't possible before. You seem to be so taken in your requirement for having the Scenery Library "sorted" and "tidy", but that's just what you can see. You should worry instead of the mess that creeps into the sim over time, when everybody installs in the default folders, hoping that nobody would call effects or textures by the same name, and good luck sorting out who installed what...without even mentioning the sorry disaster which were the centralized Autogen or terrain definitions.

- It allows you to Uninstall the sim, even completely, even cleaning all its settings, without reinstalling your addons. Only the good ones that switched to this system, of course...As long as you still have the add-on.xml file in the Documents folder, the sim will find it and reactivate the addons on the next restart.

- It fixes the issues of sceneries not showing up because you or something else has corrupted the scenery.cfg, since nobody would have to mess with it anymore.

- If fixes the issues of modules not starting, because one of the centralized DLL/EXE XML was corrupted. Now, THIS one still has a bug, but LM is aware of it, and will fix it in the first upgrade.

In fact, I'm lost as why anybody in his right mind would even want to go back to the old system, once it tried the now one and, especially, understood it.

And yes, it would be best if LM added the ability to rearrange everything from the Scenery Library. And we are lobbying them to get it.

 

  • Upvote 1

Share this post


Link to post
30 minutes ago, virtuali said:

There's no need to parse the two add-ons.cfg files each separate add-on.xml file to look for sceneries.

P3D does that for you, because it creates a file named scenery_addons.xml under %PROGRAMDATA% which is always kept updated by the sim and IT IS sorted by the package order the sceneries appears in the add-ons.cfg files so, instead of opening the 2 addons.cfg file and each subfolder containing the add-on.xml file and looking for sceneries, it's enough to open this one, which is way easier and faster to parse.

Hello Umberto,

IMHO this file does not contain the layering information. It is only displaying the order that P3D reads the config files, so if something like MakeRunways depends on knowing the actual layering of the scenery component in the total Scenery Library, I see no other way than reading all the config files, sort the components by layer and then browse the BGLs in the proper order.

I might be wrong of course.

Best regards


LORBY-SI

Share this post


Link to post
1 minute ago, Lorby_SI said:

Hello Umberto,

IMHO this file does not contain the layering information. It is only displaying the order that P3D reads the config files, so if something like MakeRunways depends on knowing the actualy layering of the scenery component in the total Scenery Library, I see no other way than reading all the config files, sort the components by layer and then browse the BGLs in the proper order.

I might be wrong of course.

That's why I edited the post. Yes, depending if the utility needs to know the layering or not, it might be required to read the individual add-ons.xml or not.

Share this post


Link to post
15 minutes ago, virtuali said:

That's why I edited the post. Yes, depending if the utility needs to know the layering or not, it might be required to read the individual add-ons.xml or not.

Well, as Pete was asking about the layering specifically, I suppose that it matters to him. I guess MakeRunways needs to know this, so it can determine if scenery information is overridden on a higher layer number.

Best regards


LORBY-SI

Share this post


Link to post

Hello @ll,

in the light that Makerunways is not the only tool reading the scenery.cfg I have decided to add a feature to my Addon Organizer that will temporarily replace the scenery.cfg with a file that contains all the Scenery Library in cfg-type format, no matter if the scenery is in an add-on.xml or not.

@Pete:
I will send you a link to the download shortly. I hope that you find it useful.

Best regards


LORBY-SI

Share this post


Link to post

 

OK, I'll admit I'm a tad "focused" on the inability to EASILY re-arrange the priority level of addons (and anyone in their right mind would not consider the current "Just manually edit the XML files..." a reasonable solution).

And I'm pretty sure LM is aware of the issue already. If so, why haven't THEY posted about it? 

Really, we have commercial addon developers here and on other forums who can't agree about the "new XML addon method" and whether it is "good or bad or just different than before....".  People like Pete and FSDT and others who have been addon developers for YEARS (and in some cases, well over a decade).  And all of THEM can't agree on any of this.

Thanks for recommending that as a simple USER of P3D who has ALSO been using flight sims for 3 decades and DID know how to stop all the "problems from the past happening" already (that you listed from the past), I should start complaining to LM.  Where were all the Beta Tester Developers who were testing all this stuff long before us simple users got a hold of it after release?  Why wasn't this sorted out long before different developers started using different ways of adding their sceneries, including new P3Dv4 installers that would go back to fully working P3Dv3 installations and CHANGE those installations in ways that screwed tham up for their users...WITH NO PREVIOUS WARNING it would happen (like FSDT's P3Dv4 new installers AUTOMATICALLY ALSO changes all the addons entries in my already fully functional P3Dv3 installation?

We agree that LM needs to either:

1.  Give the USER the ability to manage their OWN P3Dv4 (and now also v3) Scenery Libraries by being ABLE to use the buttons in the GUI, or...

2.  Just get rid of the whole Scenery Library GUI to begin with, if the user can't DO anything using the GUI to begin with...or if the addon isn't even going to be shown in the list to begin with.  What would the purpose of even HAVING the Scenery Library GUI anymore if it is of no use to the USER of the software?

I'm not trying to be obstinate.  But I do have to take the side of some of the very well, long time, and respected third-party developers here, like Pete.  Seems to me P3Dv4 was released long before it was ready for prime time with it's current issues concerning new scenery addon methods.  It is not "user friendly" in any manner in it's current state for the CONSUMERS of the product.

I sincerely hope it all gets worked out.  But I NEVER expected a third-party developer's new P3Dv4 installer to "go back" and screw up my fully functional P3Dv3 installation in a way that I could no longer use IT'S Scenery Library GUI to manage my sceneries in IT.  An then get "blamed" by that developer that it's "all my fault" just because of the way I wanted to manage my own flight sim's scenery...ways that worked perfectly well in the past for the consumer end-user.

Peace.

 


Rick Ryan

Share this post


Link to post
9 minutes ago, FalconAF said:

and anyone in their right mind would not consider the current "Just manually edit the XML files..." a reasonable solution).

Which is why I sat down and wrote a free tool to easily do that. Check the sticky thread right on top of this forum.

Admittedly I don't know anything of the rest that you are writing.

What I do know is:

  • The principle with external XMl configuration files has been around since Version 3.something. It has been ignored a lot longer than you suggest. The only thing that is new with V4 is, that P3D will now find those files on its own. You don't have to tell it about them any more.
  • "All those developers in the beta program" are acutally very very few. Just being on the LM developer program doesn't entitle anyone to get early access - the great majority of us has to wait for the release, just like everyone else.

Best regards

 


LORBY-SI

Share this post


Link to post

OK, thanks.  I hadn't seen that download yet.  I had seen the start of the thread, but after reading the first 3 pages that basically contained copy/pastes of XML editing examples, I never went any farther.  If that thread is going to be a "sticky" for your download, may I recommend the "most current" download gets moved to the first post in the thread and continually updated there (instead of it currently being 8 pages into the thread)?

I get it and give it a try.  Thanks

 

 


Rick Ryan

Share this post


Link to post
6 hours ago, FalconAF said:

I sincerely hope it all gets worked out.  But I NEVER expected a third-party developer's new P3Dv4 installer to "go back" and screw up my fully functional P3Dv3 installation in a way that I could no longer use IT'S Scenery Library GUI to manage my sceneries in IT.  An then get "blamed" by that developer that it's "all my fault" just because of the way I wanted to manage my own flight sim's scenery...ways that worked perfectly well in the past for the consumer end-user.

Peace.

 

Fully agree. Bought KLAS and installed it in P3D3.4 and found that the installer had moved all of my older FSDT airports - without warning, with nothing working any more of course.

I will not say here what I could have done to Mr. Virtuali if he would have been present at this moment.


Erhard

I9 11900k RTX 3080 TI 3 x 55" LED TV 4K, 2 more PCs for displays and hardware connection Prosim A320

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...