I've started playing about with the biome algorithm and figured I'd make a topic here where I can, hopefully, answer any questions people may have about how they are created and what changes can be made to it to get certain results.
(Here's my biome mod for those interested in altering biome parameters. It's very early on, so not much you can do with it right now, but I plan on adding to it.)
First off, here's the biome distribution by temperature and precipitation as it is currently found in the game:
Here's how the biomes should be distributed with the correction to the biome mapping algorithm. It's also done to twice the resolution as the above
There are 11 biomes in the code (not counting "hell"), but only 10 are used. I do not know if this is an error on Notch's part or an intentional omission due to some (unresolved) issue. The following is the pseudocode for the biome selection algorithm. This does not include the algorithm that feeds into this one that generates the temperature and precipitation values. This is only ever called once to create a mapping of precipitation and temperature to biome type. The live creation of biomes take place in another class (pb.class) using another algorithm.
BiomeSelector(float temperature, float precipitation) {
precipitation = precipitation * temperature;
if (temperature < 0.1)
return "Tundra";
if (precipitation < 0.2) {
if (temperature < 0.5)
return "Tundra";
if (temperature < 0.95)
return "Savanna";
return "Desert";
}
if ((precipication > 0.5) && (temperature < 0.7))
return "Swampland";
if (temperature < 0.5)
return "Taiga";
if (temperature < 0.97) {
if (precipitation < 0.35)
return "Shrubland";
return "Forest";
}
if (precipitation < 0.45)
return "Plains";
if (precipitation < 0.9)
return "Seasonal Forest";
return "Rainforest";
}
You'll notice that "Tundra" is listed twice. The second time it is listed is correct, but the first time should return "Ice Desert" instead.
Something interesting to note about biome characteristics is that Notch made three biome classes, but only uses one right now. The other two are empty and simply extend the one that is being used. He has the biomes organized as follows:
Biome class 1:
Rainforest
Seasonal Forest
Forest
Shrubland
Taiga
Tundra
Biome class 2:
Savanna
Desert
Plains
Ice Desert
Biome class 3:
Swampland
The above selection algorithm can be modified in any way to alter distribution, limit the biome types, or always have it return just one type of biome. Example, desert only:
There is a couple of lines of code in mu.class that can be altered to affect the size of biomes. Raw code below
will directly affect biome sizes. The smaller the value the smaller the biomes and, alternately, the larger the value the larger the biomes. Below is an example of changing the divisors to 0.01.
Here's screenshots of each of the biome types when they are forced spawned by modifying the moisture and temperature. There may be some oddities with snow and geography that's not being controlled by what I am modifying, but here they are.
Tundra
Ice Desert
Taiga
Savanna
Shrubland
Forest
Swampland
Desert
Plains
Seasonal Forest
Rainforest
I believe I've found some code that controls geography. If it is, then it seems that biomes, and thereby moisture and temperature, directly affect geography. I'll test it more tonight and report back what I find.
You'll notice that "Tundra" is listed twice. The first time it is listed is correct, but the second time should return "Ice Desert" instead. Correcting this would cause the "Tundra" section of the distribution graph to be reduced to a small, flat section at the very bottom and the remainder would become "Ice Desert".
Tundra is, essentially, a cold desert. What kind of surprises me is how far up the "temperature" axis it extends, and would explain why snowy regions are so common; it seems about 35% of the world is tundra. Good information.
You'll notice that "Tundra" is listed twice. The first time it is listed is correct, but the second time should return "Ice Desert" instead. Correcting this would cause the "Tundra" section of the distribution graph to be reduced to a small, flat section at the very bottom and the remainder would become "Ice Desert".
Tundra is, essentially, a cold desert. What kind of surprises me is how far up the "temperature" axis it extends, and would explain why snowy regions are so common; it seems about 35% of the world is tundra. Good information.
Actually, they are quite different. I forced spawned each and here's what I got:
No wonder it was so hard for me to find a desert in my new game.
So what characteristics do the Rain Forests have, seeing as you've seen the code. I don't think I've seen one yet and by the looks of your mapping, it will be difficult to see one anyway.
No wonder it was so hard for me to find a desert in my new game.
So what characteristics do the Rain Forests have, seeing as you've seen the code. I don't think I've seen one yet and by the looks of your mapping, it will be difficult to see one anyway.
Characteristics? Do you mean the temperature and precipitation/moisture characteristics that causes them to "spawn"? If so, then the precipitation must be greater than or equal to 0.90 and the temperature must be 0.98 or higher. Maximum values are 1.0 so there isn't a lot of space left for rainforests to spawn in according to the algorithm.
Something interesting to note about biome characteristics, though, is that Notch made three biome classes, but only uses one right now. The other two are empty and simply extend the one that is being used. He has the biomes organized as follows:
Biome class 1:
Rainforest
Seasonal Forest
Forest
Shrubland
Taiga
Tundra
Force every Biome into a Chunk of a Map and post pictures so we can identify the differences. Put a Tree or 2 in there also
The issue I am running into with forcing biomes is that the coloring of the grass and leaves is affected by a different algorithm. So I can force spawn a rainforest, but it'll be brownish looking because it's in an area with low temperature and/or precipitation. I'll have to see if I can track down what's generating the original values for temperature and precipitation so I can force biomes that way instead.
Not so much the numbers in the code as how trees spawn and such. More like, how would I know I'm in a Rainforest Biome if I stumbled into one in the game?
Not so much the numbers in the code as how trees spawn and such. More like, how would I know I'm in a Rainforest Biome if I stumbled into one in the game?
Once I figure out how to properly modify the moisture and temperature values I will force each biome individually and post a comparison of each.
This is just plain awesome. Thank you so much for finding this. Now someone can make a biome mod and everyone can shut up about biomes being "too small" or "ugly".
How does one edit the .class files? I take it I have to download a decompiler program? If so, how would i recompile? (Sorry I'm not familiar with Java)
(Here's my biome mod for those interested in altering biome parameters. It's very early on, so not much you can do with it right now, but I plan on adding to it.)
First off, here's the biome distribution by temperature and precipitation as it is currently found in the game:
Here's how the biomes should be distributed with the correction to the biome mapping algorithm. It's also done to twice the resolution as the above
There are 11 biomes in the code (not counting "hell"), but only 10 are used. I do not know if this is an error on Notch's part or an intentional omission due to some (unresolved) issue. The following is the pseudocode for the biome selection algorithm. This does not include the algorithm that feeds into this one that generates the temperature and precipitation values. This is only ever called once to create a mapping of precipitation and temperature to biome type. The live creation of biomes take place in another class (pb.class) using another algorithm.
You'll notice that "Tundra" is listed twice. The second time it is listed is correct, but the first time should return "Ice Desert" instead.
Something interesting to note about biome characteristics is that Notch made three biome classes, but only uses one right now. The other two are empty and simply extend the one that is being used. He has the biomes organized as follows:
Biome class 1:
Rainforest
Seasonal Forest
Forest
Shrubland
Taiga
Tundra
Biome class 2:
Savanna
Desert
Plains
Ice Desert
Biome class 3:
Swampland
The above selection algorithm can be modified in any way to alter distribution, limit the biome types, or always have it return just one type of biome. Example, desert only:
There is a couple of lines of code in mu.class that can be altered to affect the size of biomes. Raw code below
Changing the divisors for the following two lines
will directly affect biome sizes. The smaller the value the smaller the biomes and, alternately, the larger the value the larger the biomes. Below is an example of changing the divisors to 0.01.
Here's screenshots of each of the biome types when they are forced spawned by modifying the moisture and temperature. There may be some oddities with snow and geography that's not being controlled by what I am modifying, but here they are.
Tundra
Ice Desert
Taiga
Savanna
Shrubland
Forest
Swampland
Desert
Plains
Seasonal Forest
Rainforest
I believe I've found some code that controls geography. If it is, then it seems that biomes, and thereby moisture and temperature, directly affect geography. I'll test it more tonight and report back what I find.
Tundra is, essentially, a cold desert. What kind of surprises me is how far up the "temperature" axis it extends, and would explain why snowy regions are so common; it seems about 35% of the world is tundra. Good information.
Actually, they are quite different. I forced spawned each and here's what I got:
Tundra
Ice Desert
So what characteristics do the Rain Forests have, seeing as you've seen the code. I don't think I've seen one yet and by the looks of your mapping, it will be difficult to see one anyway.
http://www.minecraftforum.net/viewtopic.php?f=35&t=73860
GENERATION 19: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.
Characteristics? Do you mean the temperature and precipitation/moisture characteristics that causes them to "spawn"? If so, then the precipitation must be greater than or equal to 0.90 and the temperature must be 0.98 or higher. Maximum values are 1.0 so there isn't a lot of space left for rainforests to spawn in according to the algorithm.
Something interesting to note about biome characteristics, though, is that Notch made three biome classes, but only uses one right now. The other two are empty and simply extend the one that is being used. He has the biomes organized as follows:
Biome class 1:
Rainforest
Seasonal Forest
Forest
Shrubland
Taiga
Tundra
Biome class 2:
Savanna
Desert
Plains
Ice Desert
Biome class 3:
Swampland
The issue I am running into with forcing biomes is that the coloring of the grass and leaves is affected by a different algorithm. So I can force spawn a rainforest, but it'll be brownish looking because it's in an area with low temperature and/or precipitation. I'll have to see if I can track down what's generating the original values for temperature and precipitation so I can force biomes that way instead.
Once I figure out how to properly modify the moisture and temperature values I will force each biome individually and post a comparison of each.
If This post was interesting/helpful, click that (+) on the bottom right! --->
I seconds this.
This would be so much fun.
My Pathfinder Campaign for the denizens of MCF: http://www.minecraftforum.net/topic/1939035-where-are-we-sandbox-pathfinder-campaign-ooc/
My Noteblock Song - The Moon
http://www.piggyspage.com
PM me suggestions/thoughts about the site.
(Basically a place to quickly access your most-visited sites)