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

Post Reply
User avatar
PolySaken
Member
Posts: 631
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

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

by PolySaken » Post

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)
Attachments
Screenshot from 2020-08-02 13-24-03.png
(2.7 KiB) Not downloaded yet

Skamiz Kazzarch
Member
Posts: 162
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

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

by Skamiz Kazzarch » Post

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

User avatar
PolySaken
Member
Posts: 631
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

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

by PolySaken » Post

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.

Skamiz Kazzarch
Member
Posts: 162
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

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

by Skamiz Kazzarch » Post

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.

User avatar
PolySaken
Member
Posts: 631
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

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

by PolySaken » Post

Cool, thanks!

Post Reply

Who is online

Users browsing this forum: GreenXenith and 1 guest