Carving Terrain Like Water

A few years back I wrote a handful of posts about faking water on top-down maps: generating 2d rivers, cliffs, and an exhumed river channel. Those one-off experiments eventually grew into a proper map library I’ve been maintaining called compass. Revisiting them now is fun because real-world geology already solved the “make it look natural” problem ages ago. I just borrow the names and loosely approximate the process. Here are three of the fluvial generators and how they actually work. ...

February 18, 2024 · 3 min

Generating Exhumed River Channel

I recently did some work in generating rivers in a 2d game. Revisiting this work to create an exhumed river channel, I decided it might be fun to revisit how to generate it to make the channel look more realistic. Instead of using a drunken walker, this is a more expensive but interesting map generator: Start by generating 2d simplex noise where less <0.6 is floor rest is walls Generate terminal lines at each map exit (north, south, east, west). Shuffle those lines and randomly choose a start and end location for the river based on two of those lines. Later you can add another line with terminal point to allow a split river channel ...

August 6, 2018 · 1 min

Generating 2d Rivers

Rivers are really hard to generate for 2d top-down games for multiple reasons: Rivers primarily form based on heightmaps which are hard to display in top-down Displaying fluidity when working with sectors or grid-based rendering can be complicated, bresenham’s line algorithm only goes so far to make things look smooth naturally occurring mechanisms of nature have numerous factors in play that caused them to exist. Simulating all of these factors isn’t reasonable. I was able to make relatively decent 2d rivers using a few techniques. ...

July 11, 2018 · 1 min