Lorby_SI

P3D 4.4 addon autodiscovery broken

Recommended Posts

Hello @ll,

this got buried in time a little bit, but I think that it is important to know. Since P3D 4.4 the two add-ons.cfg files no longer work as they should:

https://www.prepar3d.com/forum/viewtopic.php?f=6312&t=132273

In day-to-day usage this doesn't make a lot of difference - except when you are using the P4AO tool, which still assumes the correct operation of those files. I haven't had reports of bad things happening, this is just something to be aware of.

There may be problems though when updating from an earlier P3D version or upgrading to the next P3D iteration (when that issue has been fixed) - because then the addon-definitions will start a trek between those two files.

Best regards

Share this post


Link to post
Help AVSIM continue to serve you!
Please donate today!

Thanks for this Oliver. I can make sense now of the presence of scenery titles in packages where they shouldn’t exist. But your right, I haven’t noticed any ill effects other than the mentioned confusion. 

Recently I made a decision to get my head around and learn the addon.xml method - I’ve succesfully started moving most of my scenery away from my root P3D folder. Your P4AO tool has assisted me greatly, thanks.

In view of the next sim update and since I’m at the beginning of it all, do you think I should manually sync my Program Data addons.xml with that in the appdata - either manually using an approved note editor or your tool?  Would this be the way of doing it?

 

cheers,

Andy

 

Share this post


Link to post
3 hours ago, Lorby_SI said:

Hello @ll,

this got buried in time a little bit, but I think that it is important to know. Since P3D 4.4 the two add-ons.cfg files no longer work as they should:

https://www.prepar3d.com/forum/viewtopic.php?f=6312&t=132273

In day-to-day usage this doesn't make a lot of difference - except when you are using the P4AO tool, which still assumes the correct operation of those files. I haven't had reports of bad things happening, this is just something to be aware of.

There may be problems though when updating from an earlier P3D version or upgrading to the next P3D iteration (when that issue has been fixed) - because then the addon-definitions will start a trek between those two files.

Best regards

Hi Oliver, wonder how you perceive a problem would manifest itself and what should we look for?

Share this post


Link to post
1 hour ago, antonvs said:

Hi Oliver, wonder how you perceive a problem would manifest itself and what should we look for?

  1. If you remove or rename an add-on.xml, the package will still be listed as present and active in P3D. P4AO should be aware of the issue and either remove the package automatically or at least show it in violet. Removing addons with P4AO should work though.
  2. The package definitions are not where they should be, so people may be confused about where to find things when looking for them
  3. P4AO still assumes the correct operation, so it will add new addons to the correct file, while P3D expects them in the other one - that could lead to unnecessary requests for addon activation when starting P3D.
1 hour ago, Orbitandy said:

do you think I should manually sync my Program Data addons.xml with that in the appdata - either manually using an approved note editor or your tool

Looks to me like using only P4AO (the latest version) to handle addons is currently the safest bet to keep everything consistent - even when installing new addons. When the sim asks you to activate an addon, it is already too late - it has been added to the wrong file. No idea how the next P3D version will handle this, if the addons will be reorganized automatically or not.

But since nothing serious is happening, maybe we can just ignore this for the time being. It may be of interest for developers though.

Best regards

Edited by Lorby_SI
  • Upvote 1

Share this post


Link to post

What would happen if I put manually all packages into one add-on.cfg file.

Share this post


Link to post

Hello Oliver, I have a addon coloured violet in 'other addons.' V1+2 which is the AI Global Ships. In the 'Packages' drop down list its in green.

It does appear in the add-ons list in the options menu and is ticked.

I think I may have just copied this add-on over from Prepar3D ver 4.3 but it appears to be working ok. is it best to remove this and reinstall.

many thanks   ….. bob

 

 

Share this post


Link to post
1 hour ago, Nemo said:

What would happen if I put manually all packages into one add-on.cfg file.

Sorry, no idea. That is not something that I would do, the situation is bad enough as it is. We have autodiscovered and CLI addons mixed up in one single file, with other packages no longer existing on top. Manual editing can only make it worse IMHO.

Best regards

Share this post


Link to post
1 hour ago, onebob said:

have a addon coloured violet in 'other addons.' V1+2

probably a broken path to the ship models. Check where that addon definition is pointing to and if that path really exists.

If the addon works correctly, that unfortunately doesn't tell you much. There are three different ways to link sim objects (like the ships) to the simulator - add-on.xml, simobjects.cfg and copying them into the default "Boats" folder.

Best regards

Edited by Lorby_SI

Share this post


Link to post
36 minutes ago, Lorby_SI said:

Sorry, no idea. That is not something that I would do, the situation is bad enough as it is. We have autodiscovered and CLI addons mixed up in one single file, with other packages no longer existing on top. Manual editing can only make it worse IMHO.

Best regards

I was asking because I messed up my add-on.cfg files some time ago and I had to add the packages manually to the files according to some former backups and my memory. But for sure I was not 100% accurate with this. Luckily I have never experienced any issue. That's why I asked if it would make sense to have them all in one file.

Share this post


Link to post
11 minutes ago, Nemo said:

that's why I asked if it would make sense to have them all in one file.

No, it doesn't make sense. Each of the add-on.cfg files has a specific purpose. One lists all CLI installed addons (the one in ProgramData), the other (in AppData) all those that have been discovered automatically. The first one is static, the other is synchronized with "\Documents\Prepar3d V4 Add-ons" every time the simulator starts. Depending on how an addon has been installed and where its add-on.xml is, the package definition belongs in one add-ons.cfg or the other, you don't have a choice in this. Which is why the curent situation, where all addons pool up in one single file, leads to deleted packages being left behind, the simulator can't synchronize the autodiscovery folder anymore.

Best regards

Edited by Lorby_SI

Share this post


Link to post

Thank you, Oliver. Not sure if I understood all of it. But for now I leave it as it is and hope that no issues will come up. I also realized that developers also changed their preferred install method . For example Flight Breams KPDX went into "Program Data" while all other FB titles were in "Roaming". It is very confusing and I hope that LM cleans it up somehow.

Share this post


Link to post
38 minutes ago, Nemo said:

Thank you, Oliver. Not sure if I understood all of it. But for now I leave it as it is and hope that no issues will come up. I also realized that developers also changed their preferred install method . For example Flight Breams KPDX went into "Program Data" while all other FB titles were in "Roaming". It is very confusing and I hope that LM cleans it up somehow.

You cannot just manually edit any of the two add-ons.cfg files, that is all there is to it. There are rules which addon goes where and how it is added to the sim (autodiscovery or CLI = command line interface) "Learning Center -> Software Development Kit (SDK) -> Add-ons -> Add-ons Overview -> Distributing Add-ons".

To be more specific: it is pointless to add package definitions to the add-ons.cfgs for addons that have an "add-on.xml" in a subfolder of "\Documents\Prepar3D V4 Add-ons". The simulator discovers those automaticlly and adds them to the cfg file (the wrong one in V4.4, but it still does it). Addon packages that have been added with the CLI (for example SODE and Aerosoft) should be reinstalled.

It is not up to Lockheed if developers choose not to follow the specification. The Learning Center, which is part of every P3D installation, describes how and where addons are supposed to be installed. If people decide not to follow those guidelines, there is nothing that the platform provider can do.

Best regards

Edited by Lorby_SI

Share this post


Link to post

Does this mean that all add-ons that place a folder (including the add-on.xml) in "Documents\Prepar3d V4 Add-ons" during install then are listed as packages in the "AppData/Roaming add-on.cfg". All others in "Program Data add-on.cfg" ?

Edited by Nemo

Share this post


Link to post
2 minutes ago, Nemo said:

Does this mean that all add-ons that place a folder (including the add-on.xml) in "Documents\Prepar3d V4 Add-ons" during install then are listed as packages in the "AppData/Roaming add-on.cfg". All others in "Program Data add-on.cfg" ?

Normally yes, and you don't have to add them there, the simulator does it for you (= autodiscovery). But not in V4.4, which is what this thread is about. Im V4.4 all addons pool up in the ProgramData file. This will hopefully be changed again in the next P3D version.

Best regards

Share this post


Link to post
3 hours ago, Lorby_SI said:

probably a broken path to the ship models.

Yes you are right, it was a path problem, It didn't appear to like the 'Texture' folder in the Effects folder so added a separate line for the path in the xml file.

many thanks   bob

 

Share this post


Link to post
2 hours ago, onebob said:

Yes you are right, it was a path problem, It didn't appear to like the 'Texture' folder in the Effects folder so added a separate line for the path in the xml file.

many thanks   bob

 

Hi,

that shouldn't be necessary - when adding a component of category "Effects" on the "other addons" tab, you only have to point it to the effects folder itself. It is not required to add the texture folder inside it as a component too, the effects logic of the sim finds it anyway.

Best regards 

Share this post


Link to post
3 hours ago, Lorby_SI said:

Hi,

that shouldn't be necessary - when adding a component of category "Effects" on the "other addons" tab, you only have to point it to the effects folder itself. It is not required to add the texture folder inside it as a component too, the effects logic of the sim finds it anyway.

Best regards 

Is this problem with 4.4 related to the fact that I'm seeing a scenery called "FSDreamTeam Exclude" in purple in P4AO?

While its path does exist, and it does have a scenery and texture subfolder, it contains no bgl file(s), which may be why it's showing purple.

Share this post


Link to post
5 hours ago, Mace said:

Is this problem with 4.4 related to the fact that I'm seeing a scenery called "FSDreamTeam Exclude" in purple in P4AO?

No. It is shown in purple because it is empty. Empty or broken scenery paths both used to freeze P3D 4.3 on the initial splash screen. Not sure if this is still the same in 4.4, but the logic is still there. 

Best regards

Edited by Lorby_SI

Share this post


Link to post
8 hours ago, Lorby_SI said:

Hi,

that shouldn't be necessary - when adding a component of category "Effects" on the "other addons" tab, you only have to point it to the effects folder itself. It is not required to add the texture folder inside it as a component too, the effects logic of the sim finds it anyway.

Best regards 

Thank you for your reply, this is the xml file now

<?xml version="1.0" encoding="utf-8"?>
<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
  <AddOn.Name>Global AI Ship Traffic V1+2</AddOn.Name>
  <AddOn.Description>Global AI Shipping by Henrik Nielsen</AddOn.Description>
  <AddOn.Component>
    <Category>SimObjects</Category>
    <Path>SimObjects\Boats</Path>
  </AddOn.Component>
  <AddOn.Component>
    <Category>SimObjects</Category>
    <Path>SimObjects\Animals</Path>
  </AddOn.Component>
  <AddOn.Component>
    <Category>Effects</Category>
    <Path>Effects</Path>
    <Path>Effects\Texture</Path>     …..   added path to Texture folder
 </AddOn.Component>
  <AddOn.Component>
    <Category>Sound</Category>
    <Path>Sound</Path>
  </AddOn.Component>
  <AddOn.Component>
    <Category>Scenery</Category>
    <Path>Scenery\World\Scenery</Path>
    <Name>Global AI shipping traffic</Name>
    <Layer>163</Layer>
  </AddOn.Component>
</SimBase.Document>

Tried adding the \Texture to the line above but it did.nt like it

regards bob

Share this post


Link to post
3 minutes ago, onebob said:

<AddOn.Component>
    <Category>Effects</Category>
    <Path>Effects</Path>
    <Path>Effects\Texture</Path>     …..   added path to Texture folder
 </AddOn.Component>

This is wrong. An <AddOn.Component> tag can only have one single <Path> entry.

For a Component of Category "Effects" you only need to reference the top folder to the effects (.fx) files. The sim should find their textures on its own. And if it doesn't, you have to add another Component of category "Textures".

Best regards 

Edited by Lorby_SI

Share this post


Link to post
5 minutes ago, Lorby_SI said:

This is wrong. An AddOn.Component tag can only have one <Path> entry.

Best regards 

Ok thanks for getting back, I'll see if I can contact Henrik Nielsen regarding this issue.

bob

 

Share this post


Link to post
Posted (edited)
4 hours ago, Bytehunter said:

Im afraid im a victim of this behaviour....trying to find the reason for some ordering issue i have since many many hours now... without any luck. Devs arent really helpful too.

https://www.prepar3d.com/forum/viewtopic.php?f=6312&amp;t=132637

https://forum.aerosoft.com/index.php?/topic/143270-problem-with-scenery-order-part-ii/

HI,

if I read that correctly, you are trying to manipulate the add-ons.cfg files to force a certain sequence in the scenery library? IMHO this will never work, especially on larger setups. You are fighting two automated sim-internal processes (CLI and autodiscovery) so results become unpredictable - you have no guarantee that any editing that you do has the effect that you want or that it will stay that way. A small change (adding/removing an addon) can screw it all up - and that change doesn't even have to be scenery related, since all external add-on packages are listed in these two files. I always saw the package number as only an ID, not a sequence, comparable to the Area number in the scenery.cfg (where we have the additional Layer tag to control priority).

Personally I discarded that process on day one of P3D V4. It is a very old rule in IT that you don't try to manually override files that are managed by the software itself. Instead I made P4AO, which assigns proper layer numbers to all scenery components in the whole setup, scenery.cfg and add-on.xml references alike. That usually ensures that the scenery sequence stays in order.

Can't comment on SimStarter, sorry. 

Best regards

Edited by Lorby_SI
  • Like 1

Share this post


Link to post
Posted (edited)
9 hours ago, Lorby_SI said:

HI,

if I read that correctly, you are trying to manipulate the add-ons.cfg files to force a certain sequence in the scenery library? IMHO this will never work, especially on larger setups. You are fighting two automated sim-internal processes (CLI and autodiscovery) so results become unpredictable - you have no guarantee that any editing that you do has the effect that you want or that it will stay that way. A small change (adding/removing an addon) can screw it all up - and that change doesn't even have to be scenery related, since all external add-on packages are listed in these two files. I always saw the package number as only an ID, not a sequence, comparable to the Area number in the scenery.cfg (where we have the additional Layer tag to control priority).

Personally I discarded that process on day one of P3D V4. It is a very old rule in IT that you don't try to manually override files that are managed by the software itself. Instead I made P4AO, which assigns proper layer numbers to all scenery components in the whole setup, scenery.cfg and add-on.xml references alike. That usually ensures that the scenery sequence stays in order.

Can't comment on SimStarter, sorry. 

Best regards

Thank you for the comment.

I dont really try to order it in a different way because i want it like that, the sim orders it wrong and i try to fix it 🙂

I added a post in night, im not sure it was there already when you read it. I found the problem and its related to what you said in your post.

In my current state of the sim weird things happen when P3D loads the scenery from all 3 locations, the %appdata% addons cfg, the %program files% addon cfg / autodiscovery and scenery cfg entries. Whenever i do that at some point when installing other scenery the whole sim breaks basically.

And most of the time this happens after installation of WSSS from Imaginesim, wich comes with 4 layers of scenery done over a way that im not sure if its the right one. I didnt read the SDK yet but they dont write into

C:\Users\sdsd\AppData\Roaming\Lockheed Martin\Prepar3D v4

but into 

C:\ProgramData\Lockheed Martin\Prepar3D v4

But its not an autodiscovery scenery, they install to whatever place (outside the documents/P3D addons) and probably do it over CLI. But im not sure yet.... was a long night.

What happens is this:

When one is installing WSSS, at least in my case it will be added as  

[Package.0]
PATH=E:\P3D\Addon Scenery\ImagineSim\WSSS Singapore P3Dv4
TITLE=Imagine Simulation WSSS2_PD4
ACTIVE=true
REQUIRED=false

to this file

C:\ProgramData\Lockheed Martin\Prepar3D v4

There are 51 other entries and the last one is UUEE with the nr [Package.51]

Despite that it will be shown on top, next to UUEE. So WSSS = 0 and UUEE = 51 and still it shows like here

image.png.954b14637617b74753b1ae839a4875

This only stays until i add one other airport, doesnt matter wich one. Then WSSS gets either split up in 2 parts, 2 layers of it stay on top and the other 2 layers move down.

In this state i get blurries in the sim and some scenery overlap with payware. Like WSSS where suddenly the standard scenery overlaps. Seems the exclusion doesnt work anymore then.

So i thought why in all names can they both be next to each other in row when one is nr 0 and the other one nr 51 and saw that when i move WSSS from 0 to 51 all is fine.

Now all is like it should be, and they still stay together in row. Last one (nr 52) is WSSS and UUEE is 51, what is also reflected up there in the pic. No overlapping of standard scenery now too.

My simple question would be is what is the normal/right thing to happen when a scenery is installed into 

C:\ProgramData\Lockheed Martin\Prepar3D v4

Lets say there are 30 entries in there. What happens when one adds the 31.th, does it get the number 31 or does it get 0 and all the others move one up in numbers?

Edited by Bytehunter

Share this post


Link to post
Posted (edited)
1 hour ago, Bytehunter said:

My simple question would be is what is the normal/right thing to happen when a scenery is installed into 

C:\ProgramData\Lockheed Martin\Prepar3D v4

Lets say there are 30 entries in there. What happens when one adds the 31.th, does it get the number 31 or does it get 0 and all the others move one up in numbers?

That depends on how it is done. If the CLI is used, then I would expect that the addon is appended to the end of the list, getting the next free package ID. From what you describe, the installer of that scenery may be editing the add-ons.cfg directly instead of using the CLI, hence your problems. I don't think that this has something to do with what I wrote above, but I currently don't have an addon that uses CLI to try it out. And yes, the add-ons.cfg in ProgramData is the correct one for external package definitions that are not in the autodiscovery folder.

The part that is broken is, that P3D doesn't distinguish anymore between global and local addons. Global addons, that are supposed to be available to every user of the PC, are managed with the cfg files in ProgramData, while local, user-specific, addons and settings are supposed to be managed in AppData\Roaming, together with Documents\P3D Addons, since that is a local, user-specific folder too. You can have any number of different user accounts on the PC, each using the same P3D installation, but with totally different addons. (btw- this has always been possible, in FSX too.Minus the add-on.xmls of course). P3D V4.4 is throwing all of them into the same add-ons.cfg, and there is no telling what kind of problems that may cause - now or with the next P3D version that fixes it...

Just to repeat - the sequence of the packages doesn't matter at all if you apply proper layering. But you need a tool for that.

Best regards

Edited by Lorby_SI

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