Page 1 of 2

Terrain Morphing 4km vs 2km

Posted: 2008-12-06 02:04
by CodeRedFox
[Info] The polygon diffrence between a 2km (12024x2) and a 4km (1024x4) maps.

Hello mappers,

Heres some quick Info on Terrain LODS when dealing with 4km maps.

Image

The image above represents how the BF2 engine creates ground. A series of polygons.

A 1km map will have 1024 x 1024 polygons in a box formation.

Now a 4km has the same 1024 x 1024 but is stretched out 400% bigger. So where you had 4 polygons you now have only one.
  • Flat ground: Image show what flat ground looks like.
  • Share Incline: Image show what allot of areas on Feyzabad look like (little more drastic here). See the stretched polygons? The game doesn't like this. and at distance tries to un-stretch the polygon.
  • Smooth Incline: Image show how the BF2 engine prefers the ground to be. Very little stretching.
Blue color is the polygon size of a 1km map
Green color is the polygon size of a 4lk map (Polygons are twice a big/scaled)

Image

Stretching at distance.
Image
Image

As you can see without smoothing surfaces the engine tries to smooth it at a distance. As you move closer the engine returns the polygons to its correct shape.

Hope that helps all of you.

Re: [Info] Problems with 4km vs 1km

Posted: 2008-12-06 02:41
by =Romagnolo=
So, was it that messed your new map ? I see it a lot in kashan in the moutain parts. Good to know, thank you for the research.

Re: [Info] Problems with 4km vs 1km

Posted: 2008-12-06 02:55
by CodeRedFox
This is the exact problem.

Re: [Info] Problems with 4km vs 1km

Posted: 2008-12-06 03:23
by CoOlaiD
and is there absolutely no way of working around it? and if u import terrian in from max or sum other model software? i know it a pain but dose the same problem occur?

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-06 03:46
by CodeRedFox
Yes the way you work around it is smooth it out :-D

You could possibility add the ground in as a static but all of our tests have been bad.

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-06 03:47
by Rhino
fixed your title and a little bit in your topic, a 1024x2 map is not 1km, its a 2km squared map :p

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-06 04:03
by CodeRedFox
OH Duh LOL yes

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-07 14:19
by wuschel
I am not into mapping, but here is my question:

Would it not help to use 4096x1 instead of 1024x4 for a 4km? As I understood it, we speak about a "polygon stretching problem". With more points in the map, maybe we could take some some strain out.

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-07 14:25
by Pride
maximum allowed 'amount of polygons' is 1024x1024.

Therefore the only way to get a 4km map is to use a 1024 scale 4.

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-07 18:52
by marcoelnk
it somehow works to create a 2024 x 2024 map but only if everything that is bigger than 1024 x 1024 is water afaik.... and it will be quite buggy i assume. so dont try that.

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-07 21:17
by CodeRedFox
I believe that's because your using the out of bounds as part of the level.

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-07 21:44
by Rhino
[R-DEV]Pride wrote:maximum allowed 'amount of polygons' is 1024x1024.

Therefore the only way to get a 4km map is to use a 1024 scale 4.
max by the editor is 1024x4, but you can hack the files to change the scale of the terrain, but I have not found a way to change the scale of the terrain textures.

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-08 15:36
by Fishbone
The engine actually smooths out the terrain? Or does it optimize the terrain by replacing 4 polygons by 1 dynamically. Just like the Optimize modifier in 3ds max.

If the former, do you have any idea why the BF2 engine would do that? There doesn't seem to be any advantage as the amount of polygons remains the same. If the latter, well then it is quite obvious that the BF2 engine doesn't like steep terrain as it will probably average the height values of the vertices. No suprise there.

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-08 17:39
by CodeRedFox
The engine doesn't like steep terrain. In fact most engines do not like it. So keep that in mind when creating a map. Maybe Rhino or I will be able to give you a degree number you shouldn't pass. I'm only guessing here but I think each angle shouldn't be over 45 degrees. This means from one polygon to the next, not overall.

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-08 17:54
by space
[R-DEV]CodeRedFox wrote:The engine doesn't like steep terrain. In fact most engines do not like it. So keep that in mind when creating a map. Maybe Rhino or I will be able to give you a degree number you shouldn't pass. I'm only guessing here but I think each angle shouldn't be over 45 degrees. This means from one polygon to the next, not overall.
I've managed to achieve fairly steep slopes on my map without much apparent morphing. The best technique is to use the smooth tool on the lowest setting size setting, and set it only to either raise or lower. Its far from prefect, and its still possible to drive up very steep slopes, but it works quite well.

One idea I had to minimise morphing is to edit the heightmap in photoshop. ( Ive not tried this but it should work ) I think that if you used a gaussien blur, it should be possible to equal out any extreme changes between adjacent polygons. This should have the effect of applying the smooth tool on lowest setting, on every single polygon on the map. Instead I did it by hand when I first started my map, and it wasnt much fun :/

Imo the main problems with 4km is the lack of terrain detail, as each polygon is 4m in game, so its hard to make trenches etc, and also the dynamic shadow problem. The shadow problem isnt too apparent on Kashan and Qinling as the sun is directly above, so you dont often see the aircraft vehicle shadows, but if you have the sun at dusk or dawn height, then it becomes much more of a problem.

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-16 19:02
by Tannhauser
With the shadow problem, where does the shadow appear then? Or is it the shadow flickering problem i've seen on some mappers trying 4km on the editor's forum?

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-16 23:20
by space
The dynamic shadow appears wherever it should be cast by the moving vehicle/aircraft etc. Thing is that instead of a nice vehicle shaped shadow, you get large black blocks, that look terrible. I think Im right in saying that only the people travelling in the vehicle see the problem, but I might be wrong on that.

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-16 23:43
by e-Gor
It's not terrain smoothing that's happening - it creates lower LODs. Visually, this has much the same effect on steep areas - it just samples at a quarter (or a 16th) the number of points, so any steep slopes will appear more gradual since the distance between the points on the terrain is larger. So, everything you said in the tutorial is valid, except for the reasons behind it :P

Again, the lower density of points means that the effect is a lot more noticable (as it appears on larger scales) on scale 4 maps than on smaller ones.

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-21 23:01
by Madhouse
So really the only fix we have is to smooth out the terrain or use static mountains?

Re: [Info] Problems with 4km vs 2km

Posted: 2008-12-22 00:23
by CodeRedFox
Yep those two will help. Unless someone else can find another tip.