In the last @Allie stream, she talked and guided us through some early concepts of sub biomes, small pieces of land that stand out from the rest of the biome, like the below example of an oasis for a desert.
I want to talk about this from a implementation point of view. Consider this more of a suggestion than anything else.
One way I imagined this is using noise maps.
The biome generation file would have a section where noise parameters are set, and a link to another biome generation file.
Something like this for its json:
"sub_biome":{
"noise_map_settings": {
"octaves": 3,
"persistence_ratio": 0.1,
"bandlimit": 2,
"aspect_ratio": 1
},
"generation_file": "file(oasis_generation_data.json)"
}
When the game loads the files and starts creating the world, it will do only in the portion of the world not affected by the noise, and when it finishes, it will load the second biome that was linked in it and fill the gaps with it.
For a visualization of the above:
The main biome is generated as usual, using its main generation file:
Then, the biome gets the noise set for the sub biome. A noise map can be visualized as a black and white “cloud” image, where dark areas has a meaning and white has another. Lakes, trees, plants, are all generated this way. For trees, it will place trees one the areas that are dark and not on white areas.
Here we force it to pure black and white with no gray between for easier use and visualization:
The sub biome is loaded and generated from the linked generation file:
But only for the black areas of the noise:
>
Resulting in this:
>
Of course, a temperate biome inside the desert doesn’t make sense, it was just so I had a visual representation to show the example working. It should be a proper “oasis” biome with the correct features of such a biome.
This would be extremely powerful, specially if there is some recursion in it. Like a biome call another as a sub-biome which could call another as its own sub-biome. Such as A containing B that contains C