Jump to content
Sign in to follow this  
1st fltsimguy

Converting FS9 Scenery into FSX - Decompile and Fix?

Recommended Posts

I have recently been working to build some new freeware scenery's for distribution and am learning & relearning (over 50 years old disease) to use some tools and such to accomplish the task.This question related to: Kahului Apt, MauiRather then rebuild from scratch, I downloaded and installed in FSX the following scenery.Kahului International Airport, Maui, Hawaii PHOG "kahu2", from AVSIM. This scenery is by Bill Melichar and by and largely is compatible with FSX.The exception is that Bill placed a good number (hundred or so), palm trees and vegetation around the airport. These show up with the texture file showing the tree and are not transparent and therefore show up as a black square with picture on the texture square.I tried to decompile the bgl file and with the thought of removing the offending trees and then I would put new ones in their place. I tried using bglxml and bgl2xml to do the decompile and I got errors. Does anyone know how to decompile this file to facilitate removing and adding objects?I am not an expert on texture file formats but another solution might be to recompile the tree texture files to a compatible format. Does anyone know how to do that or provide me with the approach to do that. I would be happy to undertake this but could use help on what tool to use?Here is a screenshot


Bryan Wallis aka "fltsimguy"

Maple Bay, British Columbia

Near CAM3

Share this post


Link to post
Share on other sites

Hello Bryan:Bill Melichar's "Kahu.BGL" contains all the object placement code, and is a legacy FS2000 (FS7) or FS2002 (FS8) "SCASM" type BGL with "rotate to aircraft" type trees.This type of BGL can be disassembled using an older version of BGLAnalyze (version 3.1) to view and work with the output code in NotePad or another Text editor for use on your own system:http://library.avsim.net/esearch.php?CatID...&DLID=27375For info on how others fix legacy "SCASM" objects see ModelConverterX:http://www.fsdeveloper.com/forum/forumdisplay.php?f=87For info on how another person fixed the legacy "SCASM" trees around his airport of interest, see:http://www.fsdeveloper.com/forum/showthrea...ighlight=JerseyOne could delete the old trees from a COPY of the decompiled original "Kahu.BGL" objects output file, and recompile with SCASM to continue using all the other objects in the file.However, one would want to be sure the other remaining SCASM code does not gradually kill frame-rates at the airport (which 'some' SCASM BGLs may do in FSX SP2).One could then separately replace the trees with "newer" ones from the FSX default library objects, or with other 3rd party FS9 or FSX library objects that do not have the FSX SP2 "dark background/broken transparency" issue with their MDL and texture files.But, I'd also consider trying to interpret the tree placement code, and salvage the tree placement coordinates from the decompiled SCASM "Kahu.SCA" output file so the replacement could be done via XML using GUIDs for the trees of your choice at the original coordinates. One would then end up with a reconstituted "Kahu.BGL", and another BGL for object "placement" of the newer FSX default or other 3rd party trees.FYI: There appears to be at least 199 objects (and possibly 470+ objects) in the decompiled SCASM "Kahu.SCA" output file code; look in the decompiled code for "Object # xxx" entries referencing the following textures for trees I saw in the texture folder:"Container.bmp""Container_lm.bmp""palm651.bmp""tree109.bmp""treebananemix.bmp""treebananemix2.bmp"NOTE: There may be possible transparency issues with trees/plants using these textures too:"bld110.bmp""bldplants16.bmp""bldplants23.bmp""bldplants37.bmp""bldplants38.bmp""bldplants39.bmp""bldplants45.bmp" Hope all this info helps provide an overview to get you started... happy tinkering ! :( GaryGB

Share this post


Link to post
Share on other sites

Gary this is just what I needed for my "tinkering". Greatly appreciated.And, hopefully shortly I will be able to provide folks with and updated upload of this and other updated scenery's for airports that are begging for attention.


Bryan Wallis aka "fltsimguy"

Maple Bay, British Columbia

Near CAM3

Share this post


Link to post
Share on other sites
Hi Bryan:Glad to be of help to one who's made so many great contributions to the FS Community; so I must also say: Thank You ! :( http://library.avsim.net/search.php?CatID=...;Go=Change+ViewGaryGB
I am trying to get back into scenery design work. Had a 2-3 year period where family matters took the priority. And now I have a high end gaming computer capable of running FSX at maximums so the fun has returned.I have just completed a new Port Hardy (compatable with FTX-PNW by Orbx) scenery for FSX and will upload soon. And with retirement just around the corner, between golf and flightsim and a small home business producing and converting movies into DVD's that will keep me partly occupied."Chicagoland" Go Hawks Go!

Bryan Wallis aka "fltsimguy"

Maple Bay, British Columbia

Near CAM3

Share this post


Link to post
Share on other sites

Hi Bryan:I'll look forward to seeing your new projects sometime. :( PS: In "Chicagoland" there's a joke about the like-able but sometimes 'rogue' Blackhawks Hockey Team; it's told like this:"I went to a fight the other night at the Stadium, and to my complete surprise... a 'Hawks game broke out !" :( GaryGB

Share this post


Link to post
Share on other sites
FYI: There appears to be at least 199 objects (and possibly 470+ objects) in the decompiled SCASM "Kahu.SCA" output file code; look in the decompiled code for "Object # xxx" entries referencing the following textures for trees I saw in the texture folder:"Container.bmp""Container_lm.bmp"
Hello Bryan:Oops... The correct file names for these should be:cocotier1.bmpcocotier2.bmpBut you may have already found this out by viewing the BMP texture files in a graphics program or file viewer ! :( BTW: ImageTool from the SDK is the "gold standard", but XnView is handy too as a DXT/DDS-capable thumbnail gallery viewer:http://www.xnview.com/en/xnview.htmlHope this helps a bit more ! :(GaryGB

Share this post


Link to post
Share on other sites
Hello Bryan:Oops... The correct file names for these should be:cocotier1.bmpcocotier2.bmpBut you may have already found this out by viewing the BMP texture files in a graphics program or file viewer ! :( BTW: ImageTool from the SDK is the "gold standard", but XnView is handy too as a DXT/DDS-capable thumbnail gallery viewer:http://www.xnview.com/en/xnview.htmlHope this helps a bit more ! :(GaryGB
Yes Gary I did find these and removed the objects. And I have the viewer as well thanks.I tried playing around with the code last night to see if I could remove the massive exclude autogen issue with no luck yet, unfortunately had to get to bed as I am still gainfully employed and have to bring in a pay cheque.

Bryan Wallis aka "fltsimguy"

Maple Bay, British Columbia

Near CAM3

Share this post


Link to post
Share on other sites

Hi Bryan:Have you looked at whether the "massive exclude autogen"areas are covered by the exclude BGLs (separate from what is in the Object code Kahu.BGL") ? "KAHU_EX1.bgl""KAHU_EX2.bgl""KAHU_EX3.bgl""KAHU_EX4.bgl""KAHU_EX5.bgl"If these are decompiled via BGLAnalyze version 3.1, you'll see the coordinates the excludes cover.EX: KAHU_EX1.sca shows:

; ----------------------------------------; KAHU_EX1.bgl disassembled by BGLAnalyze (c) on Mon Jun 07 15:28:13 2010; ----------------------------------------Header( 1  N20:53:50.62 N20:53:35.88 W156:26:04.52 W156:26:14.59 )LatRange(  N20:53:35.88  N20:53:50.62 ); since SCASM does not support multiple latitude ranges; the range has been set to the minimum/maximum latitude.; LatRange information in the BGL file is given as comment.; If you want to use band separation, you must edit; the source file manually.; Insert the "Set( FSVers 0x800 )" instruction at the beginning; of the file, if you want to use the FS2002 instructions; for the facilities sectionmif( [$Version < 285] )   Error( You need at least SCASM version 2.85 to compile this code )mifend; ----------------------------------------; Exclude section; ----------------------------------------GenExcl( Gen_exc0.bgl F	 N20:53:50.62 N20:53:35.88 W156:26:04.52 W156:26:14.59	 N20:53:50.62 N20:53:35.88 W156:26:04.52 W156:26:14.59 ); ----------------------------------------; end of SCASM source

Regarding "GenExcl( Gen_exc0.bgl F" ...IIUC, the "F" means: "to exclude all foreign scenery simply enter F for the mask"NOTE: I'd suppose that means autogen too ? :( See: http://www.scasm.de/doc/sca_s16.htm#gexclI've also seen this clobbering of autogen when an old legacy thermal "cube" overlapped the ground at an unusually low placement altitude when the BGL was displayed over new terrain mesh files in a newer version of FS.The new higher resolution mesh and FSX display engine raised ground elevation higher than it was in older versions of FS with "blunted ground details" due to their lower resolution terrain mesh, allowing the thermal cube to encroach the terrain; the thermal object subsequently excluded autogen (but base ground land class textures remained). :( To check this possibility out, in FSX.Cfg under the [sCENERY] sub-section enter:[sCENERY]ShowTriggers=1Re-start FSX and see if any thermals show up (probably some will... somewhere, at least; but maybe not in the suspect areas).BTW: This FS Cfg file parameter (works in FS8/9 too) allows fuel triggers to show also; I don't recall if these affect autogen too (probably do).NOTE: To disable this display option, put a double-slash ( "//") in front of that line, and re-start FSX... they'll be gone (invisible, actually !)Regarding some typical V1 and V2 values for objects (varies with object size), I have seen values for V1 at 5000 - 10000 and V2 between 35 - 200.Only rarely do I see a large number for V2, and those may have been for either Effects, or special objects that are intended to be seen with greater visual clarity at a greater distance (I'm not sure if SCASM has LODs to do this, so I'm guessing here). :(Example ratios I see: V2 most often ranging from 10 to 30 % smaller than a larger V1; rarely have I seen V2 as much even 10 to 15 % larger than a smaller V1 ! B) I'll be interested to know if disabling the exclude BGLs by renaming to a "BAK" file extension solves the autogen issue; I'd try that before adjusting V1 / V2Hope this helps further sort out the mystery ! B) GaryGB

Share this post


Link to post
Share on other sites

Hi,Before starting to tweak v1 and v2 values (especially the v2) it is good to realize what they mean.The v1 distance is the distance at which the object becomes visible. So this is a value that you can tweak to get better performance. Usually the value you want or need depends on the size and importance of the object.The v2 value on the other hand is fixed. There is only one optimal value for it. So in general I would not advice you to change it. The v2 value is the radius of the object. It's the radius of a circle from the reference point that the entire object fits in. If you make the v2 value to small your object can disappear from certain angles. If you make it too big it means your object is drawn when it should be out of view already and it will hurt performance.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Hi,Before starting to tweak v1 and v2 values (especially the v2) it is good to realize what they mean.The v1 distance is the distance at which the object becomes visible. So this is a value that you can tweak to get better performance. Usually the value you want or need depends on the size and importance of the object.The v2 value on the other hand is fixed. There is only one optimal value for it. So in general I would not advice you to change it. The v2 value is the radius of the object. It's the radius of a circle from the reference point that the entire object fits in. If you make the v2 value to small your object can disappear from certain angles. If you make it too big it means your object is drawn when it should be out of view already and it will hurt performance.
your advice is sound and helpful. I tried messing around with the V2 value and totally made a shambles of what I was trying to do. Thank goodness I have the original file to restore where I was at in this work.I have had to put it aside for a bit as I have some other personal business to sort out, but hopefully I get a rainy day and "force" me to stay at my computer instead of other yardwork or the "honey do" list.

Bryan Wallis aka "fltsimguy"

Maple Bay, British Columbia

Near CAM3

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