River Network Expansion Applet

What Is It?

This applet demonstrates an algorithm for making random hierarchical networks with controlled amounts of branching and twisting. These networks are compatible with the terrain generation algorithms elsewhere on this site, and so can be used for things like mountain ridgelines and rivers. If the details of each split in the network can be controlled well enough, the network can even be used for roads.

In the field, this network-generation algorithm will be used to create the network down to a certain level of detail, say the 500-meter scale for rivers. Below that, a smoothing function will be used to smoothe out any jagged curves; and at the bottom levels of detail, say below 20 meters, the actual polygons representing the river with water, banks, sandbars, etc., would be generated.


The blue network that is drawn by this applet is generated in a "top-down" manner, starting at a coarse level of detail and refining it down to finer scales, adding details as it goes. The toggle labeled "Expansion" selects how many levels of detail are generated. The "Toggle Mesh" button allows you to see the underlying mesh.

The "Split-ness" slider bar selects how prone the network is to have branches. The network always has at least one branch. As the "Split-ness" slider is increased, the number of branches increases until a significant amount of the grid is full of branches. As the Split-ness is increased the windingness also increases; this is a side-effect of some choices I made in the algorithm. I will try to fix that.

The "Wind-ness" slider increases the tendency of the network to wind, as opposed to running in more-or-less straight lines. The initial setting is something that might be used to generate roads (although it's not all the way there, for that) which has very straight lines. Quickly as the "Wind-ness" is increased the network will become more river-like.

Browser Issues

You must have some sort of Java plugin or runtime available to see this applet at all.

On some browsers, if the applet is scrolled partly off the screen then some of its controls don't function. If you find that (for example) the "Toggle Mesh" button doesn't work, try scrolling the browser window so that the entire applet is on the screen.