Sunday, January 25, 2009

Terrain Test: Part 2

I've been thinking about rivers lately. Namely, how do I generate them? My first pass is complete garbage. It's a start, however, and I have some ideas of where to go from here.
My current iteration picks random points in the terrain, places a water 'tile' there, then picks a random lower point adjacent and continues the river flow from there. There's some buffer that allows the river to go uphill a little in case of flat ground and bumps in the way. I also added a floodfill for lakes when the river has nowhere else to flow.



What I get is a jittery mess, followed by bodies of water that are either microscopic or end up filling the entire terrain.

What I'm looking for is something more like this.



Aside from fluviation indentations in the terrain that I'm going to eventually have to deal with, I think it might be useful to try a smoothed 'wander' sort of steering like implemented here: http://www.red3d.com/cwr/steer/Wander.html
The river will probably have a power setting on a per cell basis that will determine how it can overcome bumps in the terrain (smoothing them in the process) as well as dictate turn radius.

I'm still turning around some chicken/egg issues with this and other procedural features that I want to include, form following function or vice versa. Some algorithms involve rivers starting in bodies of water and creeping their way towards peaks, for instance, branching on their ascent. A lot of this will have to be looked at in terms of making the most interesting worlds possible as opposed to retaining ultimate simulational fidelity.

Labels: , ,

0 Comments:

Post a Comment

<< Home