aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2016-11-29 04:08:55 +0000
committerparamat <mat.gregory@virginmedia.com>2016-12-01 05:08:51 +0000
commit6c9f10e132ac80a0caffef12d61de84a0a6b02b3 (patch)
tree39b22a47873290eb66faa574c363165038ac55d7 /src
parent5dc61988788e44bc87e8c57c0beded97d4efdf05 (diff)
downloadminetest-6c9f10e132ac80a0caffef12d61de84a0a6b02b3.tar.gz
minetest-6c9f10e132ac80a0caffef12d61de84a0a6b02b3.tar.bz2
minetest-6c9f10e132ac80a0caffef12d61de84a0a6b02b3.zip
Mgv7 floatlands: Various improvements
Floatland base terrain underside was too thin, causing excessive water leakage through tunnels under lakes, now make it thicker. Floatland mountain terrain had a rim 1 node thick which made it bare stone, now make it 2 nodes thick to merge with the floatland base terrain rim and to have a layer of biome material. Make mountain terrain more exponentially shaped by altering the exponent. Remove unnecessary and potentially ugly MYMAX() applied to n_base_height.
Diffstat (limited to 'src')
-rw-r--r--src/mapgen_v7.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mapgen_v7.cpp b/src/mapgen_v7.cpp
index c4fa024a8..498a1333c 100644
--- a/src/mapgen_v7.cpp
+++ b/src/mapgen_v7.cpp
@@ -346,8 +346,11 @@ bool MapgenV7::getMountainTerrainFromMap(int idx_xyz, int idx_xz, s16 y)
bool MapgenV7::getFloatlandMountainFromMap(int idx_xyz, int idx_xz, s16 y)
{
- float density_gradient =
- -pow(fabs((float)(y - floatland_level) / float_mount_height), 0.8f);
+ // Make rim 2 nodes thick to match floatland base terrain
+ float density_gradient = (y >= floatland_level) ?
+ -pow((float)(y - floatland_level) / float_mount_height, 0.75f) :
+ -pow((float)(floatland_level - 1 - y) / float_mount_height, 0.75f);
+
float floatn = noise_mountain->result[idx_xyz] + float_mount_density;
return floatn + density_gradient >= 0.0f;
@@ -362,11 +365,10 @@ void MapgenV7::floatBaseExtentFromMap(s16 *float_base_min, s16 *float_base_max,
float n_base = noise_floatland_base->result[idx_xz];
if (n_base > 0.0f) {
- float n_base_height =
- MYMAX(noise_float_base_height->result[idx_xz], 0.0f);
+ float n_base_height = noise_float_base_height->result[idx_xz];
float amp = n_base * n_base_height;
float ridge = n_base_height / 3.0f;
- base_min = floatland_level - amp / 2.0f;
+ base_min = floatland_level - amp / 1.5f;
if (amp > ridge * 2.0f) {
// Lake bed