Live data from Hacker News

Ask HN: How to generate random terrain

news.ycombinator.com

11–20 of 34 posts

Re: Ask HN: How to generate random terrain

#14
post #7
post #5

Earlier quoted context omitted.

Did you actually read his entire question, or just the title?

I read the entire question, and there are plenty of great resources out there for rivers, as well as human settlements, roads, railroads, etc. Even a "I've tried method X and had problems Y and Z with the output" could produce interesting discussion, but this is just asking for links when a minute or two of Googling does a pretty good job of turning things up.

True, I glossed over my previous research; I didn't think it'd interest people, but you're right, it's wise to show some evidence of your previous attempts before asking for tips...

My googling always just found me more and more ways of generating the height-field data - it's the roads and so on that interest me. I tried tinkering with weighted random walks (eg, given the desire to continue a road from a given point, pick an adjoining cell with a weighting that prioritises having the same altitude and being closest to continuing the existing direction), but this fails to capture things like the fact that roads tend to run along valleys and mountain passes - the hard part, it seems, is in choosing initial points. Likewise, a river can be continued by finding the most downhill adjacent cell, until you find a minimum then starting a flood-fill algorithm to create a lake, until you reach a boundary pixel that "goes downhill", whereupon you can start a new river going down from there - but this fails to realistically account for the widths of rivers (you can just make the river wider as you go down, and sum the width of rivers that meet, but that simple model looks wrong: real rivers are deeper when in narrow canyons and the like).

Re: Ask HN: How to generate random terrain

#15

Perchance recall the book? I'm semi-interested in retro approaches to the problem.

I'd love to find the book again... I bet it's out of print, though. It had lots of detail on modelling damage to tanks, and creating terrain, and working out things like line-of-sight in complex worlds, and I think some basic AI, but had nothing to say about snazzy graphics whatsoever; I think it made some reference to vector displays or something like that ;-)

Re: Ask HN: How to generate random terrain

#16

Perchance recall the book? I'm semi-interested in retro approaches to the problem.

I'd love to find the book again... I bet it's out of print, though. It had lots of detail on modelling damage to tanks, and creating terrain, and working out things like line-of-sight in complex worlds, and I think some basic AI, but had nothing to say about snazzy graphics whatsoever; I think it made some reference to vector displays or something like that ;-)

Any of this look familiar? http://books.google.com/books?q=AI+computer+simulation+milit...

Re: Ask HN: How to generate random terrain

#17

What kind of scale of terrain are you looking for? Continent maps or battlefield scale? I got some stuff I rolled here http://flywheel.be/examples/ All random generated. But probably not what you're looking for.

These look great - what method did you use to define the borders on the risk-like map?

Re: Ask HN: How to generate random terrain

#18
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.

Re: Ask HN: How to generate random terrain

#19
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).

Project link: http://code.google.com/p/charack/

Re: Ask HN: How to generate random terrain

#20

Earlier quoted context omitted.

I'd love to find the book again... I bet it's out of print, though. It had lots of detail on modelling damage to tanks, and creating terrain, and working out things like line-of-sight in complex worlds, and I think some basic AI, but had nothing to say about snazzy graphics whatsoever; I think it made some reference to vector displays or something like that ;-)

Any of this look familiar? http://books.google.com/books?q=AI+computer+simulation+milit...

Alas, no :-)
Post reply on HN