Add hillyness

master
Elias Fleckenstein 2021-10-01 15:50:29 +02:00
parent d65828f3d7
commit 310a681bbb
4 changed files with 6 additions and 3 deletions

2
deps/dragonport vendored

@ -1 +1 @@
Subproject commit a6c5dd9faf12ac38b1868c7ad742947a7dbeb905
Subproject commit d719d15af18415f17ba5ab9cde0718f2e38717ba

View 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;

View File

@ -25,6 +25,7 @@ typedef enum
SO_VULCANO_HEIGHT,
SO_VULCANO_STONE,
SO_VULCANO_CRATER_TOP,
SO_HILLYNESS,
} SeedOffset;
extern s32 seed;

View 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);