Terrain Morphing 4km vs 2km

Information and tutorials related to modding BF2.
CodeRedFox
Retired PR Developer
Posts: 5919
Joined: 2005-11-08 00:47

Terrain Morphing 4km vs 2km

Post 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.
Last edited by CodeRedFox on 2009-04-24 02:31, edited 5 times in total.
Image
"apcs, like dogs can't look up" - Dr2B Rudd
=Romagnolo=
Posts: 4765
Joined: 2006-12-29 14:52

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

Post 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.
[R-DEV]OkitaMakoto:"Cheers, you're the man, Okita"
[R-DEV]Rhino:"I in fact got kicked from a server for tking."
Hitperson:"well done, treasure it forever."
[R-DEV]Adriaan:"Damned classy Roma, if I may say so."
[R-DEV]Chuc:"Pro man, pro."
(yes, it was about me)
[R-MOD]BloodBane611:"Romagnolo, you definitely deserve a LOL award for that."
CodeRedFox
Retired PR Developer
Posts: 5919
Joined: 2005-11-08 00:47

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

Post by CodeRedFox »

This is the exact problem.
Image
"apcs, like dogs can't look up" - Dr2B Rudd
CoOlaiD
Posts: 7
Joined: 2007-06-05 04:08

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

Post 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?
CodeRedFox
Retired PR Developer
Posts: 5919
Joined: 2005-11-08 00:47

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

Post 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.
Image
"apcs, like dogs can't look up" - Dr2B Rudd
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

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

Post by Rhino »

fixed your title and a little bit in your topic, a 1024x2 map is not 1km, its a 2km squared map :p
Image
CodeRedFox
Retired PR Developer
Posts: 5919
Joined: 2005-11-08 00:47

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

Post by CodeRedFox »

OH Duh LOL yes
Image
"apcs, like dogs can't look up" - Dr2B Rudd
wuschel
Posts: 225
Joined: 2008-10-21 19:19

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

Post 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.
Pride
Retired PR Developer
Posts: 1467
Joined: 2007-07-19 18:13

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

Post 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.
Image

eddie: the MoD aren't just going to start blurring their faces so they look 'well ard' are they?
marcoelnk
Retired PR Developer
Posts: 1581
Joined: 2007-03-03 11:30

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

Post 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.
Last edited by marcoelnk on 2008-12-07 18:59, edited 1 time in total.
Image
CodeRedFox
Retired PR Developer
Posts: 5919
Joined: 2005-11-08 00:47

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

Post by CodeRedFox »

I believe that's because your using the out of bounds as part of the level.
Image
"apcs, like dogs can't look up" - Dr2B Rudd
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

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

Post 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.
Image
Fishbone
Posts: 78
Joined: 2008-05-08 18:27

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

Post 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.
CodeRedFox
Retired PR Developer
Posts: 5919
Joined: 2005-11-08 00:47

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

Post 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.
Image
"apcs, like dogs can't look up" - Dr2B Rudd
space
Posts: 2337
Joined: 2008-03-02 06:42

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

Post 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.
Last edited by space on 2008-12-08 18:57, edited 3 times in total.
Tannhauser
Posts: 1210
Joined: 2007-11-22 03:06

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

Post 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?
space
Posts: 2337
Joined: 2008-03-02 06:42

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

Post 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.
Last edited by space on 2008-12-17 11:41, edited 1 time in total.
e-Gor
Retired PR Developer
Posts: 3752
Joined: 2006-03-06 22:40

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

Post 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.
Madhouse
Posts: 230
Joined: 2007-12-08 00:18

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

Post by Madhouse »

So really the only fix we have is to smooth out the terrain or use static mountains?
CodeRedFox
Retired PR Developer
Posts: 5919
Joined: 2005-11-08 00:47

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

Post by CodeRedFox »

Yep those two will help. Unless someone else can find another tip.
Image
"apcs, like dogs can't look up" - Dr2B Rudd
Post Reply

Return to “Modding Tutorials”