diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index 937fc4396e..001be8fb9f 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -61,10 +61,10 @@ impl<'a> Sampler for BlockGen<'a> { let warp = (self.world.sim() .gen_ctx .warp_nz - .get((wposf.div(Vec3::new(120.0, 120.0, 150.0))).into_array()) + .get((wposf.div(Vec3::new(120.0, 120.0, 140.0))).into_array()) as f32) .mul((chaos - 0.1).max(0.0)) - .mul(110.0); + .mul(100.0); let height = alt + warp; diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 2d2201f327..af72585c1a 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -121,7 +121,7 @@ impl<'a> Sampler for ColumnGen<'a> { - marble * 24.0) / 12.0, ), - (alt - CONFIG.sea_level - 0.15 * CONFIG.mountain_scale) / 180.0, + (alt - CONFIG.sea_level - 0.2 * CONFIG.mountain_scale) / 180.0, ), // Beach (alt - CONFIG.sea_level - 2.0) / 5.0, diff --git a/world/src/config.rs b/world/src/config.rs index 3dd6f6e09e..1d7238db35 100644 --- a/world/src/config.rs +++ b/world/src/config.rs @@ -5,5 +5,5 @@ pub struct Config { pub const CONFIG: Config = Config { sea_level: 128.0, - mountain_scale: 900.0, + mountain_scale: 1200.0, }; diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index e062e5d293..7aea57b935 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -8,7 +8,10 @@ use common::{ terrain::TerrainChunkSize, vol::VolSize, }; -use crate::util::StructureGen2d; +use crate::{ + CONFIG, + util::StructureGen2d, +}; pub const WORLD_SIZE: Vec2 = Vec2 { x: 1024, y: 1024 }; @@ -137,9 +140,6 @@ impl WorldSim { } } -pub const SEA_LEVEL: f32 = 128.0; -pub const MOUNTAIN_HEIGHT: f32 = 900.0; - const Z_TOLERANCE: (f32, f32) = (128.0, 64.0); pub struct SimChunk { @@ -167,10 +167,10 @@ impl SimChunk { .add(0.3) .max(0.0); - let chaos = (gen_ctx.chaos_nz.get((wposf.div(2_000.0)).into_array()) as f32) + let chaos = (gen_ctx.chaos_nz.get((wposf.div(5_000.0)).into_array()) as f32) .add(1.0) .mul(0.5) - .powf(1.5) + .powf(1.6) .add(0.1 * hill); let chaos = chaos + chaos.mul(16.0).sin().mul(0.02); @@ -181,9 +181,11 @@ impl SimChunk { .add(alt_base.mul(128.0).sin().mul(0.005)) .mul(800.0); - let alt_main = gen_ctx.alt_nz.get((wposf.div(3_000.0)).into_array()) as f32; + let alt_main = (gen_ctx.alt_nz.get((wposf.div(2_000.0)).into_array()) as f32) + .abs() + .powf(1.4); - let alt = SEA_LEVEL + let alt = CONFIG.sea_level + alt_base + (0.0 + alt_main @@ -194,7 +196,7 @@ impl SimChunk { .add(1.0) .mul(0.5) .mul(chaos) - .mul(MOUNTAIN_HEIGHT); + .mul(CONFIG.mountain_scale); Self { chaos, @@ -210,7 +212,7 @@ impl SimChunk { .mul(0.5) .mul(1.0 - chaos * 0.85) .add(0.1) - .mul(if alt > SEA_LEVEL + 2.0 { 1.0 } else { 0.0 }), + .mul(if alt > CONFIG.sea_level + 2.0 { 1.0 } else { 0.0 }), } } @@ -223,6 +225,6 @@ impl SimChunk { } pub fn get_max_z(&self) -> f32 { - (self.alt + Z_TOLERANCE.1).max(SEA_LEVEL + 1.0) + (self.alt + Z_TOLERANCE.1).max(CONFIG.sea_level + 1.0) } }