# How can I get old Minecraft style terrain biome selection?

I'm using this post as a reference for what I'm doing.

The real thing of interest is this:

As you can see, this is a Whittaker diagram, with temperature and rain considerations.

So would this be the algorithm he uses?

def rain(x,z):
return some_fbm_perlin_noise(x,z)
def temp(x,z):
return some_fbm_perlin_noise(x,z)
def biome_at_point(x,z):
return diagram_at_point(rain(x,z),temp(x,z))


The issue with this is that if I assume the fbm perlin noise to be in the range [0,1] for both of them, then this algorithm only covers the bottom left half of the diagram. What is the top right half?

And also, perlin noise tends to make "short forays" into extreme ([0.9,1.0]) values, so the smaller, rarer biomes would have little tiny dots scattered around the map. An example would be the tundra: the tundra is very rare, and when it happens it probably only happens for a small area. But what actually happens in Minecraft is that the smaller, rarer biomes are very rarely come across, but they still have a normal size.

I've tried something like this:

def rain(x,z):
return hash(nearest_voronoi_point(x,z))
def temp(x,z):
return hash(nearest_voronoi_point(x,z))


But this runs into the triangle problem, and a new one: the hash function, by definition, is incoherent, which means that it could put a desert next to a snowy mountain, because there are no constraints.

How does can I fill in the final triangle and not half tiny biomes everywhere, while maintaining biome coherency?

• It looks like the following post may answer the question: minecraftforum.net/forums/archive/alpha/… You could also use MCP on an old version and try to unravel the source. IIRC more recent versions use a subdivision method instead. – stewbasic Apr 29 at 23:40
• Thanks for the link, but in the diagram provided (i.imgur.com/Nlbcl.jpg) has absolutely tiny areas for Desert, Plains, Seasonal Forest and Rainforest, where 3 of these 4 biomes are the most common in the game. I can't see how anyone would skew the distribution that far. – mackycheese21 Apr 30 at 3:24
• This is another example of the "triangle problem" btw: i.stack.imgur.com/da7Kt.png – mackycheese21 Apr 30 at 3:26
• For my project (not Minecraft related), instead of using 0-1 for rainfall, I used 0-1 to represent fraction of maximum allowed rainfall. This turns the triangle into a square. – amitp Apr 30 at 16:35
• What is the top right half? Uninhabitable super-frigid wastelands that rain ammonia. – Draco18s Apr 30 at 17:01

What is the top right half?

That part is omitted because under normal Earth environments, it's not observed to happen. Consider the following:

Note that in the coldest (polar) regions, the precipitation is minimal - it has been forced out of the air currents prior to arrival.

How does can I fill in the final triangle...

The short answer is that you either should not because it represents conditions that shouldn't occur. If for the purposes of implementation you must fill it, I recommend filling it with some sort of reserved sentinel value (like a biome with purple trees) so that it if does occur, it's immediately obvious that something went wrong.

And also, Perlin noise tends to make "short forays" into extreme ([0.9,1.0]) values, so the smaller, rarer biomes would have little tiny dots scattered around the map. An example would be the tundra: the tundra is very rare, and when it happens it probably only happens for a small area. But what actually happens in Minecraft is that the smaller, rarer biomes are very rarely come across, but they still have a normal size.

This is correct. There are two ways I know of to deal with this. On solution is to perform histogram equalization; basically you feed the noise output into another function that attempts to "flatten it out". While straight forward I've not had great success with this approach, probably because it incorrectly assumes that Perlin noise is a correct model for temperature distribution.

In my experience, a better approach is to use Perlin noise to skew the expected values for a region. On a planet with Earth like conditions, the polar regions are cold & the equatorial regions are hot. But there's also some bit of variety. To model this, normalize your Perlin noise to some acceptable temperature swing range, say +- 20 degree and then use that skew the expected temperature of a region hotter or colder. Here's an illustration that also takes elevation into consideration (since extreme elevations are cold):

Note: that image is from this excellent write up on procedural generation which covers this idea in greater depth.

it could put a desert next to a snowy mountain, because there are no constraints

Your observation is correct. By itself, a Whittaker diagram cannot produce biome distributions & adjacencies that match Earth based expectations because it doesn't model enough of the feature constraints. Taken another way, the Wittaker diagram only describes that when X temperature combines with Y precipitation Z biome region forms. It does not describe why or how any two combinations of X & Y would be brought together. To model these constraints, you need to use additional models / techniques such as those previously mentioned.

• Thanks! This clears it up for me pretty well. I'll try histogram equalization, it seems to be exactly what I want. – mackycheese21 Apr 30 at 18:17