Saturday, February 16, 2019

Regional climates

Now we have the terrain sorted for the regional map, it's fairly straightforward to do its climate too.

We already have precipitation calculated for the global map. So we can just adapt the diamond-square algorithm that we used for regional terrain to precipitation. Here's a random area of terrain:


And here's the precipitation map:


You can see how it looks roughly right, with the mountains casting a clear rain shadow to the east. (I think that patch of rain in the south is something to do with the mountains being rather lower there, but if not, it's undoubtedly some complex set of local conditions and definitely not an awful glitch in my climate algorithms.)

Temperature is tougher, for two reasons. First, the range of possible temperatures is much smaller than the range of possible precipitation amounts. That makes it hard to use the diamond-square method to get smooth gradients. The solution: multiply the temperatures by a constant, to make them all much higher (or lower, if below 0). Then run the diamond-square method. Then divide them all back again. This sounds clumsy but it does work.

The second reason it's tougher is that temperature is affected by altitude, and we want it to reflect the terrain on the regional map properly. That means we can't just blur a global-level temperature map, which is what the diamond-square method is effectively doing. The solution: remove the elevation element of the temperatures. Then run the diamond-square method. Then go over the whole regional map and add the elevation element back in. The result:


You can see that the temperatures are properly lowered precisely where the mountain ridges and peaks are, but not in the valleys, rather than being generally lower over the whole mountain area.

Now we have temperatures and precipitation for the regional map, we can easily produce a climate map using that information:


And we can also produce a relief map, using exactly the same methods as for the global map, which hopefully looks a bit more pleasing to the eye:


Finally, sea ice. This is sorted in much the same way as temperature. There are only three possible values for sea ice (none, seasonal, and permanent), so a fair bit of clever tinkering is needed to make this work with the diamond-square method, but it does. Here's the transition between permanent and seasonal ice near the North Pole:


There are a few annoying little artefacts there, which I haven't got round to dealing with yet, but generally this works fairly decently.

No comments:

Post a Comment