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:
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)
[mapgen] custom biome system - generating and implementing a heatmap?
- PolySaken
- Member
- Posts: 817
- 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?
- Attachments
-
- Screenshot from 2020-08-02 13-24-03.png (2.7 KiB) Viewed 297 times
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.
- Skamiz Kazzarch
- Member
- Posts: 619
- 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?
Do you mean the image as a distribution over the whole world?
in that case it would be something like:
i think.
#untestedCode
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
#untestedCode
- PolySaken
- Member
- Posts: 817
- 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?
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.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.
- Skamiz Kazzarch
- Member
- Posts: 619
- 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?
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.
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.
- PolySaken
- Member
- Posts: 817
- 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?
Cool, thanks!
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.
Who is online
Users browsing this forum: No registered users and 11 guests