Flatten problems.


I'm having problems with my scenery.

The problem is that I'm trying to make a flatten using scasm code, but it isn't working, the addon scenery located below my scenery continues to flicker through my scenery.

Some info on my project is that it is a ground mod for this scenery, so I had to remove the file containing the original addon ground scenery.
However, if I leave it enabled, it works as a flatten so that there is no flickering, but when I remove that scenery, it starts to flicker.

I do know that the addon scenery I'm trying to replace was made with scasm code aswell, and that its flatten was made with the Area16N command, but I simply can't recreate that flatten.

This is what I have so far.



Staff member
FSDevConf team
Resource contributor

Which FS version are you using? For FSX you should use the flattens made with the terrain SDK (shp2vec).
Hi Johan:

It has been a while since I looked at the Area16N flatten method, but I believe your "ESNU_Flatten.sca" code might alternatively be structured like this:

; Simplified Header Coordinates:
; N63:57:34.98 = 63.9597166
; N63:37:35.00 = 63.6263888
; E20:39:24.26 = 20.6567388
; E19:54:11.74 = 19.9032611

; Simplified LatRange Coordinates:
; N63.802575 = 63.802575
; N63.780803 = 63.802575

Header ( 1 63.9597166 63.6263888 20.6567388 19.9032611 )
LatRange( 63.802575 63.780803 )
Set ( areamx 64 )
Elevation ( 100
63.794919 20.258140 ;1
63.785648 20.268288 ;2
63.780803 20.287888 ;3
63.781640 20.308432 ;4
63.789955 20.308845 ;5
63.801439 20.291948 ;6
63.802575 20.260162 ;7
END16 <--- DO NOT put a carriage return here!


Dick: Above carriage return TIP is for "good habits" with FSX... as I found BLN2SHP won't process Area16N files converted to *.BLN with a "CR/LF" at "EOF"


I successfully compiled a BGL with this Area16N flatten code using SCASM, however I did not test it in FS2004 to see if it works properly at the airport in question. ;)

I would recommend use of Steve Greenwood's excellent "FSTFlatten" utility to make an Area16N flatten and compare the output code to see how your hand-coded Area16N method *.SCA files might best be structured in the future: :idea:


FYI: FSTFlatten also allows the option of outputting an FS9 LWM flatten BGL.

IIRC, the LWM flatten BGL would also be FSX compatible (in case you want to use your scenery in FSX in the future); the Area16N method is not honored by the FSX rendering engine, and as Arno states, the proper method is to make a vector flatten *CVX*. BGL file.

If porting to FSX, you might wish to edit a copy of your *.SCA file to create a *.BLN file to be processed with Jim Keir's BLN2SHP utility, and then with FSX SDK's SHP2VEC utility to create a fully-compliant FSX flatten BGL. :teacher:


It is also possible that SBuilder for FS2004 could work with your *.SCA file and provide some certainty with output BGL file functionality, in addition to a wealth of additional features for easier scenery building in FS9.


Hope this helps! :)

Last edited:


Staff member
Resource contributor
Hi Johan.

The SCASM code you provided is fine. The flatten shows as expected in my sim ( default scenery ). Don't worry about extra carraige returns... SCASM treats them as whitespace and does not bother the compilation.

Your dealing with someone else's addon, so you might expect problems.

Since we don't have the addon, we can only guess as to why you have problems with it. So I am guessing you are adding a photoreal ground poly ( from gmax or a similar program ), to someone else's addon scenery?

In order for a ground poly to work right you need to have all the flattening elements the same height. This means runways, and taxiways and flattens.

Also, if the addon changed the height of the airport, you need to locate the stub BGL that alters the height of the replacement runway, and it must agree with all the other heights.

Only then can you place the new ground poly, which should also be at that height, or slightly higher, and tweaked as per the WIKI article to the right layer number.

You might try to disassemble the addon, if possible, to see what height that ground poly rests at... as that might just be the height you need.

I don't quite understand why you need to add a flatten, as the addon should have already done that. Your code does work making a flatten 100 meters above sea level. But starting at the airport, you start at the original runway altitude, so the flatten is above you... slew to +100 meters and the flatten will pop into view. This is expected as the sim will use the first folder instance of altitude for the airport to set the airport start height.


The above link discusses the solution to changing an airport elevation in both FS9 and FSX ( it is the same procedure ).

Last edited:
Hi Dick:

Glad to read the additional clarifications (and some very important details I had failed to mention!) in your post! ;)

I edited my post above in context to explain a personal "preventive practice" I implemented after pulling lots of hair out one time when working with an Area16N file converted to a *.BLN for use with Jim Keir's BLN2SHP utility; I discovered it won't tolerate a carriage return on the last line of such a file edited in NotePad. :eek:

PS: I understand the importance of the altitudes being uniform between all airport BGLs for a given location, but regarding your recommendation for placement of a custom textured ground poly, I believe I had read in a thread here at FSDeveloper that FSX likes a separation between scenery planes of "0.125" to eliminate "flickering" (but I don't recall if it was Feet or Meters); could you tell us which units apply to that? :confused:


I must admit that in the back of my mind I was also wondering about the other possible underlying causes of the flickering and bleed-through with the textured ground poly relative to the flatten as described above; I'm curious if one might need to consider the role of Z-Bias / Draw-Order issues as well?




Thanks again for sharing your considerable expertise with us! :)

Last edited:

Thanks for all of your replies.

This is the situation I'm dealing with; I have this addon scenery that has an outdated runway, The buildings however, are fine. It's structured so that it has one seperate photoscenery bgl file, a ground scenery file on top of that one, and a bgl file that has all the buildings.
It's all made up with SCASM code and nothing else.

What I wanna do is to place my gmax runway and twy on top of that photoscenery using the gmax groundpoly method, but it flickers for some strange reason. I experimented and decompiled the bgl file holding the ground polys and stuff that was included in the addon and compiled it again and discovered that it started to flicker with the photoscenery.

So I thought that i had to recreate the flatten that the developers used during the first compile, therefore i contacted them about this topic.
However, they told me that they had issues with FSArchitect, which was used to make the scenery, so they couldn't help me recreate it.

Hi John:

You may also need to use the SCASM equivalent of the "MDLTweaker" utility function in ASM files to suppress the display of a "shadow" under your ground poly.

I've not done this yet in SCASM, but I believe it was done routinely with that development method as one of the "necessary" tweaks required for successful display of textured ground polys placed by SCASM.

Arno probably remembers this, but until he replies, perhaps this might merit investigation ? ;)









Hope this helps! :)

Last edited:


Staff member
FSDevConf team
Resource contributor
In SCASM removing the shadow would mean removing the ShadowCall command.
Uhm, thank you, but there's no shadows in my scasm code.

This is what I've done to get the coding in the first place:

1. I followed the tutorial on gmax ground polygons. (Yes I removed the SHADOW CALL and changed ADDOBJ to ADDCAT and assigned the object a layer.)

2. I tried it and noticed that it flickers on top of the seperate photoscenery bgl file which is weird since it has a layer number that's higher than the ps scenery.

3. I decompiled the scenery file that holds my runway and started to mess around with the SCASM code I got from it.

One more thing, the difference between my polygons and the polygons included in the package is that my polygons are built up with VertexList and the addon utilizes TexPoly. For some reason TexPoly on TexPoly works fine but VertexList on TexPoly causes flickers. :confused: