When I was a kid in the 1980s, I read a library book on the topic of writing military strategy sim games, and it had an entire chapter on producing random terrain. It started with the usual fractal techniques for producing contours, but then it went on to use weighted random walks to produce roads and rivers, lakes, bridges, and cities.<p>I've tried recreating the algorithms from what little I remember of them, but they never produce anything that looks very good. Online I've found plenty of references to ways of generating the contours, but never realistic-looking roads, rails, and waterways...<p>Does anybody know an online reference to that sort of thing?<p>Thanks!
What kind of scale of terrain are you looking for? Continent maps or battlefield scale?<p>I got some stuff I rolled here
<a href="http://flywheel.be/examples/" rel="nofollow">http://flywheel.be/examples/</a><p>All random generated. But probably not what you're looking for.
Game development websites are a good place to look. Try these links:<p><a href="http://www.gamedev.net/reference/list.asp?categoryid=45#188" rel="nofollow">http://www.gamedev.net/reference/list.asp?categoryid=45#188</a>
<a href="http://www.gamasutra.com/search/index.php?search_text=terrain+roads&submit=Search" rel="nofollow">http://www.gamasutra.com/search/index.php?search_text=terrai...</a>
For generating roads or waterways, try coming up with rules similar to the way they're created in real life. For example, water flows downhill and pools when it finds a local minimum.
Roads, on the other hand, tend to avoid steep grades when they can, typically moving straight and branching at right angles at regular intervals.<p>Read up on L-Systems, too. They're great for creating organic structures, be they leaves, trees, or river-tributary systems.<p>Oh and this may be useful: <a href="http://roguebasin.roguelikedevelopment.org/index.php?title=Cellular_Automata_Method_for_Generating_Random_Cave-Like_Levels" rel="nofollow">http://roguebasin.roguelikedevelopment.org/index.php?title=C...</a>
You can take a look at my master thesis (Charack: Pseudo-infinite 3D virtual world generation). It's in a pre-alpha stage, but I think you can find something useful (besides the wide range of similar tools and works I found during my research).<p>Project link: <a href="http://code.google.com/p/charack/" rel="nofollow">http://code.google.com/p/charack/</a>
If you have a heightmap, the roads should be fairly easy. Pick start and end points (cities?) and use a pathfinding method like A* to plot the road. If you want something more stylized, you could select a handful of points from that method and then use beizer curves or something between them.
For waterways, just simulate rain and erosion. Let's say you model your terrain as a height field.<p>1. Add rain in random locations
2. Have the rain absorb some of the soil from the square it starts in.
3. Let the water flow in the direction of the gradient.
4. Deposit som e of the picked up soil (maybe only with some probability based on the flow velocity?)
5. Repeat<p>If you just want rivers and lakes you can skip the erosion step and just simulate the water flowing. If you wanted you could add sources manually and have water always flow from there.
Here's an article on adding rivers to procedurally generated terrain - <a href="http://www.gamedev.net/reference/programming/features/randomriver/" rel="nofollow">http://www.gamedev.net/reference/programming/features/random...</a>. Searches for "procedurally generated [roads/rivers/waterways/etc] seemed to be the most promising.
google erosion simulation algorithms (or derivations)- some brilliant stuff mostly developed for geography simulations that would make absolutely amazing terrains.
I did some work on random terrain once. You can see the results here:<p><a href="http://steveasleep.appspot.com/pyworldgen" rel="nofollow">http://steveasleep.appspot.com/pyworldgen</a><p>If this is what you're looking for, I can try to explain it.
<a href="http://lmgtfy.com/?q=terrain+generation&l=1" rel="nofollow">http://lmgtfy.com/?q=terrain+generation&l=1</a><p>Seriously, I'm all for discussion of particular techniques, but your question is way too broad right now. Go read some papers or even just online tutorials or descriptions of how other software does it, and then lets have a discussion.