Added acacia trees, desert bones, fixed minor worldgen issues

This commit is contained in:
Joshua Barretto 2019-07-08 17:41:20 +01:00
parent f823b0c992
commit 14ba09f96b
6 changed files with 31 additions and 5 deletions

BIN
assets/world/structure/natural/ribcage-small.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/world/structure/natural/skull-large.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -366,7 +366,7 @@ pub struct ZCache<'a> {
impl<'a> ZCache<'a> { impl<'a> ZCache<'a> {
pub fn get_z_limits(&self) -> (f32, f32) { pub fn get_z_limits(&self) -> (f32, f32) {
let cave_depth = if self.sample.cave_xy.abs() > 0.9 { let cave_depth = if self.sample.cave_xy.abs() > 0.9 {
(self.sample.alt - self.sample.cave_alt) + 8.0 (self.sample.alt - self.sample.cave_alt + 8.0).max(0.0)
} else { } else {
0.0 0.0
}; };

View File

@ -3,6 +3,7 @@ use crate::{
all::ForestKind, all::ForestKind,
column::{ColumnGen, ColumnSample}, column::{ColumnGen, ColumnSample},
util::{HashCache, RandomPerm, Sampler}, util::{HashCache, RandomPerm, Sampler},
CONFIG,
}; };
use common::{assets, terrain::Structure}; use common::{assets, terrain::Structure};
use lazy_static::lazy_static; use lazy_static::lazy_static;
@ -43,11 +44,15 @@ pub fn structure_gen<'a>(
let st_pos3d = Vec3::new(st_pos.x, st_pos.y, wheight as i32); let st_pos3d = Vec3::new(st_pos.x, st_pos.y, wheight as i32);
let volumes: &'static [_] = if QUIRKY_RAND.get(st_seed) % 64 == 17 { let volumes: &'static [_] = if QUIRKY_RAND.get(st_seed) % 64 == 17 {
&QUIRKY if st_sample.temp > CONFIG.tropical_temp {
&QUIRKY_DRY
} else {
&QUIRKY
}
} else { } else {
match st_sample.forest_kind { match st_sample.forest_kind {
ForestKind::Palm => &PALMS, ForestKind::Palm => &PALMS,
ForestKind::Savannah => &PALMS, ForestKind::Savannah => &ACACIAS,
ForestKind::Oak if QUIRKY_RAND.get(st_seed) % 16 == 7 => &OAK_STUMPS, ForestKind::Oak if QUIRKY_RAND.get(st_seed) % 16 == 7 => &OAK_STUMPS,
ForestKind::Oak => &OAKS, ForestKind::Oak => &OAKS,
ForestKind::Pine => &PINES, ForestKind::Pine => &PINES,
@ -356,6 +361,16 @@ lazy_static! {
st_asset("world/tree/snow_pine/7.vox", (16, 15, 12)), st_asset("world/tree/snow_pine/7.vox", (16, 15, 12)),
st_asset("world/tree/snow_pine/8.vox", (12, 10, 12)), st_asset("world/tree/snow_pine/8.vox", (12, 10, 12)),
]; ];
pub static ref ACACIAS: Vec<Arc<Structure>> = vec![
// snow pines
st_asset("world/tree/acacia/1.vox", (16, 17, 1)),
st_asset("world/tree/acacia/2.vox", (5, 6, 1)),
st_asset("world/tree/acacia/3.vox", (5, 6, 1)),
st_asset("world/tree/acacia/4.vox", (15, 16, 1)),
st_asset("world/tree/acacia/5.vox", (19, 18, 1)),
];
/* /*
// snow birches -> need roots! // snow birches -> need roots!
assets::load_map("world/tree/snow_birch/1.vox", |s: Structure| s assets::load_map("world/tree/snow_birch/1.vox", |s: Structure| s
@ -408,4 +423,9 @@ lazy_static! {
st_asset("world/structure/natural/tower-ruin.vox", (11, 14, 5)), st_asset("world/structure/natural/tower-ruin.vox", (11, 14, 5)),
st_asset("world/structure/natural/witch-hut.vox", (10, 13, 3)), st_asset("world/structure/natural/witch-hut.vox", (10, 13, 3)),
]; ];
pub static ref QUIRKY_DRY: Vec<Arc<Structure>> = vec![
st_asset("world/structure/natural/ribcage-small.vox", (7, 13, 4)),
st_asset("world/structure/natural/skull-large.vox", (15, 20, 4)),
];
} }

View File

@ -92,7 +92,7 @@ impl World {
let (min_z, max_z) = z_cache.get_z_limits(); let (min_z, max_z) = z_cache.get_z_limits();
for z in base_z..(min_z as i32).max(base_z) { for z in base_z..min_z as i32 {
let _ = chunk.set(Vec3::new(x, y, z), stone); let _ = chunk.set(Vec3::new(x, y, z), stone);
} }

View File

@ -439,7 +439,7 @@ impl SimChunk {
forest_kind: if temp > 0.0 { forest_kind: if temp > 0.0 {
if temp > CONFIG.desert_temp { if temp > CONFIG.desert_temp {
ForestKind::Palm ForestKind::Palm
} else if temp > CONFIG.desert_temp { } else if temp > CONFIG.tropical_temp {
ForestKind::Savannah ForestKind::Savannah
} else { } else {
ForestKind::Oak ForestKind::Oak