Friday, September 18, 2015

Better Rivers

I cranked up the World Generator after a long hiatus, and promptly improved the river generation.  I had to first re-factor the generator to understand that it was creating a hex map instead of a 2D grid.  I then changed the river generation to render rivers along the center of hexes, rather than along hex-sides.

The rivers start at a high-elevation point on the map, then use a very simple algorithm to determine their flow.  I just pick the next hex of the river to be the neighbor hex with the lowest elevation, excluding any hexes already used for the particular river being generated.  The result are rivers that meander nicely, mimicking the winding rivers we find in nature.

No comments:

Post a Comment