]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Mgv7: Add option to repeat surface biomes in floatlands
authorparamat <paramat@users.noreply.github.com>
Thu, 13 Jul 2017 20:03:16 +0000 (21:03 +0100)
committerparamat <mat.gregory@virginmedia.com>
Fri, 21 Jul 2017 23:56:55 +0000 (00:56 +0100)
builtin/settingtypes.txt
minetest.conf.example
src/mapgen_v7.cpp
src/mapgen_v7.h

index 72a5db206f3a7081648500da1d1569fd51783dd0..c1a645dcac6a39eb37b3bee8c4c81540475822a5 100644 (file)
@@ -1151,11 +1151,11 @@ mgv6_np_apple_trees (Apple trees noise) noise_params 0, 1, (100, 100, 100), 3429
 [***Mapgen v7]
 
 #    Map generation attributes specific to Mapgen v7.
-#    The 'ridges' flag enables the rivers.
-#    Floatlands are currently experimental and subject to change.
+#    'ridges' enables the rivers.
+#    'biomerepeat' causes surface biomes to repeat in the floatlands.
 #    Flags that are not specified in the flag string are not modified from the default.
 #    Flags starting with 'no' are used to explicitly disable them.
-mgv7_spflags (Mapgen v7 specific flags) flags mountains,ridges,nofloatlands,caverns mountains,ridges,floatlands,caverns,nomountains,noridges,nofloatlands,nocaverns
+mgv7_spflags (Mapgen v7 specific flags) flags mountains,ridges,nofloatlands,caverns,biomerepeat mountains,ridges,floatlands,caverns,biomerepeat,nomountains,noridges,nofloatlands,nocaverns,nobiomerepeat
 
 #    Controls width of tunnels, a smaller value creates wider tunnels.
 mgv7_cave_width (Cave width) float 0.09
index f29849baf62b75ea00e0da0caa1eabf941f9f1a5..9e4a0e2ee204769e335cda4681dc39da71a9ad73 100644 (file)
 #### Mapgen v7
 
 #    Map generation attributes specific to Mapgen v7.
-#    The 'ridges' flag enables the rivers.
-#    Floatlands are currently experimental and subject to change.
+#    'ridges' enables the rivers.
+#    'biomerepeat' causes surface biomes to repeat in the floatlands.
 #    Flags that are not specified in the flag string are not modified from the default.
 #    Flags starting with 'no' are used to explicitly disable them.
-#    type: flags possible values: mountains, ridges, floatlands, caverns, nomountains, noridges, nofloatlands, nocaverns
-# mgv7_spflags = mountains,ridges,nofloatlands,caverns
+#    type: flags possible values: mountains, ridges, floatlands, caverns, biomerepeat, nomountains, noridges, nofloatlands, nocaverns, nobiomerepeat
+# mgv7_spflags = mountains,ridges,nofloatlands,caverns,biomerepeat
 
 #    Controls width of tunnels, a smaller value creates wider tunnels.
 #    type: float
index 4b263bdb3b70156fcf3a2c54e9983f36581593a3..cdf76993d5ce67defbf575c752de5833d82cf0c1 100644 (file)
@@ -40,11 +40,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 
 FlagDesc flagdesc_mapgen_v7[] = {
-       {"mountains",  MGV7_MOUNTAINS},
-       {"ridges",     MGV7_RIDGES},
-       {"floatlands", MGV7_FLOATLANDS},
-       {"caverns",    MGV7_CAVERNS},
-       {NULL,         0}
+       {"mountains",   MGV7_MOUNTAINS},
+       {"ridges",      MGV7_RIDGES},
+       {"floatlands",  MGV7_FLOATLANDS},
+       {"caverns",     MGV7_CAVERNS},
+       {"biomerepeat", MGV7_BIOMEREPEAT},
+       {NULL,          0}
 };
 
 
@@ -285,6 +286,12 @@ void MapgenV7::makeChunk(BlockMakeData *data)
 
        blockseed = getBlockSeed2(full_node_min, seed);
 
+       // Get zero level for biomes and decorations
+       // Optionally repeat surface biomes in floatlands
+       s16 biome_zero_level = ((spflags & MGV7_FLOATLANDS) &&
+               (spflags & MGV7_BIOMEREPEAT) && node_max.Y >= shadow_limit) ?
+               floatland_level - 1 : water_level - 1;
+
        // Generate base and mountain terrain
        // An initial heightmap is no longer created here for use in generateRidgeTerrain()
        s16 stone_surface_max_y = generateTerrain();
@@ -298,7 +305,7 @@ void MapgenV7::makeChunk(BlockMakeData *data)
 
        // Init biome generator, place biome-specific nodes, and build biomemap
        biomegen->calcBiomeNoise(node_min);
-       MgStoneType stone_type = generateBiomes(water_level - 1);
+       MgStoneType stone_type = generateBiomes(biome_zero_level);
 
        // Generate caverns, tunnels and classic caves
        if (flags & MG_CAVES) {
@@ -323,7 +330,7 @@ void MapgenV7::makeChunk(BlockMakeData *data)
        // Generate the registered decorations
        if (flags & MG_DECORATIONS)
                m_emerge->decomgr->placeAllDecos(this, blockseed,
-                       node_min, node_max, water_level - 1);
+                       node_min, node_max, biome_zero_level);
 
        // Generate the registered ores
        m_emerge->oremgr->placeAllOres(this, blockseed,
index 7b4364ef1772010e0fe2f0f991dc5db7df9a7ac3..aededa7f5de2a5aea8febcf67e0691461959428b 100644 (file)
@@ -23,11 +23,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "mapgen.h"
 
-//////////// Mapgen V7 flags
-#define MGV7_MOUNTAINS  0x01
-#define MGV7_RIDGES     0x02
-#define MGV7_FLOATLANDS 0x04
-#define MGV7_CAVERNS    0x08
+/////////////// Mapgen V7 flags
+#define MGV7_MOUNTAINS   0x01
+#define MGV7_RIDGES      0x02
+#define MGV7_FLOATLANDS  0x04
+#define MGV7_CAVERNS     0x08
+#define MGV7_BIOMEREPEAT 0x10
 
 class BiomeManager;
 
@@ -35,7 +36,8 @@ extern FlagDesc flagdesc_mapgen_v7[];
 
 
 struct MapgenV7Params : public MapgenParams {
-       u32 spflags = MGV7_MOUNTAINS | MGV7_RIDGES | MGV7_CAVERNS;
+       u32 spflags = MGV7_MOUNTAINS | MGV7_RIDGES |
+               MGV7_CAVERNS | MGV7_BIOMEREPEAT;
        float cave_width = 0.09f;
        s16 large_cave_depth = -33;
        s16 lava_depth = -256;