Hat

Published October 18, 2007
Advertisement
My avatar is still wearing his little Santa hat. Jeez, what's it been, 3 years now? What a noob. To be honest, though, I may not even have the un-hatted .GIF anymore. Been 1 or 2 harddrive swaps and reformats in there, and anybody who is familiar with my backup organization knows that the .GIF is probably lost in the mists of time by now.

I hate fractal terrain built via continuous noise functions. I mean, I like it, but at the same time I hate it. The fact that fractal noise somewhat resembles real-world terrain is merely a coincidence, and this fact become obvious the larger scale you want to go. I recently constructed a planet. A chain of hundreds of noise modules combined together to form intricate terrain variations across the scale of entire continents. Pretty cool, and while on a small enough scale it looks pretty good, on large scales it is totally unrealistic.

1) Erosion
I have played with erosion enough to know that for my purposes it is too much. Large scale noise fractals of hundreds of modules and over a dozen octaves per each generator are too much. Try to mix them together into the allowable time needed to build a level, and the result is an extremely bored player shutting down your game from the loading screen to go play something else.
However, without realistic water (and thermal, and wind) driven erosion, terrain looks false and artificial, especially on larger scales. There are just so many cool terrain features in the real world that require erosion to construct.

2) Glaciation
A subset of erosion, it is easy to underestimate the tremendous impact glaciation has on the formation of terrain. Yet, modelling it is difficult. Hydro erosion is easy, and can be somewhat realistically simulated on a grid model, but I haven't seen many resources on modelling glacial erosion. Ice can push huge amounts of earth around, fracture rock, grind down mountains, and build up terrain features, all within a fairly limited scope (ie, the ground covered by the glacier).

3) Tectonics and Volcanism
The greatest force in terrain construction, and again I have seen no models that can come even close to realistic. A mountain range in a fractal-based heightmap is in no way similar to a mountain range constructed by two tectonic plates smashing together and buckling upward. And while I can construct a fairly decent model of a volcano using some special basis functions in the fractal generator, doing lava flows is completely different. And, of course, a good lave flow is impossible for a heightmap to depict, since they are so full of bubbles and overhangs. Although, I think it would be fairly trivial to massage a noise fractal to create something like a lava flow as a triangle soup mesh.

A lot of real world terrain features are formed as intricate combinations of different forces. Such as this photograph of a canyon. (I was almost hit by a train once in this very canyon. But I digress.)


Here we have a range of hills cut in half by a river. I don't see this sort of formation crop up in erosion models very often, mostly because it is formed by tectonic action. The hills are pushed up slowly, beneath an existing river. As they rise, the river cuts down into them, so that millions of years later you have a canyon through a range of hills. If the hills came first, then the river, the river would flow around the hills instead.
It's difficult to model this sort of behavior.

I need an extremely exhaustive, scientific model of landscape formation processes that includes erosion, tectonic, glacial, and other geological factors, and I need it to run in close to real time so that I can use it to page terrain chunks in and out of a game in progress. Anyone know of such a library? [grin]
Previous Entry GUI
Next Entry Explody
0 likes 5 comments

Comments

darkpegasus
You couldn't change your icon even if you wanted to because that feature hasn't been fixed yet *cough* tired of blue orb *cough* [grin]

I love reading journals like this because it reminds me how game programmers have to learn about so many things just to make one correctly. In this case, a little geology. Good stuff.
October 18, 2007 11:10 AM
JTippetts
To be fair, though, most games don't really require a real-world level of realism. Gamers have been conditioned, I think, to accept fractal terrains, plasma terrains, and so forth as real enough, and in a lot of cases they really are sufficient. Very rarely will a gamer look at a broad overhead view of a procedurally generated battlefield in rough country and think 'gosh, how unrealistic. That wash there should show more signs of sedimentary deposition, over here there should be scars of glaciation from ice moving through this valley, and yonder, there really should be a tear-fault splitting that hill range into two pieces.' If the game is built right, they should instead be thinking 'oh, shit, where in all this are the aliens that are going to eat my face?'

I've always had it in the far back of my head to create some ultimate game of exploration, replete with all the wonders I feel whenever I hike some new canyon or mountain, or climb to a new summit to see wilderness spread out before me. I've never really had that kind of moving, awe-inspiring experience in a game, no matter how detailed the terrains seem to be.
October 18, 2007 04:52 PM
LachlanL
Yeah, I agree with Mr. Tippetts. It's an admirable persuit, trying to replicate nature, but at some point we've got to accept that we're way out of our league. Especially for applications requiring real-time generation. My current project is doing something similar. I have a large-scale map that "pages" in generated data when the user wishes to zoom in on a particular area. I only use diamond-square at the moment and I occasionally have dreams of auto-generating fantastic vistas, but when it gets down to it, I don't have the time/CPU cycles to do this and it would only make a minor difference to the gameplay anyway.

Like I said, it's an admirable persuit though, and I may be wrong and you may find some awesome new method for generating terrain, so by all means, press on! [smile]
October 18, 2007 06:25 PM
JTippetts
Noise fractals are pretty processor intensive, especially the more detailed and realistic you try to get. For a paging scheme meant to run in real-time, you need to trim the fat--lower octave count to the absolute minimum required to fit the Nyquist sampling restrictions imposed by the size of the heightmapped grid and the dimensions of the area being sampled, reduce the number of contributing modules to the absolute minimum required to simulate the type of terrain you desire, take as many shortcuts as you can, cache or buffer values anywhere it will make a performance difference, etc...

A lot of my basis functions are pretty processor heavy; some perform domain distortion at the basis-function level, meaning that additional noise functions are called for each coordinate of the input vector in order to perturb the inputs. The coordinate vector hashing that hashes an integral coordinate/random seed tuple of 4 dimensions takes all bytes of the input vector into account, ensuring that the 'pattern' generated by the basis function has as long a period as possible, also adds to the complexity of the algorithm, since each basis-function call has a deeply-nested array indexing statement in addition to the mathematics required to generate the noise value, be it LCG for value noise, dot-product for gradient noise, or weird shit(TM) for simplex noise--and the associated unit-cube interpolations to get the final value. Outwardly, fractal noise is simple, but in practicality it is a timeconsuming process whose consequences become exacerbated by being called 512x512, 1024x1024 times or more, depending on the size of heightfield chunks. Gah.

I've tried it with paging systems before and gotten pretty decent results with very basic terrains. Unfortunately, my OCD for complex terrains drives me to sometimes chain as many as 7 or 8 noise fractal modules, plus combiners and modifiers, for any given level. And that, my friends, is no picnic for the pager.

While the function-based techniques of noise fractals are highly cool, I still see a lot of benefit in the plasma, subdivision, accretion/deposition, etc... family of fractals. While they are best implemented in 'chunks' at a time (as contrasted to the noise-function fractals, which are evaluated a point at a time) they allow leeway for a lot more special-case stuff, like explicit coding for valleys, canyons, crags, cones, etc... I've implemented a module in my hierarchy that can view a loaded height buffer as a function, specifiably repeating or clamping the buffer across the coordinate space, and interpolating between sample values, but still there are a lot of operations that make more sense on a per-chunk basis.

If I continue to bash my head on this, I'm certain I'll move further and further from a purely noise-based solution, which is probably for the best. It's pretty easy to get sidetracked on building entirely procedural planets, which really aren't very practical unless you are building an interstellar empire sort of game. I mean, seriously, who really wants to be dropped into a game world the size of an entire planet? Hell no, I say. I have a hard enough finding all the Heart Pieces and Treasure Chests as it is in small worlds.
October 18, 2007 08:06 PM
Prinz Eugn
That picture reminds me of home... and Mars.

Weird.
October 18, 2007 11:24 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement