]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Add hillyness
authorElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 1 Oct 2021 13:50:29 +0000 (15:50 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 1 Oct 2021 13:50:29 +0000 (15:50 +0200)
deps/dragonport
src/client/client_map.c
src/perlin.h
src/server/mapgen.c

index a6c5dd9faf12ac38b1868c7ad742947a7dbeb905..d719d15af18415f17ba5ab9cde0718f2e38717ba 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a6c5dd9faf12ac38b1868c7ad742947a7dbeb905
+Subproject commit d719d15af18415f17ba5ab9cde0718f2e38717ba
index 93bd5754e0dc408bf1aca71c3f89fc65577a65a7..6524573b4872b3f84e2a3db3622693c641114f3e 100644 (file)
@@ -5,7 +5,7 @@
 #include "client/client_map.h"
 #include "client/client_player.h"
 #include "util.h"
-#define MAX_BLOCK_REQUESTS 8
+#define MAX_BLOCK_REQUESTS 4
 
 struct ClientMap client_map;
 Client *client;
index 3f13e0ca377c39393adf8429a3cff759eb53710e..62ce0b12f5b7796c032e4aa58c1759e1cfee91c0 100644 (file)
@@ -25,6 +25,7 @@ typedef enum
        SO_VULCANO_HEIGHT,
        SO_VULCANO_STONE,
        SO_VULCANO_CRATER_TOP,
+       SO_HILLYNESS,
 } SeedOffset;
 
 extern s32 seed;
index 9f51fa9b35dd7508fdab12c2d85e6ae2e48cfbc9..22e54e09ffebd1f9f9f9397a749b7dfc1005f037 100644 (file)
@@ -32,7 +32,9 @@ void mapgen_generate_block(MapBlock *block, List *changed_blocks)
                for (u8 z = 0; z < MAPBLOCK_SIZE; z++) {
                        v2s32 pos_horizontal = {pos_x, block_node_pos.z + z};
 
-                       s32 height = pnoise2d(U32(pos_horizontal.x) / 32.0, U32(pos_horizontal.y) / 32.0, 0.45, 5, seed + SO_HEIGHT) * 16.0 + 32;
+                       s32 height = (pnoise2d(U32(pos_horizontal.x) / 32.0, U32(pos_horizontal.y) / 32.0, 0.45, 5, seed + SO_HEIGHT) * 16.0)
+                               * (pnoise2d(U32(pos_horizontal.x) / 256.0, U32(pos_horizontal.y) / 256.0, 0.45, 5, seed + SO_HILLYNESS) * 0.5 + 0.5)
+                               + 32;
 
                        f64 factor;
                        Biome biome = get_biome(pos_horizontal, &factor);