Landscaping Problems

Blitz3D Forums/Blitz3D Programming/Landscaping Problems

Cousin Gilgamesh(Posted 2005) [#1]
I decided to create a level editing program that stores an array of heights on a grid that create a heightmap and an array of all of the objects and triggers in each level, but after getting the level editing program to a nearly complete stage, I started to realize that a gridded heightmap is very restrictive to the types of diagonals available. In other words, everthing works great as long as I only have angles in my landscape in increments of 45 degrees, but the nature of my game requires much more precise angles (it's somewhat a snowboarding game, by the way). The game relies heavily on the landscape and I want to make it work right. I chose the grided heightmap idea because it sounded easy and would not be dificult for my level designers to manipulate, but looking around on the gallery, I saw a lot of people with very smooth landscapes. Does anyone have any pointers as to how I can get my landscapes to be more manipulatable? Perhaps an alternate approach to the whole thing altogether? It would be greatly appreciated.


jfk EO-11110(Posted 2005) [#2]
If you choose a resoltuion that is high enough, the uniform grid structure won't be obvious anymore. A lot of people used to write their Mesh-based Terrain Editor, but even with the option to use any angle, the used an uniform grid just like a blitz terrain. Simply because it doesn't mapper that much when you use a high resolution. It's always a fight between world size and detail reslution, and right now the machines are still very limited.

The following terrain mesh was made with FLE (an older version, the freeware version):

It also uses an uniform grid structure, just like a Terrain.

If you use a Mesh, you maybe want to try to Polygon-reduce it.


Cousin Gilgamesh(Posted 2005) [#3]
Thanks for the tips. I was trying to keep the grid resolution low to maintain a higher framerate, but there are a few other things I can change around. Thanks.


IPete2(Posted 2005) [#4]
Cousin Gilgamesh

I assume that the array stores numbers referring to the range black - white (i.e. 0,0,0 - 1,1,1 - 2,2,2 --- all the way up to 255,255,255?) for the terrain to work.

If you make the difference between each set of data which you have stored to create terrain which is next to each other, less, then the result will be a smoother terrain (I think).

My thinking berhind this is that if you take a heightmap into photoshop and blur it, (reducing the hard boundaries of pixels next to each other) then the resulting terrain is smoother. This is due to the more gradual changes between each pixel. By applying this thinking - can you reduce the difference between each piece of data stored in your array (used to create the heightmap) and therefore make a more smooth landscape as a result?

Just a thought.

IPete2.


Rob Farley(Posted 2005) [#5]
Personally I've found using a grey scale height map isn't smooth enough, this only gives you 256 different heights. What I did for my helicopter game is start with the grey scale heightmap, then read this into an array, multiply everything by 256, smooth the array, then save it out in my own format. This increases the height resolution to 16 bit (0-65535) which gives you a much smoother terrain.

Anything where you want subtle changes, like a snowboarding game you are going to need to smooth it into 16 bit, otherwise you'll get a sort of stepped terrain.


Cousin Gilgamesh(Posted 2006) [#6]
Thanks for all the good ideas, guys. Actually, my heightmap is more of just an array of integers, so I'm not really restricted to 256 heights. I did this for the very reason that Rob mentioned. I also was thinking though, about IPete's commment about blurring the heightmap in Photoshop. The thing is, I can't blurr my array in photoshop, but there must be some sort of algorithm that I can run on my array that would have the same effect. Does anyone know anything about heightmap blurring that might help me write such an algorithm?


Rob Farley(Posted 2006) [#7]
Basic blur:

Create another array the same size.

Add up the 8 squares around the point you're looking at and the one you're looking at and divide by 9, then apply this number to your new array.

To blur more go for a 5x5 grid and divide by 25 etc etc.

You can't apply this to the array you're working on as it will screw the answers for subsequent averages.


Cousin Gilgamesh(Posted 2006) [#8]
Thanks for the idea. I'll give it a try.


Cousin Gilgamesh(Posted 2006) [#9]
oh, one more thing, for squares on the edge of the landscape, is it ok to just disregard the missing adjacent squares and just average the ones present?


Amanda Dearheart(Posted 2006) [#10]
One of the things that impressed me about Blitz3d (and Torque! BTW) were companion programs like ALE and TED. They make making landscapes a snap. ALE contains functions that let you even add models (like castles, bridges, and other buildings and surroundings). Surprisingly, TED doesn't but it does add a akybox feature so that you can preview your landscape in the TED program itself.
Both programs let you save the final landscape in Blitz own .b3b format.
I apologize for not helping with your 'array' approach, and sounding like a sales pitch for such programs, ALE costs $50.00 while TED $30.00. I use ALE exclsively for creating my landscapes!


Wayne(Posted 2006) [#11]
I agree with Rob, how about these:

Sample WIP of mountain terrain and valleys.

Textured:


Wireframe: