Problems with Bgl2Xml Decompile

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
#1
NOTE: AFAIK, BGL2XML versions later than 1.10 fail to show the XML code source of BGLs compiled in FSX SDK BGLComp Compiler.
Since when :confused:

The current version of Bgl2Xml GUI is 1.5.1 dated 2 May 2011. Bgl2Xml command line is 1.3.1 dated 12 Jan 2011.

I have never received any reports that they do not work with FSX so if there is a bug I would certainly like to look into it......

EDIT
Bgl2Xml (137) GUI can be downloaded from here: http://www.mediafire.com/?kv3x6uzsk2tk1yd

When run for the first time the auto updater (near bottom left of the display window) should search for, find and offer to install 1.5.1.
 
Last edited:
#2
Since when :confused:

The current version of Bgl2Xml GUI is 1.05 dated 2 May 2011. Bgl2Xml command line is 1.3.1 dated 12 Jan 2011.

I have never received any reports that they do not work with FSX so if there is a bug I would certainly like to look into it......
Hi Jon:

I'll double check later today when I get back to my main FS computer, but IIRC, for sure it occurs with my "current" copy of BGL2XML 1.37 and IIRC, at least one other earlier version since the "GUI" release (which for some reason I had labeled the top install folder as version "BGL2XML_GUI_110" ...possibly in error as to the actual numeric version :eek:).


BTW: IIRC, I had originally downloaded both from AVSIM's file library, and those versions both worked fully prior to an online automatic update from your server. :confused:


However I'll diligently re-test the executables in question ASAP, and will post back here the resulting message that is generated. :)

[EDITED]

Just saw your edit above; I'll compare the linked version with the one on my FS computer and will report back.

Thanks ! :cool:

[END_EDIT]


GaryGB
 
Last edited:

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
#4
Thanks George.

To be fair Gary I should really sort out the 'official' downloads for my tools :eek: I don't upload to any FS sites any longer so whatever is on them will mostly be out of date. Another job to add to the list :eek:
 
#5
Hi Jon:

To follow up on my report above regarding certain versions of BGL2XML not de-compiling as they originally had when first installed after they had been updated via your online update server engine:


Product Name: Bgl2Xml_GUI.exe
Product Version: 1.2.0 (This was originally version "1.1.0" prior to update)
Date Modified: 12/1/2009 - 9:59 AM

1.) Decompilation input File: [FSX install path]\Scenery\Global\Scenery\Airport_Buildings_01_AP.bgl

2.) Click BGL2XML GUI "Go" button (no visible result seen on screen)

3.) Click BGL2XML GUI "View" button

a.) NotePad opens with "Airport_Buildings_AP.bgl.xml" title bar label
b.) Contents of NotePad XML code appear correct <...at a glance ;) >



Product Name: Bgl2Xml_GUI.exe
Product Version 1.3.7
Date Modified: 1/22/2011 - 4:55 PM


1.) Decompilation input File: [FSX install path]\Scenery\Global\Scenery\Airport_Buildings_01_AP.bgl

2.) Click BGL2XML GUI "Go" button

a.) Result in BGL2XML GUI "Log" message area:

"Using ScruffyDuck Decompiler
Decompile Completed

[File was compiled with the UNKNOWN Compiler]\
"


3.) Click BGL2XML GUI "View" button (Message dialog with no title bar label appears)

a.) Message: "The system cannot find the file specified"



Product Name: Bgl2Xml_GUI.exe
Product Version 1.4.0.0
Date Modified: 3/21/2011 - 10:30 AM


1.) Decompilation input File: [FSX install path]\Scenery\Global\Scenery\Airport_Buildings_01_AP.bgl

2.) Click BGL2XML GUI "Go" button

a.) Result in BGL2XML GUI "Log" message area:

"Using ScruffyDuck Decompiler
Decompile Completed

[File was compiled with the UNKNOWN Compiler]\
"


3.) Click BGL2XML GUI "View" button (Message dialog with no title bar label appears)

a.) Message: "The system cannot find the file specified"



Product Name: Bgl2Xml_GUI.exe
Product Version 1.3.7
Date Modified: 1/22/2011 - 5:55 PM

1.) Decompilation input File: [FSX install path]\Scenery\Global\Scenery\Airport_Buildings_01_AP.bgl

NOTE: "Save Models" is 'checked' by default < ...is this a good idea ? :eek: >

2.) Click BGL2XML GUI "Go" button

a.) Result in BGL2XML GUI "Log" message area:

"Using ScruffyDuck Decompiler
Decompile Completed

[File was compiled with the UNKNOWN Compiler]\
"


3.) Click BGL2XML GUI "View" button

a.) NotePad with "Airport_Buildings_AP.bgl.xml" title bar label appears
b.) Contents of NotePad XML code 'appear' correct <...at a glance ;) >
c.) A "plethora" of (66) MDLs get dumped into the BGL2XML_GUI folder ! :banghead:
d.) WinPatrol alerts me immediately that several application executables (none related to ScruffyDuck Software) are no longer set to 'auto start'. :confused:

< Hmmm... anyone planning to do application hijacking next time Win-7 restarts to attempt 'background communications' over the internet ? > :scratchch


PS: I have posted the BGL2XML_GUI executables in question here as an attachment.

I did not test the CMD mode version of the executables in question < ...gotta' leave something for George to test ! > :p



As to sorting out the 'official' downloads for your tools, I hope all non-redundant versions of your tools for FS9 and FSX continue to be available for download somewhere, as they are very helpful to both troubleshooting and FS Development.


FYI: I was concerned that this scenario was a "test of concept" prior to extermination of BGL2XML as a stand alone, such that only an integrated decompiler used for an ADE proprietary BGL compiler would be available as a ProKey feature ...in the future.

Continued availability of a means to fully decompile our work into source code is IMHO essential to any FS Development... whether one's work is created as freeware, or if one's prior work is subsequently utilized as payware (to be distributed under the appropriate license terms, of course).

< But then, I was also concerned that we were being "prepar3d" for eventual conversion of Arno's utilities to payware when he moved them out of the FSDeveloper Forums and onto the scenerydesign.org web site ! :duck: >


Hope this helps ! :)

GaryGB
 

Attachments

Last edited:
#7
Hi George:

Indeed, it is not a default file, and is instead from a 3rd party who made some freeware scenery, and opted to require this BGL be installed into:

[FSX install path]\Scenery\Global\Scenery\


It is, however, able to be decompiled by a "fully functional BGLComp generated BGL decompiler" into XML source code, so it is not a SCASM generated BGL.


I have attached the file below; is there anything unusual about the file (...aside from its install location) which you can detect ? :confused:


Hope this helps ! :)

GaryGB
 

Attachments

Last edited:
#9
Hmm, it works fine here V1.04/5.09, see attached.
Thanks, George; now I'll go looking for those versions of BGL2XML to download and test as well. ;)

[EDITED]

I downloaded and tested BGL2XML version 1.5.1.0 from Scruffyduck Download Center and successfully decompiled "Airport_Buildings_01_AP.bgl".

Is there an undocumented command switch for BGL2XML version 1.5.1.0 that enables output with FSX-format GUIDs for "sourcefile" (such as in your attachment above), rather than MDL names for "sourcefile"(...which is what I get) ? :confused:

[END_EDIT]


GaryGB
 
Last edited:

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
#10
I am with George. I cannot replicate any issues.

Gary

The version George is using is the latest that I posted the download link for. I don't support older versions so it would help if we can work on issues related to that version. For the avoidance of doubt Help About produces this report:

Versions:
Application 01.05.1
Engine 05.09.0
Anything else is not worth testing.

The file you offered is a library Bgl file containing 66 models. If you don't want the mdl files then there is a checkbox in the dialog called Save Models. Uncheck this and no more mdl files will be generated. Old versions did not offer the choice of extracting mdl files.

The XML is quite simple so I replicate it here:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Created by Scenery Design Engine (SDE) on 11/12/2012 -->
<FSData
version="9.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="bglcomp.xsd">
<ModelData
sourceFile="fbo_small_02.mdl"
fileOffset="0"/>
<ModelData
sourceFile="tiny_hanger_04.mdl"
fileOffset="0"/>
<ModelData
sourceFile="row_hangers_04.mdl"
fileOffset="0"/>
<ModelData
sourceFile="low_jetway_02.mdl"
fileOffset="0"/>
<ModelData
sourceFile="large_hanger_03.mdl"
fileOffset="0"/>
<ModelData
sourceFile="large_hanger_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="medium_hanger_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="hanger_fbo_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="large_hanger_02.mdl"
fileOffset="0"/>
<ModelData
sourceFile="Parking_03.mdl"
fileOffset="0"/>
<ModelData
sourceFile="Office_rectangular_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="fbo_small_03.mdl"
fileOffset="0"/>
<ModelData
sourceFile="double_row_hangers_02.mdl"
fileOffset="0"/>
<ModelData
sourceFile="double_row_hangers_03.mdl"
fileOffset="0"/>
<ModelData
sourceFile="row_hanger_end_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="small_hanger_03.mdl"
fileOffset="0"/>
<ModelData
sourceFile="tiny_hanger_03.mdl"
fileOffset="0"/>
<ModelData
sourceFile="Parking_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="low_jetway_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="large_double_hanger_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="residence_02_lh.mdl"
fileOffset="0"/>
<ModelData
sourceFile="residence_01_rh.mdl"
fileOffset="0"/>
<ModelData
sourceFile="row_hangers_03.mdl"
fileOffset="0"/>
<ModelData
sourceFile="residence_01_lh.mdl"
fileOffset="0"/>
<ModelData
sourceFile="double_row_hangers_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="tiny_hanger_02.mdl"
fileOffset="0"/>
<ModelData
sourceFile="residence_02_rh.mdl"
fileOffset="0"/>
<ModelData
sourceFile="Office_round_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="tiny_hanger_05.mdl"
fileOffset="0"/>
<ModelData
sourceFile="t_hangers_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="row_hanger_02.mdl"
fileOffset="0"/>
<ModelData
sourceFile="fbo_small_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="double_row_hanger_end_02.mdl"
fileOffset="0"/>
<ModelData
sourceFile="medium_hanger_02.mdl"
fileOffset="0"/>
<ModelData
sourceFile="walkway_cover_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="Parking_02.mdl"
fileOffset="0"/>
<ModelData
sourceFile="double_row_hangers_end_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="medium_hanger_03.mdl"
fileOffset="0"/>
<ModelData
sourceFile="tiny_hanger_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="short_cover.mdl"
fileOffset="0"/>
<ModelData
sourceFile="row_hanger_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="medium_hanger_04.mdl"
fileOffset="0"/>
<ModelData
sourceFile="small_hanger_01.mdl"
fileOffset="0"/>
<ModelData
sourceFile="fbo_small_04.mdl"
fileOffset="0"/>
<ModelData
sourceFile="large_hanger_04.mdl"
fileOffset="0"/>
<ModelData
sourceFile="small_hanger_02.mdl"
fileOffset="0"/>
<ModelData
sourceFile="long_cover.mdl"
fileOffset="0"/>
</FSData>
The log after decompling here is:

Using ScruffyDuck Decompiler
Decompile Completed

[File was compiled with the FSX Compiler]
To deal with some points in no particular order

NOTE: "Save Models" is 'checked' by default < ...is this a good idea ? >

Since the program remembers your setting you only need to uncheck it once and it will remember from then on. In truth all other decompilers extract models by default. As I recall Winfreds BglAnalyze series does not offer any way to turn this off.

FYI: I was concerned that this scenario was a "test of concept" prior to extermination of BGL2XML as a stand alone, such that only an integrated decompiler used for an ADE proprietary BGL compiler would be available as a ProKey feature ...in the future.
Bgl2Xml is not a decompiler it is a front end to the same decompiler used in ADE. The decompiler itself is in a library. The same decompiler is used in my other tools including SDE Test App. So in practice any failure to decompile is in the library and not in the front end. The decompiler is mine written from scratch and is not going to 'go away' It will remain as part of the stand alone tools such as Bgl2Xml.

Forgive me if I am not sure but it seems that your test with the currently supported version worked as expected (other than spitting out unwanted mdl files :eek:
 
#11
Many Thanks for your generous intention to continue making BGL2XML available as a "stand-alone" tool, and with a very helpful feature option for MDL extraction, as well as the ability to toggle that On/Off. :cool:

Being able to remove the 66 MDL files was a good problem, and one that I can avoid in the future thanks to your 'enhanced functionality' in the "front end" ;)

< Uhm, well... OK, I guess we won't go there ! :rotfl: >



I had previously been in the habit of deriving info on file version from the Windows Explorer Properties > Details tab; I shall be certain to cite the Version info listed in ScruffyDuck's Menu > Help > About from now on, should the need ever arise. :eek:


One final un-answered question which just... won't... go away... if I may:

Is there an undocumented command switch for:

BGL2XML Versions:
Application 01.05.1
Engine 05.09.0


...that enables output with FSX-format GUIDs for "sourcefile" (such as in your attachment above), rather than MDL names for "sourcefile"(...which is what I get) ? :confused:
Thanks again, Jon ! :)

GaryGB
 
Last edited:

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
#12
...that enables output with FSX-format GUIDs for "sourcefile" (such as in your attachment above), rather than MDL names for "sourcefile"(...which is what I get) ?
Probably because FSX mdl files are different than FS9 ones. Source file is source file so to recompile you need the name of the file. So you would like the mdl files named with the GUID rather than the name and the XML to reflect that?


PS
I moved this discussion from the FSX Planner Forum to a more appropriate place
 
Last edited:
#14
I moved this discussion from the FSX Planner Forum to a more appropriate place
Hi Jon:

Thanks for relocating this somewhat topically unrelated content out of poor Emilio's original thread at:

http://www.fsdeveloper.com/forum/showthread.php?goto=newpost&t=398178

Is there an undocumented command switch for:

BGL2XML Versions:
Application 01.05.1
Engine 05.09.0


...that enables output with FSX-format GUIDs for "sourcefile" (such as in your attachment above), rather than MDL names for "sourcefile"(...which is what I get) ? :confused:

Probably because FSX mdl files are different than FS9 ones. Source file is source file so to recompile you need the name of the file. So you would like the mdl files named with the GUID rather than the name and the XML to reflect that?
Subject to the vagaries of content relocation and/or editorial discretion, the example XML code which previously showed FSX-format GUIDs for "sourcefile" rather than MDL names for "sourcefile" in the original thread, I no longer have the original illustration to refer to. :rolleyes:

It is no longer clear at this point whether that illustration cited above was generated by BGL2XML via an undocumented command switch or other feature option, or if that was instead a reformatted *.XML file generated by one of George's tools (such as a GUID 'search' tool). :confused:

But that's OK, as we wouldn't want other readers here to become confused as the necessary format required to submit XML source code to BGLComp in order to derive a successful BGL compilation result. ;)


What I thought might be even more helpful to the FS Development and troubleshooting process, would be a feature option in BGL2XML which outputs not only the MDL name, but also the GUID as an adjacent "XML Comment" in context to the MDL info, for example: :idea:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Created by Scenery Design Engine (SDE) on 11/12/2012 -->
<FSData
version="9.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="bglcomp.xsd">
<ModelData
sourceFile="fbo_small_02.mdl"
[B][COLOR="Navy"]<!-- GUID={43663b0b-92ae-4415-b41b-abd33a9ce862} -->[/COLOR][/B]
fileOffset="0"/>
</FSData>

I hope this better communicates what I thought might merit consideration for "further extension of your front end" ...in the form of BGL2XML's feature set. :D


Thanks again for making BGL2XML and your various other tools available to the FS Community now and in the future. :)

GaryGB
 
Last edited:
#16
I think what Gary was requesting is the "name=" line in the xml a la NewBglAnalyze:

Code:
<?xml version="1.0"?>

<!--  disassembled by NewBglAnalyze Wed Dec 19 17:03:18 2012 -->

<FSData version="9.0"
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation="bglcomp.xsd">

<ModelData
  [B]name="bf1cc7084e6625aed245ddaba3fb5cb4"[/B]
  sourceFile="CrossLib_00.mdl"
  fileOffset="0"/>
</FSData>
Bgl2Xml:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Created by Scenery Design Engine (SDE) on 19/12/2012 -->
<FSData
   version="9.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="bglcomp.xsd">
   <ModelData
      sourceFile="Cross.mdl"
      fileOffset="0"/>
</FSData>
It would be very useful for me also.
 
Last edited:
#17
Hello:

Would use of the "name="[GUID STRING]" format in the XML decompilation work properly with FS9 MDLs from a FS9 library as well ? :confused:


If the FS9 platform required different XML for BGLComp because the FS9 GUID is in fact not stored inside the MDL, I'm wondering if the "XML Comment" suggested above might be a non-problematic way to document for the end user what GUID was used for it within the FS9 format library BGL from which the FS9 MDL was decompiled ?

My thought was that the BGL2XML decompilation would not only document GUIDs used in the original library, but also be immediately re-compilable via the matching version of BGLComp if desired. :idea:


FYI: Thus far today, I've only had an opportunity to read up on the subject via this thread:

http://www.fsdeveloper.com/forum/showthread.php?t=4133


Thanks for any further clarification on this. :)

GaryGB
 
Last edited:

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
#18
GUIDs are embedded in FSX models. They are not embedded in FS9 models. FS9 objects get their GUIDS when they are compiled into Bgl files. They need to be explicitly defined for FS9.

XML Code
FS9:

<ModelData
name=”4a5ceec84f2a9e27f12ee7a40f0c856c”
sourceFile=”MyModel.MDL”
fileOffset=”0”/>

FSX:

<ModelData
sourceFile="testx.MDL"
fileOffset=”0”/>

In FSX the GUID (name) is embedded in the actual mdl file itself


Names

When we decompile a FS9 model we have no name as such so we would use a GUID to represent that name or we can generate some name based on the enclosing file name and an indexer. With FSX we get both from the model file.

So for FSX we do not specify a name or a GUID in the XML.

I don't know if this helps at all. So to go back to the original point. Is the request for FS9 or FSX Gary and what do you want to see?
 
#19
Hi Jon:

Would I be correct that BGL2XML is intended to be capable of de-compiling both FS9 and FSX libraries, and upon successful de-compilation each type, it will then display a message as to which version of ex: BGLComp was used to compile the library ? :confused:

If so, when BGL2XML de-compiles a FS9 scenery object library, I would welcome seeing it output info as to the "current" GUID used to reference or "name" a MDL inside the library BGL when that library was compiled ...as shown in your XML Code example for FS9 immediately above:

http://www.fsdeveloper.com/forum/showpost.php?p=607008&postcount=18


It appears that a "name="[GUID STRING]" parameter is not used during compilation of FSX MDLs into a scenery object library by ex: FSX SDK BGLComp.

Thus, when the current version of BGL2XML de-compiles a FSX scenery object library, it would not output info from such an explicit parameter as "name="[GUID STRING]", (since that is not used during compilation of FSX MDLs into a scenery object library by ex: FSX SDK BGLComp).


But I was wondering if it would be possible to program a future version of BGL2XML to 'artificially' insert such GUID info into its output XML code from the de-compilation of FSX scenery object libraries ...for reference and troubleshooting purposes ?

That way, we might end up with the GUID as an adjacent "XML Comment" in context to the MDL info, for example: :idea:

Code:
XML Code
FS9:

<ModelData
name=”4a5ceec84f2a9e27f12ee7a40f0c856c”
sourceFile=”MyModel.MDL”
fileOffset=”0”/>

FSX:

<ModelData
<!-- GUID={4a5ceec8-9e27-4f2a-a4e7-2ef16c850c0f} -->
sourceFile="MyModel.MDL"
fileOffset=”0”/>
Hope this better explains what I was trying to suggest. :eek:



Alternatively, if the use of a "name=[GUID]" parameter is tolerated by FSX SDK BGLComp when compiling XML code to create a scenery object library of FSX MDLs, perhaps we could simply have BGL2XML output in the way that NewBGLAnalyze does using a "name=[GUID]" parameter in the XML code output ...as George shows in his example above:

http://www.fsdeveloper.com/forum/showpost.php?p=606086&postcount=16


PS: My only concern would be that if BGL2XML were to output in the way that NewBGLAnalyze does using a "name=[GUID]" parameter in the XML code output, one might be at risk for overlooking the fact that FS9 SDK BGLComp would still require the GUID to be converted into FS9 32-character 'continuous string' format in order for the XML source code to ex: be used for FS9 scenery object library creation.

That is why it thought it might be 'safer' to insert a "XML Comment" containing the GUID info, rather than inserting an explicit 'live' "name=[GUID]" parameter (assuming FSX SDK BGLComp would tolerate that parameter when one opted to ex: re-compile the BGL2XML XML code into a FSX scenery object library after an edit).


Thanks again for considering these as options for a future version of BGL2XML. :)

GaryGB
 
Last edited:

scruffyduck

Administrator
Staff member
FSDevConf team
Resource contributor
#20
i Gary

I will probably not get around to looking at another version of Bgl2Xml for a while (I am just replacing my old airports scanner and duplicate finder) but I will certainly look at it. Bgl2Xml was written for FSX so it may not do a good job with FS9.
 
Top