The stock fantasy world of role-playing is, we usually think, basically like medieval Europe. There are castles, swords, peasants; various set pieces. But what do these worlds of abundant cash, swords for hire, open-minded villagers, and "mage guilds" really have to do with the middle ages?
This post is about a world-building tool I've been working on. The goal is to generate semi-realistic landscapes including rivers and other effects of erosion. The tool is a bit of code, written in R. At heart, it models a map in the form of a grid, where each cell has an altitude, forming a height map.
Here I present a surprisingly easy way to fill valleys in a rasterized elevation map, for the purpose of creating realistic rivers quickly.