diff --git a/assets/common/entity/spot/bandit_camp/dwarf_grave_robber.ron b/assets/common/entity/spot/bandit_camp/dwarf_grave_robber.ron index 5c8039265b..19dc7aa711 100644 --- a/assets/common/entity/spot/bandit_camp/dwarf_grave_robber.ron +++ b/assets/common/entity/spot/bandit_camp/dwarf_grave_robber.ron @@ -3,7 +3,7 @@ EntityConfig ( body: RandomWith("dwarf"), alignment: Alignment(Enemy), - loot: LootTable("common.loot_tables.creature.biped_large.saurok"), + loot: LootTable("common.loot_tables.humanoids"), hands: TwoHanded(Item("common.items.weapons.hammer.steel_hammer-3")), diff --git a/assets/common/entity/spot/bandit_camp/grim_salvager.ron b/assets/common/entity/spot/bandit_camp/grim_salvager.ron index 77cf951256..c2265d86df 100644 --- a/assets/common/entity/spot/bandit_camp/grim_salvager.ron +++ b/assets/common/entity/spot/bandit_camp/grim_salvager.ron @@ -3,7 +3,7 @@ EntityConfig ( body: RandomWith("humanoid"), alignment: Alignment(Enemy), - loot: LootTable("common.loot_tables.creature.biped_large.saurok"), + loot: LootTable("common.loot_tables.humanoids"), hands: TwoHanded(Item("common.items.weapons.hammer.steel_hammer-0")), diff --git a/assets/common/entity/spot/bandit_camp/witch_dark.ron b/assets/common/entity/spot/bandit_camp/witch_dark.ron index 6e3bbcdad5..1990d9ec48 100644 --- a/assets/common/entity/spot/bandit_camp/witch_dark.ron +++ b/assets/common/entity/spot/bandit_camp/witch_dark.ron @@ -1,9 +1,9 @@ EntityConfig ( name: Name("Witch"), body: Exact(Humanoid(Body( - species: Human, - body_type: Female, - hair_style: 2, + species: Human, + body_type: Female, + hair_style: 2, beard: 0, eyes: 0, accessory: 0, @@ -13,7 +13,7 @@ EntityConfig ( ))), alignment: Alignment(Enemy), - loot: LootTable("common.loot_tables.creature.biped_large.saurok"), + loot: LootTable("common.loot_tables.humanoids"), hands: TwoHanded(Item("common.items.weapons.sceptre.belzeshrub")), diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index 0f243192ac..04c3a312a2 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -11,12 +11,14 @@ use core::ops::{Div, Mul, Range}; use serde::Deserialize; use vek::*; +type Gradients = Vec>; + #[derive(Deserialize)] pub struct Colors { // TODO(@Sharp): After the merge, construct enough infrastructure to make it convenient to // define mapping functions over the input; i.e. we should be able to interpret some fields as // defining App, Arg>, where Fun : (Context, Arg) → (S, Type). - pub structure_blocks: structure::structure_block::PureCases>>>, + pub structure_blocks: structure::structure_block::PureCases>, } pub struct BlockGen<'a> { @@ -297,7 +299,7 @@ pub fn block_from_structure( .as_ref() .map(Vec::as_slice) .unwrap_or(&[]); - let range = if ranges.len() == 0 { + let range = if ranges.is_empty() { None } else { ranges.get(RandomPerm::new(structure_seed).get(13) as usize % ranges.len()) diff --git a/world/src/layer/spot.rs b/world/src/layer/spot.rs index f90fc5759a..3b01747005 100644 --- a/world/src/layer/spot.rs +++ b/world/src/layer/spot.rs @@ -405,7 +405,7 @@ pub fn apply_spots_to(canvas: &mut Canvas, _dynamic_rng: &mut impl Rng) { .map(|c| c.alt as i32) .unwrap_or(0), ); - canvas.blit_structure(origin, &structure, seed, units, true); + canvas.blit_structure(origin, structure, seed, units, true); } // Spawn entities diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index b885d835ff..799a91894c 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -430,7 +430,7 @@ impl TreeConfig { splits: 1.75..2.0, split_range: 0.75..1.5, branch_len_bias: 0.0, - leaf_vertical_scale: 0.2, + leaf_vertical_scale: 0.4, proportionality: 0.0, inhabited: false, hanging_sprites: &[(0.0005, SpriteKind::Beehive)], @@ -478,7 +478,7 @@ impl TreeConfig { splits: 3.0..3.5, split_range: 0.5..1.25, branch_len_bias: 0.0, - leaf_vertical_scale: 0.35, + leaf_vertical_scale: 0.5, proportionality: 0.5, inhabited: false, hanging_sprites: &[(0.0005, SpriteKind::Beehive)], @@ -577,7 +577,7 @@ impl ProceduralTree { for _ in 0..4 { let dir = Vec3::new(rng.gen_range(-1.0..1.0), rng.gen_range(-1.0..1.0), -1.0).normalized(); - let len = 8.0; + let len = config.trunk_len * 0.75; let radius = config.trunk_radius; let mut aabb = Aabb { min: trunk_origin, diff --git a/world/src/site/tree.rs b/world/src/site/tree.rs index 4662f8af8b..75bc9b66bb 100644 --- a/world/src/site/tree.rs +++ b/world/src/site/tree.rs @@ -61,13 +61,11 @@ impl Tree { let (branch, leaves, _, _) = self.tree.is_branch_or_leaves_at(rposf); - if branch || leaves { - if above && col.snow_cover { - canvas.set( - wpos + Vec3::unit_z(), - Block::new(BlockKind::Snow, Rgb::new(255, 255, 255)), - ); - } + if (branch || leaves) && above && col.snow_cover { + canvas.set( + wpos + Vec3::unit_z(), + Block::new(BlockKind::Snow, Rgb::new(255, 255, 255)), + ); } let block = if leaves { diff --git a/world/src/site2/gen.rs b/world/src/site2/gen.rs index 9e1fd2379d..7db069d0de 100644 --- a/world/src/site2/gen.rs +++ b/world/src/site2/gen.rs @@ -31,7 +31,7 @@ pub enum Primitive { /// A sampling function is always a subset of another primitive to avoid /// needing infinite bounds Sampling(Id, Box) -> bool>), - Prefab(PrefabStructure), + Prefab(Box), // Combinators And(Id, Id), @@ -52,7 +52,7 @@ pub enum Fill { // TODO: the offset field for Prefab is a hack that breaks the compositionality of Translate, // we probably need an evaluator for the primitive tree that gets which point is queried at // leaf nodes given an input point to make Translate/Rotate work generally - Prefab(PrefabStructure, Vec3, u32), + Prefab(Box, Vec3, u32), Sampling(Arc) -> Option>), } diff --git a/world/src/site2/plot/dungeon.rs b/world/src/site2/plot/dungeon.rs index 3455861297..d6eb8143c3 100644 --- a/world/src/site2/plot/dungeon.rs +++ b/world/src/site2/plot/dungeon.rs @@ -1383,9 +1383,12 @@ impl SiteStructure for Dungeon { let entrances = entrances.read(); let entrance = entrances[self.seed as usize % entrances.len()].clone(); - let entrance_prim = prim(Primitive::Prefab(entrance.clone())); + let entrance_prim = prim(Primitive::Prefab(Box::new(entrance.clone()))); let entrance_prim = prim(Primitive::Translate(entrance_prim, origin)); - fill(entrance_prim, Fill::Prefab(entrance, origin, self.seed)); + fill( + entrance_prim, + Fill::Prefab(Box::new(entrance), origin, self.seed), + ); let mut z = self.alt + ALT_OFFSET; for floor in &self.floors {