From 310a681bbbc8baa16700b5e0dfaa11e28770d1d1 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 1 Oct 2021 15:50:29 +0200 Subject: [PATCH] Add hillyness --- deps/dragonport | 2 +- src/client/client_map.c | 2 +- src/perlin.h | 1 + src/server/mapgen.c | 4 +++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/deps/dragonport b/deps/dragonport index a6c5dd9..d719d15 160000 --- a/deps/dragonport +++ b/deps/dragonport @@ -1 +1 @@ -Subproject commit a6c5dd9faf12ac38b1868c7ad742947a7dbeb905 +Subproject commit d719d15af18415f17ba5ab9cde0718f2e38717ba diff --git a/src/client/client_map.c b/src/client/client_map.c index 93bd575..6524573 100644 --- a/src/client/client_map.c +++ b/src/client/client_map.c @@ -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; diff --git a/src/perlin.h b/src/perlin.h index 3f13e0c..62ce0b1 100644 --- a/src/perlin.h +++ b/src/perlin.h @@ -25,6 +25,7 @@ typedef enum SO_VULCANO_HEIGHT, SO_VULCANO_STONE, SO_VULCANO_CRATER_TOP, + SO_HILLYNESS, } SeedOffset; extern s32 seed; diff --git a/src/server/mapgen.c b/src/server/mapgen.c index 9f51fa9..22e54e0 100644 --- a/src/server/mapgen.c +++ b/src/server/mapgen.c @@ -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); -- 2.44.0