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: , ,

Saturday, January 17, 2009

Terrain Test 1

While I've surfaced briefly, a quick blurb on another side project I've been chipping away at when given windows of opportunity. Can't really say a lot about it yet aside from the fact that it's going to involve procedural world creation. As such, here's an early prototype screenshot, showing random heightmap generation (roughly color coded) plus crude river and lake propagation.



I'm not even sure if the end result worlds are going to be as granular as this. One project I did back in college was a mix between designed and random worlds. I made a few hundred authored 'tiles', somewhat like the screens in Zelda. Each edge followed one of 8 templates, with the middles being fair game.


The tiles were then randomly drawn and assembled, Carcassonne style.



There is the potential in this project for multiplayer and world ownership, which might make designed elements like these look contrived and repetitive, as several people might have the "lake surrounded by 3 boulders" world tile.

More to come, perhaps with a proper project title.

Labels: , ,