Archived from groups: rec.games.roguelike.development (
More info?)
The Sheep <sheep@atos.wmid.amu.edu.pl>
wrote on Wed, 20 Apr 2005 18:51:29 +0000 (UTC):
> Dnia 20 Apr 2005 11:43:49 -0700,
> Krice napisal(a):
>> Hansjoerg Malthaner wrote:
>>> I once experiemented with parametrized curves (x,y) = f(p), p in
>> 0..1
>>> to produce rivers. I didn't get anything that looked enough like a
>>> river, but I think a better mathmatician than me could get something
>>> together that is enough riverlike for a game.
>> Making the river go to some general direction and then adding
>> random sideway movement seems to work well. That's how I got
>> rivers in Kaduria. It had little to do with mathematics
> It's still local. You can't just pick an arbittrary area of the map and
> generate it.
> You could do it if the rivers would be a fractal, or somehow based on
> local properties of a fractal.
You certainly can do it purely randomly as the player explores. When
you go to generate a new region, check each existing bordering region
that has rivers and put a river "seed" in your new region at the
appropriate border square. Bordering regions that haven't been
generated yet, you can randomly decide if the edge should have a river
seed. Then you generate your rivers from those seeds.
You now just have to make sure all of your river seeds flow into each
other (or not--multiple unconnected rivers could pass through one map).
This works nicely for trails, too.
More generally, you should always fade the terrain of existing maps
into your newly-generated maps to make the edges less sharp.
--
<a href="http://kuoi.asui.uidaho.edu/~kamikaze/"> Mark Hughes </a>
"Gibson and I dueled among blazing stacks of books for a while. [...] The
streets were crowded with his black-suited minions and I had to turn into a
swarm of locusts and fly back to Seattle." -Neal Stephenson, /. interview