# Mgv5 uses eased noise for np_ground so this is shown in group format,
# other noise parameters are shown in positional format to save space.
-# Noise parameters for biome API temperature and humidity
+# Noise parameters for biome API temperature, humidity and biome blend
#mg_biome_np_heat = 50, 50, (750, 750, 750), 5349, 3, 0.5, 2.0
+#mg_biome_np_heat_blend = 0, 1.5, (8, 8, 8), 13, 2, 1.0, 2.0
#mg_biome_np_humidity = 50, 50, (750, 750, 750), 842, 3, 0.5, 2.0
+#mg_biome_np_humidity_blend = 0, 1.5, (8, 8, 8), 90003, 2, 1.0, 2.0
#mgv5_np_filler_depth = 0, 1, (150, 150, 150), 261, 4, 0.7, 2.0
#mgv5_np_factor = 0, 1, (250, 250, 250), 920381, 3, 0.45, 2.0
settings.getS16NoEx("chunksize", chunksize);
settings.getFlagStrNoEx("mg_flags", flags, flagdesc_mapgen);
settings.getNoiseParams("mg_biome_np_heat", np_biome_heat);
+ settings.getNoiseParams("mg_biome_np_heat_blend", np_biome_heat_blend);
settings.getNoiseParams("mg_biome_np_humidity", np_biome_humidity);
+ settings.getNoiseParams("mg_biome_np_humidity_blend", np_biome_humidity_blend);
delete sparams;
sparams = EmergeManager::createMapgenParams(mg_name);
settings.setS16("chunksize", chunksize);
settings.setFlagStr("mg_flags", flags, flagdesc_mapgen, (u32)-1);
settings.setNoiseParams("mg_biome_np_heat", np_biome_heat);
+ settings.setNoiseParams("mg_biome_np_heat_blend", np_biome_heat_blend);
settings.setNoiseParams("mg_biome_np_humidity", np_biome_humidity);
+ settings.setNoiseParams("mg_biome_np_humidity_blend", np_biome_humidity_blend);
if (sparams)
sparams->writeParams(&settings);
u32 flags;
NoiseParams np_biome_heat;
+ NoiseParams np_biome_heat_blend;
NoiseParams np_biome_humidity;
+ NoiseParams np_biome_humidity_blend;
MapgenSpecificParams *sparams;
water_level(1),
flags(MG_TREES | MG_CAVES | MG_LIGHT),
np_biome_heat(NoiseParams(50, 50, v3f(750.0, 750.0, 750.0), 5349, 3, 0.5, 2.0)),
+ np_biome_heat_blend(NoiseParams(0, 1.5, v3f(8.0, 8.0, 8.0), 13, 2, 1.0, 2.0)),
np_biome_humidity(NoiseParams(50, 50, v3f(750.0, 750.0, 750.0), 842, 3, 0.5, 2.0)),
+ np_biome_humidity_blend(NoiseParams(0, 1.5, v3f(8.0, 8.0, 8.0), 90003, 2, 1.0, 2.0)),
sparams(NULL)
{}
noise_height = new Noise(&sp->np_height, seed, csize.X, csize.Z);
// 3D terrain noise
- noise_cave1 = new Noise(&sp->np_cave1, seed, csize.X, csize.Y + 2, csize.Z);
- noise_cave2 = new Noise(&sp->np_cave2, seed, csize.X, csize.Y + 2, csize.Z);
- noise_ground = new Noise(&sp->np_ground, seed, csize.X, csize.Y + 2, csize.Z);
+ noise_cave1 = new Noise(&sp->np_cave1, seed, csize.X, csize.Y + 2, csize.Z);
+ noise_cave2 = new Noise(&sp->np_cave2, seed, csize.X, csize.Y + 2, csize.Z);
+ noise_ground = new Noise(&sp->np_ground, seed, csize.X, csize.Y + 2, csize.Z);
// Biome noise
- noise_heat = new Noise(¶ms->np_biome_heat, seed, csize.X, csize.Z);
- noise_humidity = new Noise(¶ms->np_biome_humidity, seed, csize.X, csize.Z);
+ noise_heat = new Noise(¶ms->np_biome_heat, seed, csize.X, csize.Z);
+ noise_humidity = new Noise(¶ms->np_biome_humidity, seed, csize.X, csize.Z);
+ noise_heat_blend = new Noise(¶ms->np_biome_heat_blend, seed, csize.X, csize.Z);
+ noise_humidity_blend = new Noise(¶ms->np_biome_humidity_blend, seed, csize.X, csize.Z);
//// Resolve nodes to be used
INodeDefManager *ndef = emerge->ndef;
delete noise_heat;
delete noise_humidity;
+ delete noise_heat_blend;
+ delete noise_humidity_blend;
delete[] heightmap;
delete[] biomemap;
noise_filler_depth->perlinMap2D(x, z);
noise_heat->perlinMap2D(x, z);
noise_humidity->perlinMap2D(x, z);
+ noise_heat_blend->perlinMap2D(x, z);
+ noise_humidity_blend->perlinMap2D(x, z);
+ for (s32 i = 0; i < csize.X * csize.Z; i++) {
+ noise_heat->result[i] += noise_heat_blend->result[i];
+ noise_humidity->result[i] += noise_humidity_blend->result[i];
+ }
//printf("calculateNoise: %dus\n", t.stop());
}
Noise *noise_cave1;
Noise *noise_cave2;
Noise *noise_ground;
+
Noise *noise_heat;
Noise *noise_humidity;
+ Noise *noise_heat_blend;
+ Noise *noise_humidity_blend;
content_t c_stone;
content_t c_water_source;
noise_cave2 = new Noise(&sp->np_cave2, seed, csize.X, csize.Y + 2, csize.Z);
//// Biome noise
- noise_heat = new Noise(¶ms->np_biome_heat, seed, csize.X, csize.Z);
- noise_humidity = new Noise(¶ms->np_biome_humidity, seed, csize.X, csize.Z);
+ noise_heat = new Noise(¶ms->np_biome_heat, seed, csize.X, csize.Z);
+ noise_humidity = new Noise(¶ms->np_biome_humidity, seed, csize.X, csize.Z);
+ noise_heat_blend = new Noise(¶ms->np_biome_heat_blend, seed, csize.X, csize.Z);
+ noise_humidity_blend = new Noise(¶ms->np_biome_humidity_blend, seed, csize.X, csize.Z);
//// Resolve nodes to be used
INodeDefManager *ndef = emerge->ndef;
delete noise_heat;
delete noise_humidity;
+ delete noise_heat_blend;
+ delete noise_humidity_blend;
delete[] ridge_heightmap;
delete[] heightmap;
assert(data->vmanip);
assert(data->nodedef);
assert(data->blockpos_requested.X >= data->blockpos_min.X &&
- data->blockpos_requested.Y >= data->blockpos_min.Y &&
- data->blockpos_requested.Z >= data->blockpos_min.Z);
+ data->blockpos_requested.Y >= data->blockpos_min.Y &&
+ data->blockpos_requested.Z >= data->blockpos_min.Z);
assert(data->blockpos_requested.X <= data->blockpos_max.X &&
- data->blockpos_requested.Y <= data->blockpos_max.Y &&
- data->blockpos_requested.Z <= data->blockpos_max.Z);
+ data->blockpos_requested.Y <= data->blockpos_max.Y &&
+ data->blockpos_requested.Z <= data->blockpos_max.Z);
this->generating = true;
this->vm = data->vmanip;
noise_filler_depth->perlinMap2D(x, z);
noise_heat->perlinMap2D(x, z);
noise_humidity->perlinMap2D(x, z);
+ noise_heat_blend->perlinMap2D(x, z);
+ noise_humidity_blend->perlinMap2D(x, z);
+
+ for (s32 i = 0; i < csize.X * csize.Z; i++) {
+ noise_heat->result[i] += noise_heat_blend->result[i];
+ noise_humidity->result[i] += noise_humidity_blend->result[i];
+ }
//printf("calculateNoise: %dus\n", t.stop());
}
Biome *MapgenV7::getBiomeAtPoint(v3s16 p)
{
- float heat = NoisePerlin2D(&noise_heat->np, p.X, p.Z, seed);
- float humidity = NoisePerlin2D(&noise_humidity->np, p.X, p.Z, seed);
+ float heat = NoisePerlin2D(&noise_heat->np, p.X, p.Z, seed) +
+ NoisePerlin2D(&noise_heat_blend->np, p.X, p.Z, seed);
+ float humidity = NoisePerlin2D(&noise_humidity->np, p.X, p.Z, seed) +
+ NoisePerlin2D(&noise_humidity_blend->np, p.X, p.Z, seed);
s16 groundlevel = baseTerrainLevelAtPoint(p.X, p.Z);
return bmgr->getBiome(heat, humidity, groundlevel);
Noise *noise_heat;
Noise *noise_humidity;
+ Noise *noise_heat_blend;
+ Noise *noise_humidity_blend;
content_t c_stone;
content_t c_water_source;