Jump to content
Sign in to follow this  
jabloomf1230

Little Navmap cannot read P3D v4 BGL files

Recommended Posts

I just noticed an issue. I updated one of my own personal use airports with ADE 1.75 for use in P3d V4. Then I forgot that it was also in a scenery folder used in P3d V3. Because the runway, taxiway and apron IDs differ between the two BGL versions and each of those items also have an additional V4 structure containing 5 GUIDs for seasonal materials, the Load library search in LNM crashes. This is not a bug, since I don't think that there is backwards compatibility of airports compiled for V4 when using them in P3d V3. Further, I'm not quite sure what P3d V3 will do if it encounters a V4 airport in its scenery library.

Just keep this in mind in case an LNM user runs afoul of the issue in the future. Recompiling the airport with ADE 1.71 for P3d V3 eliminates the LMN CTD.

  • Upvote 1

Share this post


Link to post
Share on other sites

Thanks a lot Jay!

I moved this from the planning thread to a new topic.

I fixed the crash (due to a missing apron record) but it seems that LM was creative and changed also other parts of the BGL format. They introduced new records. The GUIDs are not a problem.

P3D v3 should be fine when reading v4 files since the changes went into new records which are ignored if they are unknown to the program. But will not see any aprons, runways and taxiways in v3.

Looks like I have to do a bugfix release after digging and guessing through the new structures. :mellow:

Alex

Edited by albar965

Share this post


Link to post
Share on other sites

Haha, I had to try it myself and you're right, it makes for a funny looking airport.😀."Cleared to land... runway... Uh wait a minute... Uh...".

VOXATC's message is even more comical. "You can't fly to an airport without a runway."

 

Share this post


Link to post
Share on other sites

But you can see the runway in P3D v4, right? 

and it seems that other programs also need to be adapted. 

What really gets me miffed is that all these changes in the BGL files are not documented causing a lot of work. Even the BGL file format documentation on fsdeveloper is a community effort.:dry:

Alex

Share this post


Link to post
Share on other sites

Yes. P3d V4  works fine with ADE airports compiled with V4 as a target.

The changes to the aprons, taxiway and runways is documented in the V4 SDK online information  but one would have to look for it to know about it, which is not very helpful.

 

 

Share this post


Link to post
Share on other sites

Thank you for the hint. I fixed that in my development version here. Aprons, taxiways and runways are back.

It was the materialSet GUID as you already mentioned. I just have to skip 16 bytes for the GUID and then continue reading.

So easy that it was not worth all the swearing and the bad mood.:smile:

Alex

  • Upvote 1

Share this post


Link to post
Share on other sites

materialSet is a structure of 5 GUIDs. Does that fit in 16 bytes, because normally in BGL files, each GUID is 16 bytes? I have to check a V4 airport BGL file  with a hex editor. LM is still somewhat obtuse about materialSet as they claim it has 5 GUIDs in order, one for each P3d "season". 

Share this post


Link to post
Share on other sites

Hi Jay,

I found 16 bytes of zeros before the next valid record for the new record types. The SDK documentation talks about a single GUID referring to one in a Material.xml file. I just tried it with a dummy material GUID which fills these 16 bytes with stuff <> null.

Here is the enumeration AirportRecordType that has the new v4 types. Can be helpful if you want to dive into the BGLs with a hex editor.

Alex

Share this post


Link to post
Share on other sites

Thanks. Since ADE 1.75 does not yet support adding seasonal materials, there is no way of testing this. I suppose that it is possible to bit pack 5 texture GUIDs into 16 bytes, but for now. unless LM explains this better on their official forum, it will remain a mystery. It has no impact on any 3rd party utilities  and apps (as long as they compensate for the extra 16 bytes).

Share this post


Link to post
Share on other sites

I located some other online discussion about this and it appears that the GUID is for the entire material set, which as you pointed out would be defined in  Materials.xml.

Share this post


Link to post
Share on other sites

Thanks for the confirmation. There is no way to pack more than one GUID into 16 bytes anyway.

This is the only change in the format as far as I can see (besides all the other UTF-8 and add-on.xml fun ...).

Alex

Share this post


Link to post
Share on other sites

There's a few more changes, but they don't impact scenery BGL files. The fx format for lights has changed, but that's plain text so it is easy to figure it out. Besides, LM provided an addon to edit and test fx files while running the sim.

 

Share this post


Link to post
Share on other sites

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