minetest.register_biome(): heat_point and humidity_point?

User avatar
y.st.
Member
 
Posts: 38
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: Yst
In-game: Yst

minetest.register_biome(): heat_point and humidity_point?

by y.st. » Thu Mar 26, 2015 00:48

I found the minetest.register_biome() function in use in minetest_game, but I can't seem to find any documentation on it. I have since been experementing with it, and I think I gigured out most of what I need to make it work. However, I still have a question about the "heat_point" and "humidity_point" elements. What are the minimum and maximum values of these elements? It would be a lot easier to work on the biome distribution if I knew what my ranges were. I had assumed that both numbers were integers from 0 to 100, but using that assumption, I get bad distributions where some biomes are so rare it takes forever to find them while other biomes are found everywhere I look.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: minetest.register_biome(): heat_point and humidity_point

by paramat » Thu Mar 26, 2015 17:54

Yes the biome API is not yet documented, but for an example of how to use it see my mod for mgv5/mgv7 https://github.com/paramat/biomesdev
Heat and humidity are mostly in the range 0 to 100 but can extend as far as -25 to 125.
They need to be evenly spaced out on a graph of heat agaiinst humidity for roughly equal size biomes, but even then because of the nature of perlin noise biomes will vary in size and sometimes be rare or huge.
The biomes are chosen using a voronoi diagram of heat/humidity points on a 2D graph of heat against humidity:

Image
 

User avatar
y.st.
Member
 
Posts: 38
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: Yst
In-game: Yst

Re: minetest.register_biome(): heat_point and humidity_point

by y.st. » Fri Mar 27, 2015 00:06

Thank you so much for the help!

I strongly suspected a chart like that was used internally to find the biome locations (likely in the form of a least squares equasion or something). I couldn't see another way to handle biomes based on two factors (heat and humidity).

I think my initial biome layout was odd, cauing my hot/humid (100/100) biome to get squished out. I tried to define two nearly-identical biomes (one at 50/50 and one at 49/49), and it may have done funky things to the more extreme biomes. Spreading them out better, I'm getting better results.

By the way, do you know why more extreme temperatures (to -25 and to 125) are less common than those in the 0 to 100 range? Is there some sort of normalization going on that might make 50/50 the most common temperature?

Thank you for the code examples too! I'll read over your biomesdev mod and see what you have done with it.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: minetest.register_biome(): heat_point and humidity_point

by paramat » Fri Mar 27, 2015 02:58

> do you know why more extreme temperatures (to -25 and to 125) are less common than those in the 0 to 100 range?

Because heat and humidity are defined as 50 + noisevalue * 50, and noise values vary roughly between -1.5 to +1.5 if they have several octaves, dependant on persistence and number of octaves.
Heat and humidity have 3 octaves with 0.5 persistence, so the maximum amplitude is:
1 + 0.5 + 0.5*0.5 = 1.75 so the variation is from -1.75 to +1.75, but the extreme values are extremely rare, the usual variation is roughly a little larger than -1 to +1.
 

User avatar
y.st.
Member
 
Posts: 38
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: Yst
In-game: Yst

Re: minetest.register_biome(): heat_point and humidity_point

by y.st. » Fri Mar 27, 2015 06:08

Awesome. Thank you for all the help! I think I have everything I need to get my subgame started now.
 

User avatar
y.st.
Member
 
Posts: 38
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: Yst
In-game: Yst

Re: minetest.register_biome(): heat_point and humidity_point

by y.st. » Fri Mar 27, 2015 17:19

I was just crunching the numbers, and for some reason, they aren't adding up. If the perlin noise ranges from -1.75 to +1.75 and the temperature and humidity equasion is 50 + <noise> * 50, why is the range -25 to +125 and not -37.5 to +137.5?
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: minetest.register_biome(): heat_point and humidity_point

by paramat » Fri Mar 27, 2015 19:00

Sure correct, when i said -25 to 125 that's just a rough example of typical not-rare variation. The extremes of -1.75 to +1.75 are so extremely rare it's best to assume a smaller range of typical variation. The chance of all 3 octaves of noise being simultaneously at +1, or at -1, is a once in a lifetime event.
If you work with -37.5 to +137.5 and create a biome that only appears at heat < -25 it will be too rare. For equal sized biomes it's best to assume the range is roughly -20 to +120. My biome points never go beyond 0 to 100,
 

User avatar
y.st.
Member
 
Posts: 38
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: Yst
In-game: Yst

Re: minetest.register_biome(): heat_point and humidity_point

by y.st. » Wed Apr 01, 2015 04:03

Okay, got it. Thank you so much forthe help!

I think I will make some rare biomes as a way to get certain novelty nodes (such as default:nyancat), but will otherwise stay in the 0 to 100 range.
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: minetest.register_biome(): heat_point and humidity_point

by Kilarin » Fri May 22, 2015 21:07

I'm messing with mapgen, and my vast ignorance is showing. Heat_point and humidity_point being part of that. :)

Using paramat's example here:https://github.com/paramat/biomesdev/blob/master/init.lua
Ignoring the ocean biomes you have:
name = "tundra",
heat_point = 0,
humidity_point = 0,

name = "taiga",
heat_point = 0,
humidity_point = 100,

name = "grassland",
heat_point = 35,
humidity_point = 0,

name = "coniferous_forest",
heat_point = 35,
humidity_point = 100,

name = "sandstone_grassland",
heat_point = 65,
humidity_point = 0,

name = "deciduous_forest",
heat_point = 65,
humidity_point = 100,

name = "desert",
heat_point = 100,
humidity_point = 0,

name = "rainforest",
heat_point = 100,
humidity_point = 100,

So, does it work like this: the mapgen uses to create the voronoi cells? meaning that it picks some random points and draws the cells, then for each cell it figures out what biome heat_point and humidity point is a closest match at that y level, and that is the biome assigned.

So, for example, if the heat_point of the cell is 40 OR 70 it will match up with heat_point=65 because both values are closer to 65 than they are to 0 or 100.

Essentially assigning biomes with heat_point=0, heat_point=65, and heat_point=100 gives me ranges of
heat_point=0 matches -25 to +32
heat_point=65 matches +33 to +83
heat_point=100 matches +84 to +125

is that close or way off base?

thank you!
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: minetest.register_biome(): heat_point and humidity_point

by paramat » Sat May 23, 2015 05:46

Yes except some of your words are not exactly correct:

> meaning that it picks some random points and draws the cells, then for each cell it figures out what biome heat_point and humidity point is a closest match at that y level

Not random points.
Biome is chosen every time a new upper surface (solid or liquid) is found while working down a column.
For that y, all the biomes active at that y have their 'biome points' drawn on a 2D heat against humidity diagram.
For the surface node (x, y, z) the heat and humidity is found from noise using (x, z), and the node's 'point' is also drawn on the diagram.
As you guessed the biome with it's 'biome point' closest to the 'node point' is chosen.
The cells are simply made from lines at equal distance between biome points (the definition of a voronoi diagram) so you can immediately see what node points will belong to which biome.
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: minetest.register_biome(): heat_point and humidity_point

by Kilarin » Sun May 24, 2015 01:42

Thank you very much for the clarification.

It seems like a VERY nice system. alas, I need to turn off some biomes under certain conditions, so I have to try and rewrite this in lua. (unless you are willing to reconsider adding an "availability" function that is only checked if it is defined, but if it IS defined and returns false, the biome is not available for that point) :)

I'm using your paragenv7 as base to start from. Good code! But I've got a lot of learning to do.
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: minetest.register_biome(): heat_point and humidity_point

by Kilarin » Sun May 24, 2015 15:15

For anyone who's curious as to WHY I am trying to write a lua mapgen that allows you to have a function that determines boime availability: for my own use, I plan on using it in Fractured where I want certain biomes to exist only on the wild side of the world and not on the tame side, and some biomes to be more common the further you get from spawn.

But I think there MIGHT be possibilities for others to use this code as well. For example, a mod like Ethereal might want to ensure that crystal biomes are more rare. Setting a very narrow heat and humidity point might do that, but with the availability function, ethereal could just define an availability function for the crystal biome that did something as simple as check a random number from 1 to 3 and make the biome unavailable unless the result is 3.

Or another user might want to develop a "haunted forest" biome. It would be very similar to a regular forest in heat and humidity point, but the availability function would ensure that it only showed up rarely.

Or someone might want to have a certain special biome that only shows up once in each quarter of the world. The availability function could do that.

So, I'm trying to figure this out and make it work. :)
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: minetest.register_biome(): heat_point and humidity_point

by paramat » Sun May 24, 2015 21:23

As we discussed, adding hardcoded zoning of biomes is not really possible, due to it being complex specialised, that's more of a lua mapgen thing, lua mapgens can be much more powerful and specialised than the simplistic biome API.
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: minetest.register_biome(): heat_point and humidity_point

by Kilarin » Sun May 24, 2015 23:53

Kilarin wrote:that's more of a lua mapgen thing,

And thats what I'm working on. :) Thank you!
 

User avatar
Routhinator
New member
 
Posts: 3
Joined: Sat Jan 17, 2015 14:33
GitHub: Routhinator
IRC: Routh
In-game: Routhinator

Re: minetest.register_biome(): heat_point and humidity_point

by Routhinator » Tue Jul 21, 2015 00:19

Thanks for that map paramat. I designed myself a blank map for me to draw out my biomes as I plan them. I've attached the PDF and ODT files if others wish to use it for planning theirs.
Attachments
minetest_biome_mapping.zip
(41.24 KiB) Downloaded 122 times
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: minetest.register_biome(): heat_point and humidity_point

by BirgitLachner » Sun Oct 02, 2016 12:22

Very interesting discussion for me as I try to manipulate the biom-creation in the Etherreal-Mod. I will use GeoGebra - an opensource-tool for math to draw the voronoi-diagramm.

But, what I'm interessting in is if I have a possibillity to display the heat and humidity-values inside a minetest-map? I tried severall possibilites like F5 or F6 but I think I did not found it their.

Birgit
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: minetest.register_biome(): heat_point and humidity_point

by paramat » Sun Oct 02, 2016 17:12

An API for heat and humidity at point are intended.
 

BirgitLachner
Member
 
Posts: 135
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: minetest.register_biome(): heat_point and humidity_point

by BirgitLachner » Sun Oct 02, 2016 17:24

Thanks paramat for the information.

And here is the voronoi diagram for Etherreal Mod https://www.geogebra.org/m/u2ngcd5F
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: minetest.register_biome(): heat_point and humidity_point

by paramat » Mon Oct 03, 2016 02:54

Wow.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: minetest.register_biome(): heat_point and humidity_point

by paramat » Thu Dec 15, 2016 04:49

GeoGebra can be used to move biome points around with the pointer and the voronoi cells will change shape in real time, i have found this essential for designing a set of biomes, our new default set of biomes was designed this way.
How to use GeoGebra to do this: https://forum.minetest.net/viewtopic.php?p=230857#p230857
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 43 guests

cron