Merge branch 'zesterer/enable-site2-towns' into 'master'

Enabled site2 towns by default

See merge request veloren/veloren!3206
This commit is contained in:
Marcel 2022-02-20 14:02:53 +00:00
commit 6506a97dcd
7 changed files with 25 additions and 15 deletions

BIN
assets/voxygen/voxel/sprite/ember/1.vox (Stored with Git LFS)

Binary file not shown.

View File

@ -1341,11 +1341,11 @@ Ember: Some((
variations: [
(
model: "voxygen.voxel.sprite.ember.1",
offset: (-7.0, -7.0, -2.9),
offset: (-5.5, -5.5, -2.9),
lod_axes: (1.0, 1.0, 0.0),
),
],
wind_sway: 0.8,
wind_sway: 0.0,
)),
// Smoke dummy
Smoke: Some((

View File

@ -9,6 +9,7 @@
scatter: true,
paths: true,
spots: true,
site2: false,
site2_towns: true,
site2_giant_trees: false,
wildlife_density: 1.0,
)

View File

@ -403,10 +403,13 @@ impl Server {
Some(t) => t.center,
None => {
let center_chunk = world.sim().map_size_lg().chunks().map(i32::from) / 2;
use world::civ::SiteKind;
world
.civs()
.sites()
.filter(|site| matches!(site.kind, world::civ::SiteKind::Settlement))
.filter(|site| {
matches!(site.kind, SiteKind::Settlement | SiteKind::Refactor)
})
.map(|site| site.center)
.min_by_key(|site_pos| site_pos.distance_squared(center_chunk))
.unwrap_or(center_chunk)

View File

@ -101,10 +101,9 @@ impl Civs {
for _ in 0..initial_civ_count * 3 {
attempt(5, || {
let (kind, size) = match ctx.rng.gen_range(0..64) {
0..=4 => (SiteKind::Castle, 3),
5..=28 if index.features().site2 => (SiteKind::Refactor, 6),
29..=31 => {
if index.features().site2 {
0..=5 => (SiteKind::Castle, 3),
28..=31 => {
if index.features().site2_giant_trees {
(SiteKind::GiantTree, 4)
} else {
(SiteKind::Tree, 4)
@ -449,7 +448,7 @@ impl Civs {
}
fn birth_civ(&mut self, ctx: &mut GenCtx<impl Rng>) -> Option<Id<Civ>> {
let kind = SiteKind::Settlement;
let kind = SiteKind::Refactor;
let site = attempt(5, || {
let loc = find_site_loc(ctx, None, 1, kind)?;
Some(self.establish_site(ctx, loc, |place| Site {
@ -1131,7 +1130,7 @@ impl SiteKind {
// FIXME: Provide specific values for each individual SiteKind
match self {
SiteKind::Dungeon => 4,
_ => 2, // This is just an arbitrary value
_ => 8, // This is just an arbitrary value
}
}
}

View File

@ -86,7 +86,8 @@ pub struct Features {
pub scatter: bool,
pub paths: bool,
pub spots: bool,
pub site2: bool,
pub site2_towns: bool,
pub site2_giant_trees: bool,
// 1.0 is the default wildlife density
pub wildlife_density: f32,
}

View File

@ -792,7 +792,7 @@ impl Site {
let alt = canvas.col(wpos2d).map_or(0, |col| col.alt as i32);
let sub_surface_color = canvas
.col(wpos2d)
.map_or(vek::Rgb::zero(), |col| col.sub_surface_color);
.map_or(Rgb::zero(), |col| col.sub_surface_color * 0.5);
let mut underground = true;
for z in -8..6 {
canvas.map(Vec3::new(wpos2d.x, wpos2d.y, alt + z), |b| {
@ -867,6 +867,9 @@ impl Site {
if min_dist.is_some() {
let alt = /*avg_hard_alt.map(|(sum, weight)| sum / weight).unwrap_or_else(||*/ canvas.col(wpos2d).map_or(0.0, |col| col.alt)/*)*/ as i32;
let mut underground = true;
let sub_surface_color = canvas
.col(wpos2d)
.map_or(Rgb::zero(), |col| col.sub_surface_color * 0.5);
for z in -6..4 {
canvas.map(
Vec3::new(wpos2d.x, wpos2d.y, alt + z),
@ -881,7 +884,10 @@ impl Site {
b.into_vacant().with_sprite(sprite)
} else if b.is_filled() {
if b.is_terrain() {
Block::new(BlockKind::Earth, Rgb::new(0x6A, 0x47, 0x24))
Block::new(
BlockKind::Earth,
(sub_surface_color * 255.0).as_(),
)
} else {
b
}