• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Bug in decompiling boundaries in bvcf.bgl

Messages
16
Country
germany
Hi ScruffyDuck,

when decompiling file 'Scenery\World\Scenery\bvcf.bgl', SDE seems to hang in an endless loop. I had the same problem in my own decompiling code, but now it works. Here is how i decompile bgl files with boundary sections:

I assume you used Winfried Orthmanns BGL file structure description document, too. So i will only describe where my code differs from his doc.

The fixed part of the boundary record ends with "maximumAltitude" (offset 28, size 4), so the size of the fixed part boundary record is 32. After that follows a table of subrecords, similar to the subrecords in airports.

The following subrecords are possible:
- id 0x19: name
- id 0x21: point list
- id 0x12: COM
- id 0x00: end of subrecord table

The described structure of the name subrecord is correct, however it is not always the first subrecord. Sometimes its missing at all.

The point list subrecord is almost correct, except for the field "type of point", which is only one instead of two bytes. The second byte holds the "origin index" (see SDK docs) instead.

The COM subrecord has exactly the same structure as the COM subrecord of airports.

The end of the subrecord table is marked by an id with the value 0x00. Nothing else follows, not even the usual subrecord size field. After reading id = 0, the file seek position is right after the end of the whole boundary record (as calculated from the boundary records size field).

Since i dont know the sequence of subrecords, i use a loop after the fixed part of the boundary record. In the loop, i read the subrecord id, and then i use switch/case statement to read the remaining part of the subrecord.

I tried my code with ALL bgl files of the FSX Deluxe edition. I didnt found any further errors nor any other boundary subrecord types.

However, there are a few duplicate boundaries and geopols:
- BNXWorld0.bgl: boundaries: 7908 unique + 6 duplicates
- BNXWorld1.bgl: boundaries: 9136 unique + 7 dups; geopols: 49 unique + 18 dups
- BNXWorld2.bgl: geopols: 332 unique + 153 dups
- BNXWorld3.bgl: geopols: 361 unique + 170 dups
- BNXWorld4.bgl: geopols: 327 unique + 182 dups
- BNXWorld5.bgl: geopols: 34 unique + 16 dups
- bvcf.bgl: boundaries: 4201 unique + 0 dups

I havent figured out yet why there are so many dups.

If you need further info, just yell .. :)

By the way, what programming language are you using for SDE ?
I am using C# for my decompiling stuff.
 

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,853
Country
unitedkingdom
Hi Millka - sorry to miss this post - dunno how :eek:

I will take a look at the issue of boundaries.

Both SDE and ADE are in C# using VS2005.
 
Top