Make border wall brutalist

This commit is contained in:
chelsea
2026-05-02 20:07:38 -05:00
parent f423c046ac
commit 32d2b09b9f
5 changed files with 65 additions and 9 deletions

View File

@@ -3558,7 +3558,12 @@ static void generate_chunk_border_wall(worldgen_ctx *ctx, int chunk_x, int chunk
if (!ctx->enable_wall) return;
if (ctx->wall_min_x > ctx->wall_max_x || ctx->wall_min_z > ctx->wall_max_z) return;
const int wall_height = 9;
const int wall_depth = 4;
const int wall_height = 18;
const int tower_depth = 9;
const int tower_height = 28;
const int tower_spacing = 32;
const int tower_half_width = 4;
for (int dx = 0; dx < CHUNK_SIZE; ++dx) {
for (int dz = 0; dz < CHUNK_SIZE; ++dz) {
int world_x = chunk_x * CHUNK_SIZE + dx;
@@ -3566,9 +3571,34 @@ static void generate_chunk_border_wall(worldgen_ctx *ctx, int chunk_x, int chunk
if (world_x < ctx->wall_min_x || world_x > ctx->wall_max_x) continue;
if (world_z < ctx->wall_min_z || world_z > ctx->wall_max_z) continue;
int on_border = world_x == ctx->wall_min_x || world_x == ctx->wall_max_x ||
world_z == ctx->wall_min_z || world_z == ctx->wall_max_z;
if (!on_border) continue;
int dist_min_x = world_x - ctx->wall_min_x;
int dist_max_x = ctx->wall_max_x - world_x;
int dist_min_z = world_z - ctx->wall_min_z;
int dist_max_z = ctx->wall_max_z - world_z;
int side_dist = dist_min_x;
int along = world_z;
if (dist_max_x < side_dist) {
side_dist = dist_max_x;
along = world_z;
}
if (dist_min_z < side_dist) {
side_dist = dist_min_z;
along = world_x;
}
if (dist_max_z < side_dist) {
side_dist = dist_max_z;
along = world_x;
}
int phase = along % tower_spacing;
if (phase < 0) phase += tower_spacing;
int tower_offset = phase;
if (tower_offset > tower_spacing / 2) tower_offset = tower_spacing - tower_offset;
int near_corner = (dist_min_x < tower_depth || dist_max_x < tower_depth) &&
(dist_min_z < tower_depth || dist_max_z < tower_depth);
int in_tower = side_dist < tower_depth && (tower_offset <= tower_half_width || near_corner);
int in_wall = side_dist < wall_depth || in_tower;
if (!in_wall) continue;
column_data data = get_column_data(ctx, world_x, world_z);
int visible_base = data.height;
@@ -3577,7 +3607,8 @@ static void generate_chunk_border_wall(worldgen_ctx *ctx, int chunk_x, int chunk
}
if (visible_base >= CHUNK_HEIGHT - 1) continue;
int top = visible_base + wall_height;
int height = in_tower ? tower_height : wall_height;
int top = visible_base + height;
if (top >= CHUNK_HEIGHT) top = CHUNK_HEIGHT - 1;
for (int y = data.height + 1; y < CHUNK_HEIGHT; ++y) {
@@ -3585,12 +3616,28 @@ static void generate_chunk_border_wall(worldgen_ctx *ctx, int chunk_x, int chunk
}
out->heightmap[dx][dz] = (uint16_t)data.height;
int start = data.height + 1;
int start = data.height - 3;
if (start < 1) start = 1;
for (int y = start; y <= top; ++y) {
uint16_t block = (y == top) ? BLOCK_OAK_PLANKS : BLOCK_STONE;
int rel_y = y - visible_base;
uint16_t block = BLOCK_SMOOTH_STONE;
if (rel_y <= 2 || rel_y % 6 == 0 || rel_y == height - 1) {
block = BLOCK_STONE_BRICKS;
}
if (in_tower && side_dist == 0 && rel_y >= 9 && rel_y <= 17 &&
(tower_offset == 0 || (rel_y == 13 && tower_offset <= 3))) {
block = BLOCK_BLACKSTONE;
} else if (in_tower && side_dist == 1 && tower_offset == 0 && rel_y >= 4 && rel_y <= 7) {
block = BLOCK_IRON_BARS;
} else if (!in_tower && side_dist == 0 && rel_y >= 7 && rel_y <= 10 && phase % 16 == 8) {
block = BLOCK_IRON_BARS;
}
set_block_with_height(out, dx, dz, y, block);
}
if (top + 1 < CHUNK_HEIGHT && (side_dist == 0 || side_dist == wall_depth - 1 || in_tower) &&
phase % 4 < 2) {
set_block_with_height(out, dx, dz, top + 1, BLOCK_STONE_BRICKS);
}
}
}
}