From c6e24b593e82041c18f95fee5bf2a320afb9d2c2 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 8 Jul 2019 00:50:23 +0100 Subject: [PATCH] Rescaled mountains --- world/src/column/mod.rs | 2 +- world/src/config.rs | 2 +- world/src/sim/mod.rs | 22 ++++++++++++---------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 2f93eb3855..63146f9a42 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -77,7 +77,7 @@ impl<'a> Sampler for ColumnGen<'a> { let water_level = (riverless_alt - 4.0 - 5.0 * chaos).max(CONFIG.sea_level); let rock = (sim.gen_ctx.small_nz.get( - Vec3::new(wposf.x, wposf.y, alt as f64) + Vec3::new(wposf.x, wposf.y, alt as f64 * 3.0) .div(100.0) .into_array(), ) as f32) diff --git a/world/src/config.rs b/world/src/config.rs index 62d5db8837..fc3199d0de 100644 --- a/world/src/config.rs +++ b/world/src/config.rs @@ -8,7 +8,7 @@ pub struct Config { pub const CONFIG: Config = Config { sea_level: 140.0, - mountain_scale: 1200.0, + mountain_scale: 1000.0, snow_temp: -0.4, tropical_temp: 0.25, desert_temp: 0.45, diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 28fcba56be..d07df0ed74 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -368,20 +368,22 @@ impl SimChunk { .into_array(), ) as f32; - let chaos = (gen_ctx.chaos_nz.get((wposf.div(6_000.0)).into_array()) as f32) + let chaos = (gen_ctx.chaos_nz.get((wposf.div(3_000.0)).into_array()) as f32) .add(1.0) .mul(0.5) .mul( - (gen_ctx.chaos_nz.get((wposf.div(4_000.0)).into_array()) as f32) - .powf(2.0) - .add(0.5) + (gen_ctx.chaos_nz.get((wposf.div(6_000.0)).into_array()) as f32) + .abs() .min(1.0), ) - .add(0.1 * hill) - .mul(temp.mul(4.0).sub(1.0).neg().add(1.25).max(0.15).min(1.0)) - .powf(1.5); - - let chaos = chaos + chaos.mul(16.0).sin().mul(0.02); + .add(0.15 * hill) + .mul( + temp.sub(CONFIG.desert_temp) + .neg() + .mul(12.0) + .max(0.35) + .min(1.0), + ); let alt_base = gen_ctx.alt_nz.get((wposf.div(6_000.0)).into_array()) as f32; let alt_base = alt_base @@ -391,7 +393,7 @@ impl SimChunk { let alt_main = (gen_ctx.alt_nz.get((wposf.div(2_000.0)).into_array()) as f32) .abs() - .powf(1.8); + .powf(1.35); let alt = CONFIG.sea_level + alt_base