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

Bgl2Xml GUI Available

Messages
497
Country
unitedstates
Bgl2Xml GUI is a simple windows interface to SDE allowing users to decompile Bgl files to XML. You can also view the resulting XML in the XML Editor or viewer of your choice. Download it from here:

http://www.scruffyduck.co.uk/files/bgl2xml_gui_90.zip


All feedback much appreciated.

bgl2xml does not produce Valid XML.

It seems not to convert & to & ,

BGL : "Jack & Jill" should convert to XML: "Jack & Jill"

Should be a simple fix ...

(Not tested it for correct conversion of other RESERVED XML Characters)

Geoff
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Actually Geoff...

& or & are equivalent bitwise AND operators, for example 5 3 & will evaluate to 1

&& or && or and are equivalent logical operators

XML will parse all three of the following exactly the same:

Code:
(A:Var1,unit) (A:Var2,unit) &&
(A:Var1,unit) (A:Var2,unit) &&
(A:Var1,unit) (A:Var2,unit) and

An ampersand in quote marks "&" is treated as a string literal...
 
Last edited:

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,854
Country
unitedkingdom
bgl2xml does not produce Valid XML.

It seems not to convert & to & ,

BGL : "Jack & Jill" should convert to XML: "Jack & Jill"

Should be a simple fix ...

(Not tested it for correct conversion of other RESERVED XML Characters)

Geoff

Thanks for the feedback. 0.9 is a very old version of Bgl2Xml. I checked the codebase and it would appear that the current version does make that substitution. I will check it to see if that works in practice.
 
Messages
497
Country
unitedstates
Actually Geoff...

& or & are equivalent bitwise AND operators, for example 5 3 & will evaluate to 1

&& or && or and are equivalent logical operators

XML will parse all three of the following exactly the same:

Code:
(A:Var1,unit) (A:Var2,unit) &&
(A:Var1,unit) (A:Var2,unit) &&
(A:Var1,unit) (A:Var2,unit) and

An ampersand in quote marks "&" is treated as a string literal...

I believe, for example
<Airport
country="United States"
state="Alaska"
city="Palmer"
name="B & B Boys Ranch" <<<<<<<<<<<<< INVALID
lat="61.5929499641061"
lon="-149.302272051573"
alt="91.44M"
magvar="-25"
trafficScalar="0.7"
airportTestRadius="5000.0M"
ident="3AK6"
>


is INVALID.

Line should be

name="B &amp; B Boys Ranch"

==============
Firefox confirms this, when one "attempts" views the XML in it's browser.
bcomp.exe also complains about the line, till it is corrected, then it Compiles.

As I said, I am a XML "noob" , but this is what i see happening in practice.

Geoff
 
Messages
497
Country
unitedstates
Thanks for the feedback. 0.9 is a very old version of Bgl2Xml. I checked the codebase and it would appear that the current version does make that substitution. I will check it to see if that works in practice.

Please can you point me towards the lastest version :)

Also, is Bgl2Xml exepected to decode all of a bgl file. ?

It seems if I use it (I admit an OLD version) to convert a bgl to xml, and then use bglcomp to turn it back into a bgl, the resulting bgl is significantly smaller than the original.

Should I be doing this a different way ??

Sorry, I am new to XML/BGL -- if this is a requently answered Question.

Geoff
 
Last edited:

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,854
Country
unitedkingdom
Please can you point me towards the lastest version :)

Also, is Bgl2Xml exepected to decode all of a bgl file. ?

It seems if I use it (I admit an OLD version) to convert a bgl to xml, and then use bcomp to turn it back into a bgl, the resulting bgl is significantly smaller than the original.

Should I be doing this a different way ??

Sorry, I am new to XML/BGL -- if this is a requently answered Question.

Geoff

Are you looking for the command line version or the GUI version?

Decompling to XML is an imprecise activity. The FS community has not direct access to the file format (it is proprietary to Microsoft). so our ability to decode it depends on the work of members of the community. We think we can do everything but of course cannot be sure. The only thing thatI know the current versions of Bgl2Xml do not decompile are model (mdl files) these can often be a large part of a bgl file if present. In developing our tools we spend a lot of time checking the output for match to input. My experience is (with scenery and airport files) is that what we get back after decompiling and compiling matches the original in all material respects.

I would not expect the size of a recompiled file to be the same as that of the source file. There are lots of reasons for this of course.
 
Messages
497
Country
unitedstates
Jon

I found a later GUI version, 1.0 ? and that works fine.
Thank you for developing that .. much apprecaited. ( labor of love ! )

Not only does it handle the "&" decoding, but also, the bgl file I am working with, once converted to XML with this later version, has not issue compling again with "bglcomp".

The bgl file I was looking at is a standard MS FSX scenery file.

Can you suggest then, what data might be missing from the de-complied/re-compiled version. Its about 75% that of the original, that seems like a lot of Data to have lost.

Geoff
 

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,854
Country
unitedkingdom
Can you suggest then, what data might be missing from the de-complied/re-compiled version. Its about 75% that of the original, that seems like a lot of Data to have lost.

Not really. Inside the bgl file are a series of sections and then a series of lists of elemenets and then a set of elements. We are told that MS used BglComp to compile their files however we are aware that they seem to have managed some things that we cannot with the XMLsource. It may well be that the compiler available to us is more efficient at handling the sections or lists etc.

It is also possible the decompiler does not decompile everything - though to be honest I think we do get it all.

In fact the only test to consider important is that if you take a given bgl file, decompile it and recompile it that the airport or whatever is the same. If oyu do find anything missing with our decompiler then let us know.
 
Messages
497
Country
unitedstates
Not really. Inside the bgl file are a series of sections and then a series of lists of elemenets and then a set of elements. We are told that MS used BglComp to compile their files however we are aware that they seem to have managed some things that we cannot with the XMLsource. It may well be that the compiler available to us is more efficient at handling the sections or lists etc.

It is also possible the decompiler does not decompile everything - though to be honest I think we do get it all.

In fact the only test to consider important is that if you take a given bgl file, decompile it and recompile it that the airport or whatever is the same. If oyu do find anything missing with our decompiler then let us know.

That raises an interesting question:

Would there be a significant speed change - load / run, beween the original scenry BGL files, and ones re-compiled with the supplied SDK's bglcomp. ?

I would tend to agree with you that the original compiler might either be less efficient, or is putting extra data into the original bgl files.

Interesting exercise would be to write/run a script to de-compile, then re-compile all the ( say airport) .bgls, and see what happend when the Sim was run !!!

Fun stuff !!

Geoff
 
Last edited:
Top