Tuesday, September 21, 2010

Random Map Generator - Elevations

About the same time that I was deciding to use the Voronezh Oblast as a start for my campaign (see previous post), I was playing around with a system for the random creation of topography.  Initially, the first map I did for the County of Voronezh included some of this system ... but then I came across the data on falling rain and didn't have to rely on random generation.

However, I thought I'd include this idea here, because it may be of use to some people.  The idea for it came to me literally before falling asleep at night - I do much of my thinking in the dark - and it works something like this.

Suppose we begin with a single hex, and we set the lowest elevation for that hex at a given number.  We use the 'lowest' because it becomes relevant later on.  The starting elevation can be anything from zero (sea level) to, well, whatever number above sea level you'd like.  Tibet averages between 16,000 and 19,000 feet above sea level, for reference.  For the purpose of this example, we'll start with a nice round number: 3,000 ft.

(I use imperial for D&D because it seems more folksy.  You can use metric if you'd like)

We then mark our center hex as 3,000.  We're going to determine the elevation of the adjacent hexes using 6d6 ... which gives an average overall of 21.  You don't have to use 6d6 ... 4d6 or 2d6 will do as well, but I prefer a greater number of dice because it allows for more variation while maintaining a strong bell-curve average.  You'll see what I mean as we go forward.

If a '21' is rolled on 6d6, then the elevation of the adjacent hex being determined is the same as the origin hex.  For each number above 21, the elevation increases.  For each number below 21, the elevation decreases.  The amount of the increase/decrease is up to you.  It can be quite a lot, anywhere from 400 to 1000 ft. per point above or below 21 ... or it can be very little, like 5 ft. per point.  The former will give you wildly varying terrain, like mountains; the latter will give you a flat plain.  But the jist of it is that if, say, you designate the change to be 250 ft. a point (which I will use), and you roll a '24', the next hex over will be 750 ft. higher than the origin hex.  24 is three points above 21.

All right then, let's generate the six hexes around the first.


There, nothing complicated.  We have three hexes with a higher elevation (B,D,G), and three hexes with a lower elevation (C,E,F).  You will note that I've added a blue arrow that points from A(elevation 3000) to C (elevation 2250).  This is meant to indicate drainage.  As a rule of thumb, wherever three higher hexes surround a lower hex - as we have here, as A is surrounded by the three higher hexes, B, D and G - then that hex becomes a 'source hex' for the formation of a creek.  The direction of the creek is then designated to flow into any other hex which is lower than the source hex.  I rolled randomly, and found that it flowed into hex C.

Typically, I like to apply this system so that the creek flows into the lowest adjacent hex ... but in this case that is both C and F.  However, there's no real reason why it can't flow into hex E, or even into hex E and then into F.  But for this table we'll have it flow the direction as indicated.

You can see already that you have a feel for the origin hex, A, even though all we have are a group of numbers.  We can put into the hex anything we like, from a city to a town to a small cluster of houses.  Even one lone farmhouse ... whatever works as an origin for your players.  We can make the hex as wide as we want, too - this hex could have a diameter of one mile or twenty miles.  Obviously, if it is a 1-mile hex, then G is an imposing mountain, looming over the players.  If it is a 5 mile hex, G becomes a high group of hills, dominating the northwest.  Remember that the elevation noted for G, 4,750, is the lowest elevation of that hex ... the highest elevation could then be determined separately, rolling 6d6 again and determining the highest elevation as 250 times the deviation from '21', either positive or negative ... and if a '21' is rolled, then G becomes a bluff, a high plateau overlooking the valley, even a gigantic mesa if it turns out that this hex is higher than all those around it.

Moreover, the origin hex is a kind of 'pass' between the heights of G & B on the one side, and D on the other.  Travellers would thus move over the hump from F to C, passing through A, making A a chokepoint between the SW and the NE.  It would be a natural place for a fort or larger military outpost, not to mention a meaningful trading gap and tax & toll generating opportunity for whoever rules over this place.

Let's extend our small world then, by following the river out of hex C.  This hex now becomes the origin hex for H, I and J.  Before I show the increased map, I want to throw in a curve ball.  We want our mountainous region to spread out into plains (because that's what happens), but we don't want to keep things as random as possible.  Our elevation deviation was formerly 250, which is 1/12th of the origin hex's elevation of 3000.  For these next three hexes, let's use 1/12th of 2250, which is 187.5, or 188 ft. per point.

Also, one of the three hexes being generated must be equal to or lower in elevation than our origin hex, as the river must go someplace ... so let's roll randomly, 1, 2 or 3.  I get hex J, so for that hex, the change is the deviation from '21', whether higher or lower.  Bringing the gentle reader into the equation, I'll reveal here that my three 6d6 rolls were 20, 22 and 22 ... which gives results as follows:

Hex J, you'll notice, deviates 1 from 21 and is therefore 188 ft. lower, exactly as hex H.

I'm adding something else to the above map.  You will notice a blue text-box in both the A and C hexes.  This is the relative flow of the stream.  As an ad hoc rule, I tend to think of it as equal (in a 5-mile hex) to 5 cubic feet per second per point.  Thus, as an example, the 9-mile-long Woodbridge Brook in England has a flow of 20.5 cubic feet per second.  I've never seen Woodbridge Brook, but this is the idea.  If these were 10 mile hexes, then they would be equal to 20 cub.ft. per second per point.  A higher rate than the aforementioned example, but that brook is down by the sea, while this water course is in the mountains.

The point system is assigned by the number of adjacent hexes which are higher that the river hex.  Thus, B, D and G are higher than hex A, giving the stream 3 points.  As well, B, D and I are higher than hex C, adding 3 more points.  Note that both B and D are able to add two points to the stream ... this representing water runoff coming from two different points of those hexes.  A central, high hex is able to generate up to six points of water overall.

We still have little more than a group of numbers, but the overall terrain is starting to assert itself.  Let's add more detail.  We can do so by going in any direction ... but I use a rule-of-thumb that I generate all the hexes outwards in a widening circle, in the order of 1) the river hexes; 2) the lowest non-river hexes; and 3) the remaining hexes.  Thus, before I can determine H, I will do F, E, D, B and G, in that order.  Mind you, there's nothing that says I can't work off G first, or H, or follow the river J until it literally reaches the sea.  If I work consistently on the highest hexes, I'm likely to get a more topographically varied map.  And if I follow the river all the way to the sea, I'm going to have to keep calculating the flow over and over, as other rivers will be found to flow into it as I go.

For example, let's say the three hexes around H are all higher.  In that case, H becomes a source hex (with 5 river points), which has nowhere to flow except into C.  The second source would then increase the river's flow in hex C to 8 (5+3), so that it would quickly become a fair stream.

One of the interesting and annoying things about this system is that as you go, you have to keep reassessing the rivers ... but nothing is perfect.  It is for this point that I prefer to widen out from a specific location.

So let's add from hex F.  Before I do that, let me ask, what if the other three hexes above F are all higher than 2250?

Noting that this doesn't occur in topography (depressions right next to river sources), there are a couple of choices.  One, the hex could be raised to the level of A, and used as the actual source for the river flowing into J.  Two, one of the new randomly generated hexes could be determined as the necessary outflow to F.  Three, the bottom of F is the depth of an existing lake, while the surface of the lake is even with hex A (this being my favorite).  Or four, this is D&D and so what?  Hex F then becomes a deep, swamp-filled depression, full of ghoolie monsters.  In any case, three of those options force a considerable rethink on the status of the former pass that we designated for hex A, right?

Like I say, more information tends to change things around.  Let's generate and find out what happens (remember, 1/12th of 2250 still gives us a change of 188 ft. per point).  On 6d6 I roll 23, 23 and 14.  Note that I've lettered the hexes in clockwise order:

Well, that drop-off into hex M is startling, isn't it?  I'm not muffing these rolls as I go along, I'm just making them to see what happens and then explaining each element.  There's room for plenty of strangeness, such as having that marvellous 934 elevation hex M right next to G's 4,750.  Turns out the gap at A appears to be pretty significant, and an excellent place for a town.  Of course, hex E suggests that it too could become a river source (if both one higher and one lower hex is generated) ... which would make A, E and F a comfortable little plateau, even the start of a Barony or a County, depending on the width of the hexes.

The terrific drop into hex M could mean waterfalls along the course from hex F, and would also mean that the sea could be potentially close ... although the system I'm using the elevation change for adjacent hexes from M would only be 78 ft.  You can see from this map how it makes a big difference whether M or G is used next to determine the next hex over.

Of course, you can use an average of adjacent hexes to determine future hexes, but I have found that tends to flatten the map, and thus reduce the potential for significant features.

I think I'll stop here.  I could go on with the determination of hex E, but I've made enough of my point here to get you, the reader, experimenting.  Let me know what problems turn up, and I'll try to give suggestions for how they could be solved.

As I've been saying, remember - these are only numbers.  But they suggest where to put the little bits of civilization, what hexes would be logical for shrines or dungeons, how the farmland might spread outwards or where you would plant orchards as opposed to cereals.  Contours are only numbers ... and in mapmaking, elevation is king.

9 comments:

PatrickW said...

This will be most helpful. I have a mountain range my players will eventually run across and this will make the mountains much more interesting.

KenHR said...

Neat system. This could turn out to be very useful for my games. Thanks for sharing, as always.

DrDucker said...

This is really nice.

Did you create a process for subdividing?

Alexis said...

I haven't, actually. But a system for doing so springs to mind. By choosing a number between 6 to 21 as the baseline for the hex, and assigning an elevation variance per point of die, other elevations in the hex could then be determined. Starting at the subdivided hex whereat the river in the hex exits (which would be the lowest point), calculate the remaining hex from there.

Note that with the subdivision, more branches of rivers would be evident (and creeks would occur where none were evident before). The cubic flow calculation for rivers would also have to reflect the smaller scale (remember, geometrically).

Other effects could be worked out similarly.

theorder said...

By the way, do you know Dwarf Fortress? What do you think of its random map generator?

Alexis said...

I have no familiarity with Dwarf Fortress.

PatrickW said...

Using this method, I get some odd results at the water line that will need some work to justify (I think).

Once the eleveation gets down below 18, the elevation changes are in 1-foot increments, so getting to zero stretches out. Similarly, once you go below zero, it takes a while to get depths of any significance. BUT, it is possible to suddenly drop well below zero from heights over 100 ft if you roll very high while following a river.

Using 3 mile hexes, I have an area 12-15 miles across where the lowest elevationpoint varies from 0 to -10 feet. I think the solution here is a large river delta/swamp.

I also have some hexes with elevations above 75 feet (with a river even) adjacent to ones with -32 feet. This happened following the process of determining which hex a river flows to (using an absolute value of the dice to determine a lower elevation) and then having an adjacent hex naturally roll an significantly (one might say freakishly) lower elevation. In this case, would you stick with the originally determined river direction or switch to the newer, lower path?

Alexis said...

A few recommendations.

You could set a minimum elevation change at 2 ft. per point or more, if you don't want wide floodplains. But I would point out that floodplains do tend to be very wide. For example, at one point 1,200 miles from the sea, the river Ob has an elevation of only 100 feet above sea level.

Alternately, parts of the coast of Turkey are so severe that the land drops from an elevation of 2-3 thousand feet to sea level, to 300 feet below sea level in a distance of less than 1 mile. Arica, Chile, is 12 miles by road from the sea and higher than 12,000 ft. above sea level ... and the sea drops to below 24,000 feet deep ten miles off the coast in the Peruvian Trench.

So feel free to play around with the numbers however you see fit. Different standards that you set will produce different topographical environments.

PatrickW said...

Good points and things I will likely include (especially the minimum elevation change). I'm pleased with my results so far - they will provide greater verisimilitude for my mountains (once the players actually reach them) than I would have been able to do without them.

I think I need to stop generating elevations now and go back and draw in the actual terrain or at least start color-coding the hexes so I can see what I have better. This will help me wrap my brain around the terrain better.

Generation of river paths has been very satisfactory and has created the "leaf veins" look that actual watersheds have.

After I finish working this up as a proper map, I want to start over again using 4d6 instead of 6d6 to compare generated terrain. 4d6 should work well for hills (as opposed to mountains) or at least that is my expectation. I should also go back and roll 2d6 for the plains areas the PCs have adventured in already to generate realistic rivers.

Now if only I could take time off from the DayJob and still get paid while doing all this...