I like the way Age of Empires II generate random maps turned out (good variety, decent biome transitions, maps felt random without feeling chaotic), but am struggling to replicate the style. I've attempted using e.g., Perlin noise, but everything comes out either too homogeneous, or if not, the Perlin value -> terrain heuristics are too sensitive and fragile to make a variety of world types.
I remember the AoE2 map type "The Unknown" advertised "100,000 possible maps", suggesting some use of seed numbers, but I'm not sure how to use seed numbers to produce the variety I saw.
What algorithms and heuristics could I use to produce random maps that feel like AoE2 random maps?
Edit to be more specific:
Thinking further about my problem, and studying what I like about AoE2's random map engine, I believe my biggest problem is managing the distribution of water and plant life on the map. I now see I've also tied that up in my mind with "biome transitions that make sense", but that's a different problem (though I expect my continued use of Perlin noise will make it tricky to solve).
I've added several AoE2 random maps that highlight what I like about their mapping engine, which my own efforts are failing to reproduce. All screenshots are taken from random map type, "Custom" -> "The Unknown". I did not instruct the game to use specific geographies like archipelagos.
Further below are images from my own map engine. Each pixel corresponds to one AoE2 map tile.
One complication for my project is I want maps to be many, many times larger than AoE2 maps. Thus, whatever engine I use must be able to create the full range of biomes in each map, and not one narrow set of biomes per map, like AoE2 uses.
Age of Empires II maps
Here's an example that features inland lakes and some sort of river-looking things. I like how the map includes a large amount of water scattered about, but that water is still somewhat concentrated - there are large swaths of land that are available for building your empire. You don't have to spend the entire game planning your city around the water.
Here's similar example where the game was smart enough to connect islands with traversable marshes. I can't imagine how a noise-based algorithm would create the marsh there, and only those places. Also, notice how the game created the land such that each player has their own private, large swath of land all to start out with. It didn't create random patches of land, then take a best-guess as to which one would be the least terrible for each player to start on.
I like that this map also makes heavy use of water, but doesn't include many inland lakes. Contrast it with the first image. I like the way AoE2 creates entirely different geographies using the same building blocks. My attempt at using Perlin noise failed here - I either get enormous sprawling oceans that dwarf the land mass, or the Land of 10,000 Lakes. I also found it hard to get both islands and connected continents (think North/South America).
Contrast this image with the one above it. They show that the aridity of a map doesn't depend on the water level. The first image features a map that's nearly devoid of water, yet contains forests and grass. The second image has a moderate amount of water, yet is a desert. I like that that's possible (think having both New Mexico or the Sahara and Costa Rica in your world).
My own maps
I've read in a bunch of places that a good way to build maps is to layer multiple levels of Perlin noise, each representing a different dimension of data. Following popular recommendations, I went with elevation and moisture, selecting terrain types from the Whittaker table here.
I took two perlin maps, quantized the values from each into integers via a simple if perlin_val < x { i=some_int } else if perlin_val < y...
, then mapped the (elevation, moisture) integer pairs to a table of terrain types (e.g., [1,0]-> tropical desert, [1,1] -> grassland). Oceans were included in this system - elevation=0 defined ocean.
There's good variation, and in many ways it feels like a real world, but there are a few problems:
First, there's no pattern to the ocean depths. You'd expect shallow waters near shore and deep waters further out, there's no rhyme or reason as to which is where
Second, all of the water is concentrated in the oceans; there are no lakes or rivers, because Perlin noise doesn't suddenly dip to a lower value in the middle of a continent.
Creating a balance between quantities of each biome is very, very difficult. I attribute this to:
Perlin noise follows a normal distribution, so estimating how to adjust the probability of each dimension mapping is difficult
Trying to balance multiple dimensions is hard - maybe I want more (2,3) so I up the odds of getting (n,3). Well, now I have too much (3,3) and everything looks wrong.
When I zoomed the noise in closely enough to have smooth data, I wasn't getting a very complete sample of Perlin values. So I'd tweak my distributions for the map in front of me, reload a new random map, and get very different results.
I tried to fix the rivers/lakes issue by making water from a third set of Perlin values. A binary water/land decision, then apply all of the above stuff to the land. This makes it drastically easier to control water distribution (still not perfect, but better), but introduces the problem that there are a lot of biome transitions that don't make sense. E.g., inexplicable patches of desert in the midst of lush grassland, snow on the beach, etc. It's also still hard to control proportions of land biomes, for the reasons mentioned above.
Looking at that the above problems, I tried a simpler algorithm that only mapped the Perlin noise to one dimension. I now have an array of terrain types escalating from 0=deep ocean -> 1=shallow ocean -> 2=beach ... -> N=snow. While this yields islands and continents, and makes it far easier to balance the proportion of each terrain, the terrain types are far too clustered. Every land mass looks like an elevation map, generally without terrain types scattered across its surface. Every land mass has approximately the same features, always in the same order, and always in the same ring-like shape.