Jump to content
Sign in to follow this  
GHD

Default flatten area

Recommended Posts

Guest Shaun Manners

Hi allI have created my own terrain for my airport scenery project, the trouble is there seems to be a flatten area in the default scenery and it makes a massive flat section right where I don't want it. I have tried exclusion areas, but it has me stumped.Anybody got any ideas?cheersShaun

Share this post


Link to post
Share on other sites

Hi Shaun,bad news: the default flatten switches for airports reside in separate files (FLT*.bgl in FS02, FL9*.bgl in FS04) and cannot be excluded (http://forums.avsim.net/dcboard.php?az=show_topic&forum=123&topic_id=13778&mesg_id=13778&listing_type=search).Here's a TMFViewer screenshot of the Calgary area, showing in brown the default airport flattens (arranged in a LOD13 grid) as well as rivers and lakes.http://forums.avsim.net/user_files/47875.jpgGood news (sort of): you can decompile the FS2002 FLT*.bgl file (the codes have changed in FS04 and we can't read those yet but the flatten switch extents appear to be identical to the FS2002 version), extract your airport's LWM polygons from the .asm file, remove it, and recompile the file without the flatten. You can then use this .bgl instead of the default FLT*.bgl.Two problems with this approach: If you want to distribute your scenery, the users will have to replace their default FLT*.bgl file with your version; if other scenery designers do the same with other airports in the same region we soon would have several (incompatible) versions of the FLT*.bgl in orbit.Second, the spatial extents of the flatten files have changed between FS2002 and FS2004: in FS2004, all default files are now in the LOD5 grid system. To make the above-mentioned procedure work, you'd have to create two separate versions of the replacement file for the two FS versions. Cheers, HolgerP.S.: first thing to check, of course, is whether the flatten switch you see is actually the default switch. There are a number of add-ons for both FS2002 and FS2004 that may have added large flatten switches to some airfields.

Share this post


Link to post
Share on other sites
Guest Shaun Manners

Hi HolgerThanks for your reply and the link to the other forum.I have never decompiled a bgl before, so that should be fun ;) it appears its my only choice though, even with the down sides.its a shame you can't just exclude a flatten area, oh well!oh and yeah it is definately the default (I haven't installed any addon scenery in this area) and I have found the scenery area that contains the airport and flatten area.right, I'm off to have a go at getting rid of it!cheersShaun

Share this post


Link to post
Share on other sites
Guest Shaun Manners

Hi againsorry to ask more questions, but how do you decompile the FLT*.bgl etc? I have searched around and tried several things, but can't figure it out. I'm afraid I'm rather a novice at this and especially when it comes to source code!any directions on this would be great.thanksShaun

Share this post


Link to post
Share on other sites
Guest sgreenwood

Hi Shaun,You can use BGLAnalyze to decompile bgl files. Search the library for bglana31.zip.Steve

Share this post


Link to post
Share on other sites
Guest Shaun Manners

Hi Stevethanks! found it and it works a treat... just now gotta figure out which bit is the dreaded flatten polygon ;)oh btw, does anyone know what the copyright situation is if I wanted to distribute my scenery?thanks again and sorry if this is a bit off topic for this forum.cheersShaun

Share this post


Link to post
Share on other sites

Hi Shaun:you're a brave man diving into the LWM .asm files on your own ;-) The easiest approach will be to determine the exact elevation of the airport (in meters!) and search for that number in the .asm file. Alternatively (and safer), you'll need to find the LOD8 Cell and all the LOD13 Areas occupied by the airport (Dick's utilities, such as TMFViewerCalc and TDFCalc will help you with this, not to mention his LWM tutorial). The LWM .asm files are sorted by LOD8 Cell and, within each cell's section, by the FS-native nested quadtree structure.Here's an image by graphics wizard Gilles Gauthier, which will be included in our tutorial. It refers to hyp*.bgl files but is applicable to any LWM flatten: http://forums.avsim.net/user_files/48025.jpgThe MS quadtree structure consist of a nested design of squares divided into four "children", always numbered as "0" (upper left), "1" (upper right), "2" (lower left), and "3" (lower right). The column on the right indicates the way the 32 x 32 LOD13 Areas are sorted within each Cell's section of the HYP*.bgl file. Note that only Areas that contain part of a lake/airport flatten are included in the .bgl file.The elevations are stored in the two last parameters of the "LWMPoly2" line. The second to last value represents whole meters and the last one fractional meters (in 1/128 meters). In the following code example the elevation is 609.0 meters:LWMDataAreaDrawPolygons 1, 3, 1, 27, 21LWMPoly2 6, 0, 0, 609, 0 LWMPoint 105, 235 LWMPoint 130, 205 LWMPoint 140, 206 LWMPoint 190, 236 LWMPoint 214, 255 LWMPoint 92, 255Also, if an entire LOD13 area is included in a flatten switch, the code gets simplified to:LWMDataAreaFill1x1 0, 0, 1, 9, 20LWMDataAreaHeight 609, 0In this case, the elevation is coded in the two values following LWMDataAreaHeight.Whether you change the elevation or remove the areas be careful not to affect flatten switches of other aiports that might have exactly the same elevation; it's uncommon (even with lakes) but does occur.As for the copyright issue: technically you're altering an MS file, which is part of a copyrighted piece of software. However, any add-on FS designer is utterly dependent on using parts of the default files and it appears that MS doesn't have any problems with that. Maybe others know whether there's any official statement by MS to this effect?Cheers, Holger

Share this post


Link to post
Share on other sites
Guest Shaun Manners

Hi Holgerlol either brave or stupid... one or the other ;)thanks eversomuch for all the information, its taken me quite a number of hours to get my head round, but it all makes sense now... well nearly all anyway! the picture was a great help and so was the example. it makes the whole thing so much clearer.I had previously worked out what cell it was in and made a guess based on elevation but like you said, you can never be sure if you've removed something else along with it.Did you say you are doing a tutorial? I wouldn't mind having a look at that when you've done it, I'm sure people will find it very useful, the SDK is great... so long as you know what you're doing!as for the copyright issue, well I can't see them having a problem with it, but if anyone knows otherwise then please let me know!I'm not sure when I'll get my scenery done, but this is one big hurdle overcome... so maybe when I've finished I'll post a picture on the scenery design forum!thanks againcheersShaun

Share this post


Link to post
Share on other sites

Hi Shaun:you're very welcome!The tutorial will be posted here at avsim, hopefully sometime next week.Looking forward to your scenery - and do post screenshots please!Cheers, Holger

Share this post


Link to post
Share on other sites
Guest Shaun Manners

Hi HolgerI have completed my scenery, and have posted some screenshots to the scenery design forum! (Thread: Bristol Internationa 2003)thanks for all your help, much appreciated.CheersShaun

Share this post


Link to post
Share on other sites

>Hi Shaun:>>The tutorial will be posted here at avsim, hopefully sometime>next week.>>Cheers, HolgerHi Holger,I saw your HYP*.BGL quadtree graphic a couple of weeks ago and couldn't find it again until today. Thanks for that.By the way, what has happened to your tutorial?George

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