Various visual fixes

This commit is contained in:
Snowram 2021-03-18 01:56:27 +01:00
parent eaaf65127d
commit e5afb2fcf7
8 changed files with 70 additions and 33 deletions

View File

@ -1033,7 +1033,7 @@
(0.0, 0.0, 0.0), (-90.0, 180.0, 0.0), 1.2, (0.0, 0.0, 0.0), (-90.0, 180.0, 0.0), 1.2,
), ),
Armor(Chest("Rugged")): VoxTrans( Armor(Chest("Rugged")): VoxTrans(
"voxel.armor.rugged.pants", "voxel.armor.rugged.chest",
(0.0, 0.0, 0.0), (-90.0, 180.0, 0.0), 1.2, (0.0, 0.0, 0.0), (-90.0, 180.0, 0.0), 1.2,
), ),
Armor(Chest("WorkerPurpBrown")): VoxTrans( Armor(Chest("WorkerPurpBrown")): VoxTrans(

Binary file not shown.

Binary file not shown.

View File

@ -416,7 +416,7 @@ impl Body {
quadruped_low::Species::Rocksnapper => 1000, quadruped_low::Species::Rocksnapper => 1000,
quadruped_low::Species::Pangolin => 80, quadruped_low::Species::Pangolin => 80,
quadruped_low::Species::Maneater => 400, quadruped_low::Species::Maneater => 400,
quadruped_low::Species::Sandshark => 600, quadruped_low::Species::Sandshark => 800,
quadruped_low::Species::Hakulaq => 400, quadruped_low::Species::Hakulaq => 400,
quadruped_low::Species::Lavadrake => 900, quadruped_low::Species::Lavadrake => 900,
quadruped_low::Species::Deadwood => 600, quadruped_low::Species::Deadwood => 600,

View File

@ -523,13 +523,13 @@ impl<'a> From<&'a Body> for SkeletonAttr {
(Donkey, _) => (1.2), (Donkey, _) => (1.2),
(Horse, _) => (1.42), (Horse, _) => (1.42),
(Zebra, _) => (1.3), (Zebra, _) => (1.3),
(Cattle, _) => (1.7), (Cattle, _) => (1.5),
(Highland, _) => (1.7), (Highland, _) => (1.6),
(Bear, _) => (1.7), (Bear, _) => (1.7),
(Yak, _) => (1.7), (Yak, _) => (1.7),
(Camel, _) => (1.42), (Camel, _) => (1.42),
(Dreadhorn, _) => (2.0), (Dreadhorn, _) => (2.0),
(Moose, _) => (1.1), (Moose, _) => (1.2),
(Snowleopard, _) => (1.2), (Snowleopard, _) => (1.2),
_ => (1.0), _ => (1.0),
}, },

View File

@ -161,7 +161,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
(Beaver, _) => (2.0, 6.0), (Beaver, _) => (2.0, 6.0),
(Hare, Male) => (-2.0, 7.0), (Hare, Male) => (-2.0, 7.0),
(Hare, Female) => (-2.0, 6.0), (Hare, Female) => (-2.0, 6.0),
(Dog, _) => (-2.0, 9.5), (Dog, _) => (-2.0, 8.5),
(Goat, _) => (2.0, 7.5), (Goat, _) => (2.0, 7.5),
}, },
feet_f: match (body.species, body.body_type) { feet_f: match (body.species, body.body_type) {

View File

@ -17,25 +17,29 @@ impl Animation for RunAnimation {
fn update_skeleton_inner( fn update_skeleton_inner(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency, (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency,
_anim_time: f32, anim_time: f32,
_rate: &mut f32, _rate: &mut f32,
s_a: &SkeletonAttr, s_a: &SkeletonAttr,
) -> Self::Skeleton { ) -> Self::Skeleton {
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let lab: f32 = 0.8; //6 let lab: f32 = 0.42;
let speed = (Vec2::<f32>::from(velocity).magnitude()).min(12.0); let speed = (Vec2::<f32>::from(velocity).magnitude()).min(12.0);
let speednorm = (speed / 12.0).powf(0.4); let speednorm = (speed / 12.0).powf(0.4);
// acc_vel and anim_time mix to make sure phase lenght isn't starting at
// +infinite
let mixed_vel = acc_vel + anim_time * 12.0;
let speedmult = s_a.tempo; let speedmult = s_a.tempo;
let short = (acc_vel * lab * speedmult + PI * 1.0).sin() * speednorm; let short = (mixed_vel * lab * speedmult + PI * 1.0).sin() * speednorm;
let shortalt = (acc_vel * lab * speedmult + PI * 0.5).sin() * speednorm; let shortalt = (mixed_vel * lab * speedmult + PI * 0.5).sin() * speednorm;
let footvert = (acc_vel * lab * speedmult + PI * 0.0).sin() * speednorm; let footvert = (mixed_vel * lab * speedmult + PI * 0.0).sin() * speednorm;
let footvertt = (acc_vel * lab * speedmult + PI * 0.4).sin() * speednorm; let footvertt = (mixed_vel * lab * speedmult + PI * 0.4).sin() * speednorm;
let footvertf = (acc_vel * lab * speedmult + PI * 0.3).sin() * speednorm; let footvertf = (mixed_vel * lab * speedmult + PI * 0.3).sin() * speednorm;
let footverttf = (acc_vel * lab * speedmult + PI * 0.7).sin() * speednorm; let footverttf = (mixed_vel * lab * speedmult + PI * 0.7).sin() * speednorm;
let ori: Vec2<f32> = Vec2::from(orientation); let ori: Vec2<f32> = Vec2::from(orientation);
let last_ori = Vec2::from(last_ori); let last_ori = Vec2::from(last_ori);

View File

@ -91,7 +91,9 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
}, },
group_size: 1..2, group_size: 1..2,
is_underwater: false, is_underwater: false,
get_density: |c, _col| close(c.temp, CONFIG.snow_temp, 0.3) * BASE_DENSITY * 1.0, get_density: |c, col| {
close(c.temp, CONFIG.snow_temp, 0.3) * col.tree_density * BASE_DENSITY * 1.4
},
}, },
// Tundra rare solitary ennemies // Tundra rare solitary ennemies
Entry { Entry {
@ -106,7 +108,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
is_underwater: false, is_underwater: false,
get_density: |c, _col| close(c.temp, CONFIG.snow_temp, 0.15) * BASE_DENSITY * 0.5, get_density: |c, _col| close(c.temp, CONFIG.snow_temp, 0.15) * BASE_DENSITY * 0.5,
}, },
// Tundra rare solitary ennemies // Tundra rarer solitary ennemies
Entry { Entry {
make_entity: |pos, rng| { make_entity: |pos, rng| {
EntityInfo::at(pos) EntityInfo::at(pos)
@ -139,7 +141,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry { Entry {
make_entity: |pos, rng| { make_entity: |pos, rng| {
EntityInfo::at(pos) EntityInfo::at(pos)
.with_body(match rng.gen_range(0..3) { .with_body(match rng.gen_range(0..2) {
0 => biped_large::Body::random_with(rng, &biped_large::Species::Wendigo) 0 => biped_large::Body::random_with(rng, &biped_large::Species::Wendigo)
.into(), .into(),
_ => quadruped_medium::Body::random_with( _ => quadruped_medium::Body::random_with(
@ -153,7 +155,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
group_size: 1..2, group_size: 1..2,
is_underwater: false, is_underwater: false,
get_density: |c, col| { get_density: |c, col| {
close(c.temp, CONFIG.snow_temp + 0.2, 0.2) * col.tree_density * BASE_DENSITY * 0.2 close(c.temp, CONFIG.snow_temp + 0.2, 0.2) * col.tree_density * BASE_DENSITY * 0.4
}, },
}, },
// Taiga pack ennemies // Taiga pack ennemies
@ -203,7 +205,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry { Entry {
make_entity: |pos, rng| { make_entity: |pos, rng| {
EntityInfo::at(pos) EntityInfo::at(pos)
.with_body(match rng.gen_range(0..5) { .with_body(match rng.gen_range(0..6) {
0 => { 0 => {
bird_medium::Body::random_with(rng, &bird_medium::Species::Eagle).into() bird_medium::Body::random_with(rng, &bird_medium::Species::Eagle).into()
}, },
@ -218,6 +220,13 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
&quadruped_medium::Species::Moose, &quadruped_medium::Species::Moose,
) )
.into(), .into(),
4 => {
quadruped_small::Body {
species: quadruped_small::Species::Hare,
body_type: quadruped_small::BodyType::Female,
}
}
.into(),
_ => quadruped_medium::Body::random_with( _ => quadruped_medium::Body::random_with(
rng, rng,
&quadruped_medium::Species::Tuskram, &quadruped_medium::Species::Tuskram,
@ -273,7 +282,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry { Entry {
make_entity: |pos, rng| { make_entity: |pos, rng| {
EntityInfo::at(pos) EntityInfo::at(pos)
.with_body(match rng.gen_range(0..13) { .with_body(match rng.gen_range(0..12) {
0 => quadruped_medium::Body::random_with( 0 => quadruped_medium::Body::random_with(
rng, rng,
&quadruped_medium::Species::Deer, &quadruped_medium::Species::Deer,
@ -311,21 +320,17 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
&quadruped_small::Species::Squirrel, &quadruped_small::Species::Squirrel,
) )
.into(), .into(),
8 => { 8 => quadruped_medium::Body::random_with(
quadruped_small::Body::random_with(rng, &quadruped_small::Species::Hare)
.into()
},
9 => quadruped_medium::Body::random_with(
rng, rng,
&quadruped_medium::Species::Horse, &quadruped_medium::Species::Horse,
) )
.into(), .into(),
10 => quadruped_medium::Body::random_with( 9 => quadruped_medium::Body::random_with(
rng, rng,
&quadruped_medium::Species::Cattle, &quadruped_medium::Species::Cattle,
) )
.into(), .into(),
11 => { 10 => {
quadruped_small::Body::random_with(rng, &quadruped_small::Species::Goat) quadruped_small::Body::random_with(rng, &quadruped_small::Species::Goat)
.into() .into()
}, },
@ -339,7 +344,6 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
get_density: |c, _col| { get_density: |c, _col| {
close(c.temp, CONFIG.temperate_temp + 0.1, 0.6) close(c.temp, CONFIG.temperate_temp + 0.1, 0.6)
* close(c.humidity, CONFIG.forest_hum, 0.6) * close(c.humidity, CONFIG.forest_hum, 0.6)
//* col.tree_density
* BASE_DENSITY * BASE_DENSITY
* 4.0 * 4.0
}, },
@ -468,6 +472,30 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
} }
}, },
}, },
// Temperate rare river ennemies
Entry {
make_entity: |pos, rng| {
EntityInfo::at(pos)
.with_body(
quadruped_medium::Body::random_with(
rng,
&quadruped_medium::Species::Kelpie,
)
.into(),
)
.with_alignment(Alignment::Wild)
},
group_size: 1..2,
is_underwater: false,
get_density: |_c, col| {
close(col.temp, CONFIG.temperate_temp, 0.6)
* if col.water_dist.map(|d| d < 10.0).unwrap_or(false) {
0.00005
} else {
0.0
}
},
},
// Temperate river ennemies // Temperate river ennemies
Entry { Entry {
make_entity: |pos, rng| { make_entity: |pos, rng| {
@ -733,7 +761,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
close(c.temp, CONFIG.desert_temp + 0.2, 0.3) close(c.temp, CONFIG.desert_temp + 0.2, 0.3)
* close(c.humidity, CONFIG.desert_hum, 0.5) * close(c.humidity, CONFIG.desert_hum, 0.5)
* BASE_DENSITY * BASE_DENSITY
* 1.5 * 1.3
}, },
}, },
// Desert rare solitary enemies // Desert rare solitary enemies
@ -807,7 +835,7 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
Entry { Entry {
make_entity: |pos, rng| { make_entity: |pos, rng| {
EntityInfo::at(pos) EntityInfo::at(pos)
.with_body(match rng.gen_range(0..6) { .with_body(match rng.gen_range(0..7) {
0 => quadruped_small::Body::random_with( 0 => quadruped_small::Body::random_with(
rng, rng,
&quadruped_small::Species::Holladon, &quadruped_small::Species::Holladon,
@ -832,6 +860,11 @@ pub fn apply_wildlife_supplement<'a, R: Rng>(
&quadruped_small::Species::Porcupine, &quadruped_small::Species::Porcupine,
) )
.into(), .into(),
5 => quadruped_small::Body {
species: quadruped_small::Species::Hare,
body_type: quadruped_small::BodyType::Male,
}
.into(),
_ => quadruped_small::Body::random_with( _ => quadruped_small::Body::random_with(
rng, rng,
&quadruped_small::Species::Gecko, &quadruped_small::Species::Gecko,