Geology and hydrology are the two great demiurges of the real world. Geological forces, we believe, war endlessly underground with unfathomable power, their eons-long struggle crushing mighty mountains toward the sky. Amidst these eons, hydrological forces sculpt the landscape granule by granule, each scratch a tiny victory in their endless endeavor to shave the mountains down. And thus, we believe, it is ordered: geology first thrusts terrain on high, then hydrology slowly sifts it down into the sea.
That’s what I refer to as a geology-first approach: the rocks decide where they want to be, then the water flows and sculpts around them. When I first began thinking of how to generate terrains, geology-first seemed like the obvious place to start. Instead of reinventing the wheel, why not just throw together an approximation of the actual processes that shaped the earth? It only took nature a few gazillion years to carve the world; how hard could it possibly be to simulate?
As unbelievable as it sounds, it turns out that simulating ages and ages of natural terrestrial processes is actually surprisingly feasible. Modern computers are staggeringly fast, and software simulations, unlike nature, aren’t required to step through the process precisely, raindrop by raindrop and pebble by pebble. By leveraging clever design, aggressive heuristics, and massively-parallel computing, it’s actually possible to simulate effects like hydraulic erosion in real time. And yet, despite this, I found myself gravitating away from a geology-first approach because such methods all share one crucial shortcoming: they are extremely difficult, when not impossible, to control.
Geology-first approaches rely almost entirely on the simulation of naturally stochastic processes. Consequently, they tend to discard information that was present early in the process as their state evolves naturally in relation to itself. For example, if you initialize a geology-first approach with a particular course for a river, the algorithm will begin by placing a river there. However, as erosion displaces sediment and the topography evolves over time, the river will actually change course and “wander away” from the place you told it to be. These shifts can be surprisingly dramatic (I think this behavior is related to the classic “mogul hill” example of mathematical chaos), causing rivers — and other geographical features — to diverge significantly from their starting conditions.
That’s almost indisputably the most true-to-life way to proceed: give priority to the geology, and the hydrology will sort itself out later. But Demiurge isn’t supposed to be true-to-life. It has to be true-to-fiction, and the most important feature of a fictional world is not rocks, but rivers.
Rivers of Narrative
The claim that rivers are the most important feature of a world is definitely arguable, and it only applies to earth-like environs. (Rivers of liquid methane flow on Titan, but I’m not convinced such shores would qualify as beachfront property.) However, for reasonably familiar settings informed by human history, this is the universal factor which determines where civilizations can rise, thrive, and travel.
Every major civilization in human history has lived and died by its access to fresh, potable water. Rivers are of particular value to nascent settlements: they bring clean water in, carry waste and garbage out, water fields, carry cargo, and offer nearly unparalleled opportunities for romantic waterfront dinners, which is important for young cities looking to grow their populations. For these and many other reasons, successful cities tend to arise on rivers that run through fertile lands. Successful cities acquire the allegiance of less successful neighbors, and kingdoms arise.
And so, from a geographical perspective, rivers are (again, arguably) the single most influential factor in the development of a civilization within a locality. This expectation is ingrained so deeply in the common perception that it’s almost as necessary in fiction as it is in reality — sometimes more so, for many readers will reject outright the idea of a city that doesn’t have a stable and plentiful water supply. Moreover, rivers will often factor significantly into the plans and strategies within a setting. Things like borders and trade routes are heavily influenced by rivers, bridges, and fords, and any precise discussion of military maneuvers must take the local river systems into account.
This is not news to anyone, of course: rivers have served as plot points in everything from A Game of Thrones to Into the Wild. I’m only dwelling on it here to emphasize that the placement of rivers in a setting isn’t just an aesthetic choice: it’s narrative. It affects the plot. If you draw a map that says there’s a river in one place, then write a book where characters make decisions based on the location of that river, then that river is a part of your narrative. If a tool like Demiurge then tries to tell you that your river started where you put it, but then it got distracted and went someplace else, then the tool is not just useless, it’s wrong.
Hydrology-First
All the above context and consideration essentially boils down to this: for my purposes, I wanted to be able to explicitly designate the course of certain rivers in a fantasy setting, then have Demiurge postulate plausible details while respecting the exact parameters I put into the system. I read a lot of papers and thought for a long time about ways to accomplish that using a geology-first approach, but without success. Everything I considered could only enforce the input parameters by compromising the integrity of the simulation, at which point I wouldn’t really be doing a simulation anyway.
I only ever found a few papers that tackled terrain generation from a hydrology-first approach — I believe I’ve linked to this one before — and none of them dealt with the exact problem I was facing, which was to build a plausible river system around a sparse hand-crafted input. Nevertheless, once I’d made the decision to take a hydrology-first approach, the obstacles began melting away almost immediately. Because geological decisions are made after the hydrology has been established, I didn’t have to worry that my mountains would move or change my rivers. All I had to do was figure out a way to take my input maps, like the one shown below, and create a plausible river system to “flesh them out.”
But that will be the topic of another blog post.
Whew. This is, what, the third straight Demiurge blog post on nothing but context and theory? True, that is reflective of the amount of time I spent thinking about Demiurge before I ever really got started making it. But that was an exhausting process then, too. However, I’m happy to say that we’re finally over the hurdle of pure theory; next time, starting with the Brownian Tree, we get to move on to practice.
–Murray