Hacker News new | ask | show | jobs
by alaricsp 6115 days ago
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).