Page 1 of 1

[mapgen] custom biome system - generating and implementing a heatmap?

Posted: Sun Aug 02, 2020 01:28
by PolySaken
I'm working on a map generator for a game I'm making, and I am using a custom biome system since biomes don't exist in singlenode worlds. Almost everything is working:
- the biomes are registering properly
- the generator is getting node data from the biome
- the terrain is being generated correctly
However, I can't figure out how to implement biome distribution. My current system just uses one hardcoded biome, but I'd like to have biomes distributed based on temperature and moisture, looking something like this:
Image
where the greener areas are wet, the yellow/brown is dry, and the white is cold.
Does anyone know how I could achieve this in minetest?
(temperature and moisture should both be from 0-100)

Re: [mapgen] custom biome system - generating and implementing a heatmap?

Posted: Sun Aug 02, 2020 05:51
by Skamiz Kazzarch
Do you mean the image as a distribution over the whole world?
in that case it would be something like:

Code: Select all

-- given a position x, y
humidity = ((x/distance_to_world_edge) + 1) * 50
temperature = (math.cos((y * pi * 5.5) / distance_to_world_edge) + 1) * 50
i think.
#untestedCode

Re: [mapgen] custom biome system - generating and implementing a heatmap?

Posted: Mon Aug 03, 2020 00:20
by PolySaken
It's similar, I might end up adapting it a little bit if I do use it. I think I'd rather have it wrap in both axes if possible, like this map from a Minecraft modpack.

Re: [mapgen] custom biome system - generating and implementing a heatmap?

Posted: Mon Aug 03, 2020 12:40
by Skamiz Kazzarch
That looks like a cool concept. That way you don't have to relly on luck to find a specific biome, but can instead systematicaly search for it.

You should be able to reuse the same calcultaion as for the temperature. Also replace the 5.5 by how ever many times you want it to repeat the patern acros the map.

Re: [mapgen] custom biome system - generating and implementing a heatmap?

Posted: Mon Aug 03, 2020 21:27
by PolySaken
Cool, thanks!