diff --git a/assets/world/features.ron b/assets/world/features.ron index c2fb99492b..c8d6c8c302 100644 --- a/assets/world/features.ron +++ b/assets/world/features.ron @@ -13,4 +13,6 @@ site2_towns: true, site2_giant_trees: true, wildlife_density: 1.0, + peak_naming: true, + biome_naming: true, ) diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index 17967b51da..26ce54ad7b 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -81,10 +81,14 @@ impl Civs { let rng = ChaChaRng::from_seed(seed_expan::rng_state(seed)); let initial_civ_count = initial_civ_count(sim.map_size_lg()); let mut ctx = GenCtx { sim, rng }; - info!("starting peak naming"); - this.name_peaks(&mut ctx); - info!("starting biome naming"); - this.name_biomes(&mut ctx); + if index.features().peak_naming { + info!("starting peak naming"); + this.name_peaks(&mut ctx); + } + if index.features().biome_naming { + info!("starting biome naming"); + this.name_biomes(&mut ctx); + } for _ in 0..ctx.sim.get_size().product() / 10_000 { this.generate_cave(&mut ctx); @@ -775,9 +779,11 @@ impl Civs { let center = biome .1 .iter() - .map(|b| uniform_idx_as_vec2(map_size_lg, *b)) - .sum::>() - / biome.1.len() as i32; + .map(|b| { + uniform_idx_as_vec2(map_size_lg, *b).as_::() / biome.1.len() as f32 + }) + .sum::>() + .as_::(); // Select the point closest to the center let idx = *biome .1 diff --git a/world/src/config.rs b/world/src/config.rs index d81427928b..8b406be0b3 100644 --- a/world/src/config.rs +++ b/world/src/config.rs @@ -91,6 +91,8 @@ pub struct Features { pub site2_giant_trees: bool, // 1.0 is the default wildlife density pub wildlife_density: f32, + pub peak_naming: bool, + pub biome_naming: bool, } impl assets::Asset for Features {