diff --git a/assets/world/manifests/shrubs/taiga.ron b/assets/world/manifests/shrubs/taiga.ron index cef20b3f58..fea4f49aaa 100644 --- a/assets/world/manifests/shrubs/taiga.ron +++ b/assets/world/manifests/shrubs/taiga.ron @@ -3,26 +3,26 @@ [ ( specifier: "world.shrub.taiga.bush-0", - center: (4, 4, 3), + center: (4, 4, 2), ), ( specifier: "world.shrub.taiga.bush-1", - center: (4, 4, 3), + center: (4, 4, 2), ), ( specifier: "world.shrub.taiga.bush-2", - center: (4, 4, 3), + center: (4, 4, 2), ), ( specifier: "world.shrub.taiga.bush-3", - center: (4, 4, 2), + center: (4, 4, 1), ), ( specifier: "world.shrub.taiga.bush-4", - center: (3, 3, 2), + center: (3, 3, 1), ), ( specifier: "world.shrub.taiga.bush-5", - center: (4, 4, 2), + center: (4, 4, 1), ), ] diff --git a/world/src/all.rs b/world/src/all.rs index b5acc3bfb6..c340500642 100644 --- a/world/src/all.rs +++ b/world/src/all.rs @@ -82,6 +82,22 @@ impl ForestKind { } } + pub fn shrub_density_factor(&self) -> f32 { + match self { + ForestKind::Palm => 0.2, + ForestKind::Acacia => 0.3, + ForestKind::Baobab => 0.2, + ForestKind::Oak => 0.4, + ForestKind::Chestnut => 0.3, + ForestKind::Cedar => 0.3, + ForestKind::Pine => 0.4, + ForestKind::Birch => 0.65, + ForestKind::Mangrove => 1.0, + ForestKind::Swamp => 0.4, + _ => 0.0, + } + } + pub fn proclivity(&self, env: &Environment) -> f32 { self.ideal_proclivity() * close(env.humid, self.humid_range()) diff --git a/world/src/layer/shrub.rs b/world/src/layer/shrub.rs index 2c7de9a67b..b6a0741787 100644 --- a/world/src/layer/shrub.rs +++ b/world/src/layer/shrub.rs @@ -48,21 +48,26 @@ pub fn apply_shrubs_to(canvas: &mut Canvas, _dynamic_rng: &mut impl Rng) { && col.spawn_rate > 0.9 && col.path.map_or(true, |(d, _, _, _)| d > 6.0) { - Some(Shrub { - wpos: wpos.with_z(col.alt as i32), - seed, - kind: *info - .chunks() - .make_forest_lottery(wpos) - .choose_seeded(seed) - .as_ref()?, + let kind = *info + .chunks() + .make_forest_lottery(wpos) + .choose_seeded(seed) + .as_ref()?; + if rng.gen_bool(kind.shrub_density_factor() as f64) { + Some(Shrub { + wpos: wpos.with_z(col.alt as i32), + seed, + kind, }) } else { None } - }); - } - }); + } else { + None + } + }); + } +}); for shrub in shrub_cache.values().filter_map(|s| s.as_ref()) { let mut rng = ChaChaRng::from_seed(seed_expan::rng_state(shrub.seed));