• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Flatten problems.

Messages
13
Hello!

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.
 

Attachments

  • ESNU_Flatten.sca
    311 bytes · Views: 544

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi,

Which FS version are you using? For FSX you should use the flattens made with the terrain SDK (shp2vec).
 
Messages
7,450
Country
us-illinois
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 )
Area16N
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!

[EDIT]

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"

[END_EDIT]

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:

http://www.home.earthlink.net/~smgreenwood/downloads/fstutilities.zip

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:

http://www.visualflight.co.uk/forums/topic.asp?TOPIC_ID=6561


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.

http://www.fsdeveloper.com/forum/downloads.php?do=file&id=68


Hope this helps! :)

GaryGB
 
Last edited:

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,932
Country
us-wisconsin
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.

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

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

Dick
 
Last edited:
Messages
7,450
Country
us-illinois
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:


[EDIT]

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?

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

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

[END_EDIT]


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


GaryGB
 
Last edited:
Messages
13
Hello!

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.

Johan
 
Messages
7,450
Country
us-illinois
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 ? ;)


http://www.fsdeveloper.com/forum/showthread.php?t=871&highlight=SCASM+Shadow

http://www.fsdeveloper.com/forum/showthread.php?t=1113&highlight=SCASM+Shadow

http://www.fsdeveloper.com/forum/showthread.php?t=1324&highlight=SCASM+Shadow

http://www.fsdeveloper.com/forum/showthread.php?t=608&highlight=killshadow

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

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

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

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


Hope this helps! :)

GaryGB
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
In SCASM removing the shadow would mean removing the ShadowCall command.
 
Messages
13
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.

Johan
 
Messages
13
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:

Johan
 
Top