Tuesday, February 5, 2019

Finishing off the global map

We're almost done with the global map. This seems odd to me, as the process of bashing all of this into shape was much longer and involved far more dead ends than this brief account might suggest, but that's programming - especially when done by someone like me.

There are a couple of final things to do. One is rift lakes. These are lakes, like Baikal in Russia or the Rift Valley lakes in Africa, where a river runs through a rift (caused by tectonic plates pulling apart) and makes a long, deep lake. The lake-creating function described in the previous post doesn't generally produce lakes like this, but I wanted to have them all the same.

They proved trickier than I anticipated. The process I developed of drawing lakes on the regional map (more on that later) didn't translate well to long, thin lakes of this kind. Eventually I hit upon a completely different method of making them: they are basically wide, deep sections of river.

That's fairly easy to do on the global map. I just needed to make yet another new global array, this time storing surface level (and also bed height) for rift lakes. (For normal lakes, the bed height is simply the height of the terrain at that point. I found with rift lakes that, because they are narrow and very deep, this led to weird artefacts in the regional map; so I left the terrain alone and stored an extra value for the bed height.) The lakes are made fairly straightforwardly by choosing a starting point on a river and moving downstream for a bit, marking out rift lake on the way. Also, where there is one rift lake there may well be others, further down the rift, as in the African lakes. So UW may also move further down the river and make more. You can see some of them here, like strings of sausages along a couple of the rivers:



I probably have too many of them, but I do rather like them. Then of course there's messing about with rivers. With these lakes, there can't be multiple rivers coming out of them, because they are only a tile wide. But there may be other rivers running parallel to them, which again causes problems on the regional map because those rivers could end up going in and out of the rift lake. So we need to divert all neighbouring rivers into the rift lakes, make the appropriate changes to the outflow, and so on as before.

The other thing to do is to make the relief map. The program already displays maps for terrain, wind, temperature, precipitation, climate, and river systems, but it's nice to have an image that looks as much like a real map as possible, combining some elements from all of these. So UW creates an image where each pixel of terrain has a colour determined by elevation, temperature, and precipitation, plus a little bit of random variation to make the texture more interesting. Rivers aren't shown on this map (it would be too busy) but lakes are. Permanent sea ice is shown, but not seasonal sea ice. And we add some shading to indicate slopes: any areas sloping down towards the north and west are shaded darker, and any sloping the other way are shaded lighter, to make it look like the light is coming from the southeast. This can really make the mountains pop, and also the continents themselves as the areas near the coast tend to be quite a bit lower than the interiors (we have Mssrs Planchon and Darboux to thank for that - I'm not sure it's totally realistic but it isn't dramatic enough to make the terrain seem too weird and I rather like the effect it has on the coasts of the relief map).

So here's the final relief map for the world we've been looking at:



There are still some issues here, notably that vertical line going up through the middle of the southern continent. That's where the edge of the map was when UW originally made the terrain, before shifting it to avoid having too much land at the edges. For some reason it tends to leave this artefact and I haven't managed to get rid of it yet, but it's on the to-do list.

Other features have yet to be added. I want to add salt lakes, for example. These will be like the main kind of lake, but (a) appearing in arid regions, and (b) having no outflow. Hopefully this will mostly be a matter of repurposing code I've already got, but I've learned by now not to entertain such hopes too strongly. And there are all sorts of other things to add along the way, or tweak.

So at the point we've reached, Undiscovered Worlds is quite a nice little global map generator. It can produce a vast range of these maps, some with large continents (like this one), some with smaller or fewer; some with many islands, some without; some with masses of large lakes, some with very few. Each one is based on a particular seed number for the random number generator, so one can always record the seeds of interesting worlds and generate them again another time. UW can also save maps and load them in to avoid having to regenerate them all the time.

But I think it's at the regional map level where it gets more interesting, because there we can examine the world's features - its coastlines, rivers, mountains, and lakes - in much more detail. Creating that detail, however, is easier said than done. So that's what I'll start looking at in the next post.

4 comments:

  1. Interesting to me that you're going from a global map to a regional map, and I'm going the other way. Your way is probably more sensible, tbh.

    ReplyDelete
    Replies
    1. They both have their advantages and disadvantages. My way allows, at least in theory, to have a really huge world without having to create too much detail at the start, because you don't have to generate all the regional maps for the whole world. On the other hand, extrapolating extra details from an existing larger map to create a smaller-scale one has all kinds of problems of its own, and is quite unnatural. Your way is a more natural fit with reality because in the real world large things only exist because small things already exist, rather than vice versa. But I'll wax more lyrical about all this in my next post.

      Delete
  2. Utterly beautiful.

    How do you determine your icecaps?

    ReplyDelete
    Replies
    1. Thanks! I talked about the sea ice here - https://undiscoveredworlds.blogspot.com/2019/02/getting-climactic.html - it's basically a combination of temperature, proximity to land, and randomness. On land it's easier because there it's just temperature.

      Delete