FLATTEN THAT FLATTEN

An effort to collaborate all freeware New Zealand scenery addons. Discuss the creation and management of the project here.

Postby Charl » Fri Mar 07, 2008 1:11 pm

In FS9 we've suffered with flatten and exclude entries in the scenery.cfg file for a long time.

There HAS TO be a utility which can turn these into .bgl files for inclusion in the scenery folder of each airport!
It is just so much tidier, and easier to maintain sceneries like this.
Do we have an expert on board who can do this?
User avatar
Charl
NZFF Pro
 
Topic author
Joined: Mon May 01, 2006 8:28 am
Posts: 9690
Location: Auckland

Postby HardCorePawn » Fri Mar 07, 2008 10:49 pm

Well the FS9 SDK works with XML file...

so it would probably be quite easy to write a PERL script that would take the scenery.cfg, read out the flatten lines, and then wrap the data with the appropriate XML... outputting to separate XML files if required (so you would have individual BGLs for each flatten)... actually you could probably just get PERL to then run the XML files through bglcomp.exe as well...

It would probably be around 1 or 2 hours work at most... assuming I can remember enough of my PERL programming, as i have not done any for about 3 years!

Unfortunately, having a quick read through the FS2004BGLCompSDK.doc, there is no XML tags for flattens...

Doing some more reading, you would need to go the FSTFlatten route of using SCASM code to compile the flatten description to a BGL... it would look something like:

Code: Select all
; SCASM file created by Check Six! Designs
; based on the FSTflatten process
; Copyright(www.fs-traveler.com)

Header ( 1 41.6805089021836 41.6392767134892 -116.698565245183 -116.755682843556 )
LatRange ( 41.6392767134892 41.6805089021836 )
Set ( areamx 64 )
Area16N
 Elevation ( 5400
   41.6392767134892        -116.746869394651    ;1
   41.6649747297488        -116.707606153632    ;2
   41.6736016717552        -116.70260730431    ;3
   41.6736016717552        -116.70260730431    ;4
   41.6793110406424        -116.698565245183    ;5
   41.6805089021836        -116.755682843556    ;6
   41.6399596547808        -116.754696480309    ;7
 )
END16


not quite as nice as XML, but it should be pretty doable assuming the flattens in the scenery.cfg is a simple 4 corners kind of config (for example: (top left, top right, bottom right, bottom left)... otherwise defining the points in a counter-clockwise order could get a little tricky... as apparently if they're not defined counter-clockwise, SCASM may choke...

Apparently Excludes can be done with XML....

more info can be found here:
Flatten Zone Tutorial
Exclude Zone Tutorial
Last edited by HardCorePawn on Fri Mar 07, 2008 10:53 pm, edited 1 time in total.
"Son, we are about the break the surly bonds of gravity, and punch the face of God." -- Homer Simpson

Image
User avatar
HardCorePawn
Senior Member
 
Joined: Fri Sep 01, 2006 4:18 pm
Posts: 1277
Location: 2500' above Godzone

Postby Charl » Sat Mar 08, 2008 10:46 am

That's easy enough to follow, thanks!
Certainly for a new scenery that shouldn't take too long.
Now then: Lawrie has a whole bunch of flattens and exclude lines scattered through his sceneries, reflected in the scenery.cfg file.
Would it be possible to generate bgl's from those, for inclusion in the scenery subfolder?
E.g. NZNP
Flatten.0=71,S39 0.60,E174 9.96,S38 59.88,E174 10.99,S39 1.08,E174 12.17,S39 1.06,E174 10.04
Exclude=S39 0.49,E174 10.60,S39 0.81,E174 10.98,objects
User avatar
Charl
NZFF Pro
 
Topic author
Joined: Mon May 01, 2006 8:28 am
Posts: 9690
Location: Auckland

Postby greaneyr » Sat Mar 08, 2008 3:32 pm

A polygon made with something like SBuilder can be designated a VTP polygon (for ground textures), an exclude polygon (where you can specify which layers to exclude), or an LWM polygon (which can then be further designated a land mask, water mask, or flatten). All are built using SCASM and compiled as BGL files which play nicely alongside existing scenery layers. This concept alone has the potential to improve on common methods of making excludes, flattens and land class. The only downside to using it for land class is that it doesn't weave the boundaries between textures and you get a definite seam.

Is this what you're talking about?
User avatar
greaneyr
Forum Addict
 
Joined: Fri Nov 16, 2007 9:53 pm
Posts: 459
Location: Palmerston North

Postby Charl » Sun Mar 09, 2008 2:31 pm

greaneyr wrote:
QUOTE (greaneyr @ Mar 8 2008, 04:32 PM) <{POST_SNAPBACK}>
A polygon made with something like SBuilder can be designated a VTP polygon (for ground textures), an exclude polygon (where you can specify which layers to exclude), or an LWM polygon (which can then be further designated a land mask, water mask, or flatten). All are built using SCASM and compiled as BGL files which play nicely alongside existing scenery layers. This concept alone has the potential to improve on common methods of making excludes, flattens and land class. The only downside to using it for land class is that it doesn't weave the boundaries between textures and you get a definite seam.
Is this what you're talking about?

Not really...I want to feed this line:
Flatten.0=71,S39 0.60,E174 9.96,S38 59.88,E174 10.99,S39 1.08,E174 12.17,S39 1.06,E174 10.04
or this line:
Exclude=S39 0.49,E174 10.60,S39 0.81,E174 10.98,objects
into a quick 'n dirty "Black Box" routine, which spits out a .bgl file, for inclusion in the scenery folder,
so I don't have to insert the flatten and excludes into the scenery.cfg file.
User avatar
Charl
NZFF Pro
 
Topic author
Joined: Mon May 01, 2006 8:28 am
Posts: 9690
Location: Auckland

Postby HardCorePawn » Mon Mar 10, 2008 9:42 am

All you are really doing, is taking the flattens/excludes from scenery.cfg (of which I believe you can only have a maximum of around 10)... and putting those co-ords into a SCASM formatted file (or XML in the case of an exclude), and then compiling it to a bgl...

Can anyone point me to the format spec for the Flatten and Exclude lines... I cannot seem to find them anywhere (it is monday morning after all)... I assume its something like:

Flatten.0=<Elevation in Feet>,<Top Left Lat>,<Top Left Long>,<Top Right Lat>,<Top Right Long>,<Bottom Right Lat>,<Bottom Right Long>,<Bottom Left Lat>,<Bottom left Long>

or is it just point1, point2, point3, point4, point 5, ..., point x? can there be more than 4 points?

For the exclude, I assume it is:

Exclude=<Top Left Lat>,<Top Left Long>,<Bottom Right Lat>,<Bottom Right Long>,<what to exclude>


I based my assumptions on sticking Charl's examples for NZNP into Google Earth and seeing where the points ended up :)
"Son, we are about the break the surly bonds of gravity, and punch the face of God." -- Homer Simpson

Image
User avatar
HardCorePawn
Senior Member
 
Joined: Fri Sep 01, 2006 4:18 pm
Posts: 1277
Location: 2500' above Godzone

Postby greaneyr » Mon Mar 10, 2008 9:47 am

User avatar
greaneyr
Forum Addict
 
Joined: Fri Nov 16, 2007 9:53 pm
Posts: 459
Location: Palmerston North

Postby HardCorePawn » Mon Mar 10, 2008 9:52 am

it is for the scasm format, but I meant the format of the line in the scenery.cfg file...
"Son, we are about the break the surly bonds of gravity, and punch the face of God." -- Homer Simpson

Image
User avatar
HardCorePawn
Senior Member
 
Joined: Fri Sep 01, 2006 4:18 pm
Posts: 1277
Location: 2500' above Godzone

Postby Charl » Mon Mar 10, 2008 11:10 am

HardCorePawn wrote:
QUOTE (HardCorePawn @ Mar 10 2008, 10:42 AM) <{POST_SNAPBACK}>
Can anyone point me to the format spec for the Flatten and Exclude lines... I cannot seem to find them anywhere (it is monday morning after all)... I assume its something like:

Think you're on the money with the excludes, flattens start top left and go counter-clockwise, generally 4 points.
User avatar
Charl
NZFF Pro
 
Topic author
Joined: Mon May 01, 2006 8:28 am
Posts: 9690
Location: Auckland

Postby greaneyr » Mon Mar 10, 2008 11:47 am

I think i'll just shut up on this post - I seem to be having a mare when it comes to misinterpreting the problem!
User avatar
greaneyr
Forum Addict
 
Joined: Fri Nov 16, 2007 9:53 pm
Posts: 459
Location: Palmerston North


Return to NZ Scenery Project

Who is online

Users browsing this forum: No registered users and 1 guest