From ee90661f03e16d04a9199342cad1ba3b95e111a7 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 31 May 2019 19:49:57 +0100 Subject: [PATCH] Improved cave proportions --- world/src/sim.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/world/src/sim.rs b/world/src/sim.rs index a4c59b7e57..221cacdf4f 100644 --- a/world/src/sim.rs +++ b/world/src/sim.rs @@ -201,14 +201,14 @@ impl<'a> Sampler<'a> { ); // Caves - let cave_xy = (sim.gen_ctx.cave_0_nz.get(Vec3::new(wposf.x, wposf.y, alt as f64 * 8.0).div(600.0).into_array()) as f32) + let cave_xy = (sim.gen_ctx.cave_0_nz.get(Vec3::new(wposf.x, wposf.y, alt as f64 * 8.0).div(800.0).into_array()) as f32) .powf(2.0) .neg() .add(1.0) .mul((1.15 - chaos).min(1.0)); let cave_alt = alt - 24.0 + (sim.gen_ctx.cave_1_nz.get(Vec2::new(wposf.x, wposf.y).div(32.0).into_array()) as f32) * 6.0 - + (sim.gen_ctx.cave_1_nz.get(Vec2::new(wposf.x, wposf.y).div(300.0).into_array()) as f32).add(1.0).mul(0.5).powf(12.0).mul(96.0); + + (sim.gen_ctx.cave_1_nz.get(Vec2::new(wposf.x, wposf.y).div(300.0).into_array()) as f32).add(1.0).mul(0.5).powf(8.0).mul(256.0); Some(Sample2d { alt, @@ -296,7 +296,7 @@ impl<'a> Sampler<'a> { }; let ground_block = if let Some(block) = ground_block { // Underground - let cave = cave_xy.powf(2.0) * (wposf.z as f32 - cave_alt).div(20.0).powf(4.0).neg().add(1.0) > 0.996; + let cave = cave_xy.powf(2.0) * (wposf.z as f32 - cave_alt).div(40.0).powf(4.0).neg().add(1.0) > 0.9996; if cave { None