Biomes

User avatar
MasterGollum
Member
 
Posts: 79
Joined: Thu Sep 27, 2012 14:48

Biomes

by MasterGollum » Fri Nov 02, 2012 19:10

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.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Nov 02, 2012 19:17

Look at mapgen.cpp.
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Fri Nov 02, 2012 20:02

 

User avatar
MasterGollum
Member
 
Posts: 79
Joined: Thu Sep 27, 2012 14:48

by MasterGollum » Fri Nov 02, 2012 20:15

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?
 

User avatar
MasterGollum
Member
 
Posts: 79
Joined: Thu Sep 27, 2012 14:48

by MasterGollum » Fri Nov 02, 2012 20:18

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?
 

User avatar
Splizard
Member
 
Posts: 220
Joined: Wed Jan 25, 2012 07:20
GitHub: Splizard
IRC: Splizard
In-game: Splizard

by Splizard » Fri Nov 02, 2012 21:24

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.
Games: The Hungry Games.
Mods: Lifters (Simple Lifts), Snow Biomes and Gates.
Also checkout my texture pack Gridtoon!
View all of them plus more at http://minetest.splizard.com! (may not always be online).
 

User avatar
MasterGollum
Member
 
Posts: 79
Joined: Thu Sep 27, 2012 14:48

by MasterGollum » Fri Nov 02, 2012 22:02

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.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 3 guests

cron