From 599107f2edaac7bd23e596dcf34a6bed5953047b Mon Sep 17 00:00:00 2001 From: osmarks Date: Fri, 6 Mar 2026 09:25:35 +0000 Subject: [PATCH] retuning --- src/main.rs | 4 ++-- src/plant.rs | 12 ++++++------ src/worldgen.rs | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index e83f126..892a280 100644 --- a/src/main.rs +++ b/src/main.rs @@ -292,7 +292,7 @@ fn game_state_from_saved(saved: SavedGame) -> Result { const PLANT_TICK_DELAY: u64 = 128; const FIELD_DECAY_DELAY: u64 = 100; const PLANT_GROWTH_SCALE: f32 = 0.01; -const SOIL_NUTRIENT_CONSUMPTION_RATE: f32 = 0.05; +const SOIL_NUTRIENT_CONSUMPTION_RATE: f32 = 0.07; const SOIL_NUTRIENT_FIXATION_RATE: f32 = 0.0002; const WATER_CONSUMPTION_RATE: f32 = 0.03; const PLANT_IDLE_WATER_CONSUMPTION_OFFSET: f32 = 0.05; @@ -316,7 +316,7 @@ async fn game_tick(state: &mut GameState) -> Result<()> { buffer.apply(state); if state.ticks % FIELD_DECAY_DELAY == 0 { - state.dynamic_soil_nutrients.for_each_mut(|nutrients| *nutrients *= 0.999); + state.dynamic_soil_nutrients.for_each_mut(|nutrients| *nutrients *= 0.9999); } else if state.ticks % FIELD_DECAY_DELAY == 1 { state.dynamic_groundwater.for_each_mut(|water| *water *= 0.999); } else if state.ticks % FIELD_DECAY_DELAY == 2 { diff --git a/src/plant.rs b/src/plant.rs index 15894c6..ed3eb53 100644 --- a/src/plant.rs +++ b/src/plant.rs @@ -67,10 +67,10 @@ impl Genome { - self.nutrient_addition_rate() * 0.16 // nutrient enrichment has a growth tradeoff - self.water_tolerance * 0.08 - self.temperature_tolerance * 0.07 - - self.salt_tolerance.max(0.0) * 0.15; + - self.salt_tolerance.max(0.0) * 0.05; - let water_tolerance_coefficient = 15.0 * (1.0 + (-self.water_tolerance).exp()); - let temperature_tolerance_coefficient = 12.0 * (1.0 + (-self.temperature_tolerance).exp()); + let water_tolerance_coefficient = 13.0 * (1.0 + (-self.water_tolerance).exp()); + let temperature_tolerance_coefficient = 3.0 * (1.0 + (-self.temperature_tolerance).exp()); let salt_tolerance_coefficient = 8.0 * (-self.salt_tolerance).exp(); base @@ -106,10 +106,10 @@ impl Genome { }; let (nutrient_addition_rate, optimal_water_level, optimal_temperature, reproductive_size_fraction_param, salt_tolerance, max_size) = match crop_type { - CropType::Grass => (-10.0, 0.0, 0.0, -1.0, 0.0, 1.0), - CropType::EucalyptusTree => (-10.0, 1.0, 0.7, 1.0, 0.1, 5.0), + CropType::Grass => (-10.0,-1.0, 0.0, -1.0, 0.0, 1.0), + CropType::EucalyptusTree => (-10.0, 1.0, 0.5, 1.0, 0.1, 5.0), CropType::BushTomato => (-10.0, 0.0, 1.0, -0.3, 0.2, 1.5), - CropType::GoldenWattleTree => ( 2.0, 0.5, 0.7, 0.5, 0.4, 3.0), + CropType::GoldenWattleTree => ( 2.0, 0.5, 0.5, 0.5, 0.4, 3.0), }; diff --git a/src/worldgen.rs b/src/worldgen.rs index 7734047..c2bbf1f 100644 --- a/src/worldgen.rs +++ b/src/worldgen.rs @@ -350,6 +350,7 @@ const NUTRIENT_NOISE_SCALE: f32 = 0.0015; // As a handwave, define soil nutrients to be partly randomized and partly based on water. // This kind of sort of makes sense because nitrogen is partly fixed by plants, which would have grown in water-having areas. +// Update: they covaried way too much so reducing this. pub fn soil_nutrients(groundwater: &Map) -> Map { let mut soil_nutrients = Map::::from_fn(|d| { let c = to_cubic(d); @@ -357,7 +358,7 @@ pub fn soil_nutrients(groundwater: &Map) -> Map { 10.0 + c.x as f32 * NUTRIENT_NOISE_SCALE, c.y as f32 * NUTRIENT_NOISE_SCALE, c.z as f32 * NUTRIENT_NOISE_SCALE - ]) + groundwater[d] + ]) + groundwater[d] * 0.3 }, groundwater.radius); percentilize(&mut soil_nutrients, |x| x.powf(0.4)); soil_nutrients @@ -465,7 +466,7 @@ pub fn simulate_air(heightmap: &Map, sea: &HashSet, scan_dir: CoordV normalize(&mut rain_map, |x| x.powf(0.5)); let rain_map = smooth(&rain_map, 3); - normalize(&mut temperature_map, |x| x); + percentilize(&mut temperature_map, |x| x); // TODO do this more cleanly (rain_map, temperature_map, atmo_humidity) }