Page 1 of 1

Biomes

PostPosted: Fri Nov 02, 2012 19:10
by MasterGollum
Is documented in any place the perlin noise of the different default biomes (I suppose they depend on it)? I can't find it, for example if it is possible to know when a plain is being generated, or a lava lake, etc, all the default biomes.

PostPosted: Fri Nov 02, 2012 19:17
by PilzAdam
Look at mapgen.cpp.

PostPosted: Fri Nov 02, 2012 20:02
by Mito551

PostPosted: Fri Nov 02, 2012 20:15
by MasterGollum
PilzAdam wrote:Look at mapgen.cpp.


Wow it is a ultra complex code :P what I see is that in fact are only to biomes? NORMAL and DESERT?

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
enum BiomeType
{
BT_NORMAL,
BT_DESERT
};

BiomeType get_biome(u64 seed, v2s16 p2d)
{
// Just do something very simple as for now
double d = noise2d_perlin(
0.6+(float)p2d.X/250, 0.2+(float)p2d.Y/250,
seed+9130, 3, 0.50);
if(d > 0.45)
return BT_DESERT;
if(d > 0.35 && (noise2d( p2d.X, p2d.Y, int(seed) ) + 1.0) > ( 0.45 - d ) * 20.0 )
return BT_DESERT;
return BT_NORMAL;
};


So it's not possible to detect if it is a plain for example? I mean in a more quick way than search for trees. Same as caves, etc. They must be checked searching directly for the nodes?

PostPosted: Fri Nov 02, 2012 20:18
by MasterGollum
Mito551 wrote:try seeing snow mod: http://minetest.net/forum/viewtopic.php?id=2290


I did, but I didn't know why he choose perlin1:get2d({x=x,y=z}) > 0.53 and not other value. And if it's possible to decide based on the values returned by this function the kind of biome we are in. Let's say if pops a value under 0.2, does it have a meaning?

PostPosted: Fri Nov 02, 2012 21:24
by Splizard
MasterGollum wrote:
Mito551 wrote:try seeing snow mod: http://minetest.net/forum/viewtopic.php?id=2290


I did, but I didn't know why he choose perlin1:get2d({x=x,y=z}) > 0.53 and not other value. And if it's possible to decide based on the values returned by this function the kind of biome we are in. Let's say if pops a value under 0.2, does it have a meaning?


The value 0.53 was chosen by experimenting with different values, the reason I chose that value was because the rarity was ok and it worked nicely.

PostPosted: Fri Nov 02, 2012 22:02
by MasterGollum
Splizard wrote:
MasterGollum wrote:
Mito551 wrote:try seeing snow mod: http://minetest.net/forum/viewtopic.php?id=2290


I did, but I didn't know why he choose perlin1:get2d({x=x,y=z}) > 0.53 and not other value. And if it's possible to decide based on the values returned by this function the kind of biome we are in. Let's say if pops a value under 0.2, does it have a meaning?


The value 0.53 was chosen by experimenting with different values, the reason I chose that value was because the rarity was ok and it worked nicely.


Thank you for the explanation, I just was wondering how you decided them if it was possible to use the same system to detect the standard biomes.