FS2002-style ground poly autogen hack

#1
Hi,

I'm currently working on EEPU scenery. The airport is situated diagonally and at some places trees are quite near to some parts of the apron. I use FS2002-style ground polys for custom ground textures. They are known for creating autogen-free areas around them. In FS2004 and FSX (up to SP1 if I'm correct) there was a solution: placing a dummy RotatedCall command. This hack does not work in FSX SP2.

I've searched through various discussion boards and the only suggestion I found was splitting the ground poly into smaller (say, 100x100m) chunks. Due to the layout of EEPU, I'd have to use 22 polys to get the result. This means 22 polys that need to be cut out and placed precisely.

Well, it seemed like a lot of work. Perhaps there is a way around, I thought. And indeed - there seems to be one more undocumented bug, which can be used to shift autogen-free zone away from the ground poly. EEPU is few kilometers from the sea, so I can easily shift the autogen-free zone onto the sea and retain autogen trees around EEPU.

FSX excludes all autogen objects in a north-facing bounding box, which covers the whole object. Size of the bounding box does not depend on refpoint or any other values; it is calculated based on vertex list.

However, there is a bug.

When vertice are shifted, say, 100m southwards, the bounding box (and thus autogen-free area) is shifted north. The same seems to apply for other directions - autogen-free zone is shifted to the opposite direction.

Here's an image showing the described hack in action:


And here's the source code:
Code:
Set( LINBUF 10240 )
Set( BUF 6000 )
Set( AREAMX 512 )


Header( 1  N58:25:49.58 N58:24:15.57 E024:28:05.69 E024:28:05.69 )
LatRange(  N58:24:15.57  N58:25:49.58 )

Area( C N58:24:47 E024:28:29 100 )
	LayerCall( :refpoint 8 )
	Jump32( : )
:refpoint
	RefPoint( rel :skip  0.50 N58:24:47 E024:28:29
		V1= 10000 V2= 0 )
	Call( :obj )
:skip
	Return
:obj
	BGLVersion( 0800 )
	MaterialList( 0
			; material 0
		0.839 0.898 0.651 1.000 ; diffuse color
		0.839 0.898 0.651 1.000 ; ambient color
		0.000 0.000 0.000 1.000 ; specular color
		0.000 0.000 0.000 1.000 ; emissive color
		0.000 ; specular power
	)
	VertexList( 0
		-50.000 0.000 -250.000 0.000 1.000 0.000 0.000 1.000 ; vertex 0
		-50.000 0.000 -350.000 0.000 1.000 0.000 0.000 0.000 ; vertex 1
		50.000 0.000 -250.000 0.000 1.000 0.000 1.000 1.000 ; vertex 2
		50.000 0.000 -350.000 0.000 1.000 0.000 1.000 0.000 ; vertex 3
		)
	SetMaterial( 0 -1 )
	DrawTriList( 0
		   2    1    3 ;   0
		   1    2    0 ;   1
	)
	EndVersion
	Return
EndA
I'm now going to work on the actual ground layout of EEPU to see if this approach is indeed practical.
 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#2
Nice catch :) again a bug that might open some possibilities to get nicer looking scenery.
 
#3
I have my airport as a one large poly in 3ds max. I split it up into 35 parts and exported every part to a separate file, which I later combined into one. Then I compiled the source files with MakeMDL from FS2002 SDK.

1) I did not export every part to a different reference point. All parts use the same reference point.
2) I ran MakeMDL without Optimize switch.


My findings:

When Optimize is not selected under Options tab, two transformation commands are added to every part by MakeMDL. The result is that a bounding box is calculated for every part and/or the bounding boxes are placed at the reference point. (I have the refpoint in the middle of the field, so autogen does not get affected when bounding boxes are placed there.)

Either way, the autogen exclusion engine gets tricked and autogen is preserved, as can be seen from the following image.

 
Last edited:

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#4
Hi,

That is a very good suggestion. In this case the non-optimization is worth the benefit I would say.
 
#5
Hi!

Is it possible to explain better this process. How can I shift the vertices??

Those vertices got effect in your final result?

I tried something similar here, but the autogen seems to exclude an area to the east of the reference point!
 
#6
Paavo,

Could you elaborate your method a bit further please?
Especially that part with splitting the master scene into smaller ones and joining them together after the export.

Thank you
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#7
Hi,

Let me bump this thread. I have been doing some testing on the autogen exclusion, but I can not systematically reproduce the findings reported here. For example I see no different when I turn off the optimization. Has anybody been able to reproduce this?
 
#8
Hi Arno,

I guess I was a bit misguided. The issue is much more simple. Autogen exclusion is placed at the last reference point in the area.

To remove exclusions from standard ASM file produced by MakeMDL, simply add a dummy reference point just before BGL_RETURN in name_0.asm file:
Code:
    DRAW_TRI_END
    BGL_END
    [B][COLOR="Red"]SCALE_AGL   OBJECT_0_RETURN, 0, 0, 0, 0, 0, 0, 0, 0, 0[/COLOR][/B]
    BGL_RETURN
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#9
Hi,

Thanks, it seems I can reproduce this one indeed. It is quite similar to the dummy INSTANCE_CALL tweak we used in the past.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#10
Hi,

Sorry for bumping this thread again :), but I have a problem with it. For some files this tweak is not working. It seems to happen when the amount of polygons in the file is more than 32 kB. Have other people noticed this as well? Maybe the scene would have to be split up.
 
Top