mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
- make individual size thresholds for biome name generation to include small lakes
- add original Lake naming pattern, partly (no water_alt check)
This commit is contained in:
parent
ced1a82824
commit
609d23ae4f
@ -517,43 +517,57 @@ impl Civs {
|
||||
center /= 2;
|
||||
});
|
||||
// Select the point closest to the center
|
||||
|
||||
let idx = *biome
|
||||
.1
|
||||
.iter()
|
||||
.min_by_key(|&b| center.distance_squared(uniform_idx_as_vec2(map_size_lg, *b)))
|
||||
.unwrap();
|
||||
if biome.1.len() as u32 > 750 {
|
||||
let name = match biome.0 {
|
||||
common::terrain::BiomeKind::Forest => format!(
|
||||
"{}\n{:?}",
|
||||
NameGen::location(&mut ctx.rng).generate_forest(),
|
||||
biome.0
|
||||
),
|
||||
common::terrain::BiomeKind::Grassland
|
||||
| common::terrain::BiomeKind::Lake
|
||||
| common::terrain::BiomeKind::Ocean
|
||||
| common::terrain::BiomeKind::Mountain
|
||||
| common::terrain::BiomeKind::Snowland
|
||||
| common::terrain::BiomeKind::Desert
|
||||
| common::terrain::BiomeKind::Swamp
|
||||
| common::terrain::BiomeKind::Jungle
|
||||
| common::terrain::BiomeKind::Savannah
|
||||
| common::terrain::BiomeKind::Taiga => format!(
|
||||
let name = match biome.0 {
|
||||
common::terrain::BiomeKind::Forest if biome.1.len() as u32 > 750 => format!(
|
||||
"{}\n{:?}",
|
||||
NameGen::location(&mut ctx.rng).generate_forest(),
|
||||
biome.0
|
||||
),
|
||||
common::terrain::BiomeKind::Grassland
|
||||
| common::terrain::BiomeKind::Ocean
|
||||
| common::terrain::BiomeKind::Mountain
|
||||
| common::terrain::BiomeKind::Snowland
|
||||
| common::terrain::BiomeKind::Desert
|
||||
| common::terrain::BiomeKind::Swamp
|
||||
| common::terrain::BiomeKind::Jungle
|
||||
| common::terrain::BiomeKind::Savannah
|
||||
| common::terrain::BiomeKind::Taiga
|
||||
if biome.1.len() as u32 > 750 =>
|
||||
{
|
||||
format!(
|
||||
"{}\n{:?}",
|
||||
NameGen::location(&mut ctx.rng).generate_biome(),
|
||||
biome.0
|
||||
),
|
||||
_ => String::new(),
|
||||
};
|
||||
let id = self.pois.insert(PointOfInterest {
|
||||
name,
|
||||
loc: uniform_idx_as_vec2(map_size_lg, idx),
|
||||
kind: PoiKind::Biome(biome.1.len() as u32),
|
||||
});
|
||||
for chunk in biome.1 {
|
||||
ctx.sim.chunks[chunk].poi = Some(id);
|
||||
}
|
||||
)
|
||||
},
|
||||
common::terrain::BiomeKind::Lake if biome.1.len() as u32 > 200 => {
|
||||
match ctx.rng.gen_range(0..6) {
|
||||
0 => format!("{} Lake", NameGen::location(&mut ctx.rng).generate()),
|
||||
1 => format!("Loch {}", NameGen::location(&mut ctx.rng).generate()),
|
||||
_ => format!("{} Lake", NameGen::location(&mut ctx.rng).generate()),
|
||||
}
|
||||
},
|
||||
common::terrain::BiomeKind::Lake if biome.1.len() as u32 > 10 => {
|
||||
match ctx.rng.gen_range(0..4) {
|
||||
0 => format!("{} Pool", NameGen::location(&mut ctx.rng).generate()),
|
||||
1 => format!("{} Well", NameGen::location(&mut ctx.rng).generate()),
|
||||
_ => format!("{} Pond", NameGen::location(&mut ctx.rng).generate()),
|
||||
}
|
||||
},
|
||||
_ => String::new(),
|
||||
};
|
||||
let id = self.pois.insert(PointOfInterest {
|
||||
name,
|
||||
loc: uniform_idx_as_vec2(map_size_lg, idx),
|
||||
kind: PoiKind::Biome(biome.1.len() as u32),
|
||||
});
|
||||
for chunk in biome.1 {
|
||||
ctx.sim.chunks[chunk].poi = Some(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user