mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Remove debug lines, re-mix some sfx, add crafting sfx, separate inv event sfx into spatial and nonspatial
This commit is contained in:
parent
234ed5afb2
commit
088d1cfe9d
BIN
assets/voxygen/audio/ambience/leaves.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/ambience/leaves.ogg
(Stored with Git LFS)
Binary file not shown.
@ -155,7 +155,7 @@
|
|||||||
"voxygen.audio.sfx.footsteps.stepgrass_5",
|
"voxygen.audio.sfx.footsteps.stepgrass_5",
|
||||||
"voxygen.audio.sfx.footsteps.stepgrass_6",
|
"voxygen.audio.sfx.footsteps.stepgrass_6",
|
||||||
],
|
],
|
||||||
threshold: 1.6,
|
threshold: 1.8,
|
||||||
),
|
),
|
||||||
QuadRun(Grass): (
|
QuadRun(Grass): (
|
||||||
files: [
|
files: [
|
||||||
@ -166,7 +166,7 @@
|
|||||||
"voxygen.audio.sfx.footsteps.stepgrass_5",
|
"voxygen.audio.sfx.footsteps.stepgrass_5",
|
||||||
"voxygen.audio.sfx.footsteps.stepgrass_6",
|
"voxygen.audio.sfx.footsteps.stepgrass_6",
|
||||||
],
|
],
|
||||||
threshold: 0.8,
|
threshold: 0.9,
|
||||||
),
|
),
|
||||||
// For when sand 1) exists and 2) has unique sounds
|
// For when sand 1) exists and 2) has unique sounds
|
||||||
// Run(Sand): (
|
// Run(Sand): (
|
||||||
@ -195,7 +195,7 @@
|
|||||||
"voxygen.audio.sfx.footsteps.snow_step_2",
|
"voxygen.audio.sfx.footsteps.snow_step_2",
|
||||||
"voxygen.audio.sfx.footsteps.snow_step_3",
|
"voxygen.audio.sfx.footsteps.snow_step_3",
|
||||||
],
|
],
|
||||||
threshold: 1.6,
|
threshold: 1.8,
|
||||||
),
|
),
|
||||||
QuadRun(Snow): (
|
QuadRun(Snow): (
|
||||||
files: [
|
files: [
|
||||||
@ -203,7 +203,7 @@
|
|||||||
"voxygen.audio.sfx.footsteps.snow_step_2",
|
"voxygen.audio.sfx.footsteps.snow_step_2",
|
||||||
"voxygen.audio.sfx.footsteps.snow_step_3",
|
"voxygen.audio.sfx.footsteps.snow_step_3",
|
||||||
],
|
],
|
||||||
threshold: 0.8,
|
threshold: 0.9,
|
||||||
),
|
),
|
||||||
Run(Rock): (
|
Run(Rock): (
|
||||||
files: [
|
files: [
|
||||||
@ -220,7 +220,7 @@
|
|||||||
"voxygen.audio.sfx.footsteps.stone_step_11",
|
"voxygen.audio.sfx.footsteps.stone_step_11",
|
||||||
"voxygen.audio.sfx.footsteps.stone_step_12",
|
"voxygen.audio.sfx.footsteps.stone_step_12",
|
||||||
],
|
],
|
||||||
threshold: 1.6,
|
threshold: 1.8,
|
||||||
),
|
),
|
||||||
QuadRun(Rock): (
|
QuadRun(Rock): (
|
||||||
files: [
|
files: [
|
||||||
@ -237,14 +237,14 @@
|
|||||||
"voxygen.audio.sfx.footsteps.stone_step_11",
|
"voxygen.audio.sfx.footsteps.stone_step_11",
|
||||||
"voxygen.audio.sfx.footsteps.stone_step_12",
|
"voxygen.audio.sfx.footsteps.stone_step_12",
|
||||||
],
|
],
|
||||||
threshold: 0.8,
|
threshold: 0.9,
|
||||||
),
|
),
|
||||||
Roll: (
|
Roll: (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.character.dive_roll_1",
|
"voxygen.audio.sfx.character.dive_roll_1",
|
||||||
"voxygen.audio.sfx.character.dive_roll_2",
|
"voxygen.audio.sfx.character.dive_roll_2",
|
||||||
],
|
],
|
||||||
threshold: 0.25,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Climb: (
|
Climb: (
|
||||||
files: [
|
files: [
|
||||||
@ -620,6 +620,12 @@
|
|||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
|
Inventory(Craft): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.crafting.hammer",
|
||||||
|
],
|
||||||
|
threshold: 0.05,
|
||||||
|
),
|
||||||
|
|
||||||
//
|
//
|
||||||
// Consumables
|
// Consumables
|
||||||
|
BIN
assets/voxygen/audio/sfx/ambient/bees_1.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/bees_1.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/birdcall_1.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/birdcall_1.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/birdcall_2.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/birdcall_2.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/ambient/frog_croak_1.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/ambient/frog_croak_1.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/dive_roll_1.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/character/dive_roll_1.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/dive_roll_2.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/character/dive_roll_2.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/crafting/hammer.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/crafting/hammer.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/footsteps/snow_step_1.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/footsteps/snow_step_1.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/footsteps/snow_step_2.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/footsteps/snow_step_2.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/footsteps/snow_step_3.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/footsteps/snow_step_3.ogg
(Stored with Git LFS)
Binary file not shown.
@ -57,14 +57,11 @@ impl AmbientMgr {
|
|||||||
};
|
};
|
||||||
// if the conditions warrant creating a channel of that tag
|
// if the conditions warrant creating a channel of that tag
|
||||||
if should_create && audio.get_ambient_channel(tag).is_none() {
|
if should_create && audio.get_ambient_channel(tag).is_none() {
|
||||||
println!("No audio channel with this tag: {:?}", tag);
|
|
||||||
// iterate through the supposed number of channels - one for each tag
|
// iterate through the supposed number of channels - one for each tag
|
||||||
for index in 0..AmbientChannelTag::iter().len() {
|
for index in 0..AmbientChannelTag::iter().len() {
|
||||||
println!("Iter on channel index {:?}", index);
|
|
||||||
// if index would exceed current number of channels, create a new one with
|
// if index would exceed current number of channels, create a new one with
|
||||||
// current tag
|
// current tag
|
||||||
if index >= audio.ambient_channels.len() {
|
if index >= audio.ambient_channels.len() {
|
||||||
println!("Creating audio channel with this tag: {:?}", tag);
|
|
||||||
audio.new_ambient_channel(tag);
|
audio.new_ambient_channel(tag);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -73,10 +70,6 @@ impl AmbientMgr {
|
|||||||
// channel with that tag, but a channel with
|
// channel with that tag, but a channel with
|
||||||
// that tag remains nonetheless, run the code
|
// that tag remains nonetheless, run the code
|
||||||
} else if audio.get_ambient_channel(tag).is_some() {
|
} else if audio.get_ambient_channel(tag).is_some() {
|
||||||
println!(
|
|
||||||
"Channel for {:?} is actually present, performing volume code",
|
|
||||||
tag
|
|
||||||
);
|
|
||||||
for index in 0..AmbientChannelTag::iter().len() {
|
for index in 0..AmbientChannelTag::iter().len() {
|
||||||
// update with sfx volume
|
// update with sfx volume
|
||||||
audio.ambient_channels[index].set_volume(sfx_volume);
|
audio.ambient_channels[index].set_volume(sfx_volume);
|
||||||
@ -124,11 +117,6 @@ impl AmbientMgr {
|
|||||||
|
|
||||||
// remove channel if not playing
|
// remove channel if not playing
|
||||||
if audio.ambient_channels[index].get_multiplier() == 0.0 {
|
if audio.ambient_channels[index].get_multiplier() == 0.0 {
|
||||||
println!(
|
|
||||||
"Removing channel {:?} with tag {:?}",
|
|
||||||
index,
|
|
||||||
audio.ambient_channels[index].get_tag()
|
|
||||||
);
|
|
||||||
audio.ambient_channels[index].stop();
|
audio.ambient_channels[index].stop();
|
||||||
audio.ambient_channels.remove(index);
|
audio.ambient_channels.remove(index);
|
||||||
};
|
};
|
||||||
@ -189,10 +177,10 @@ impl AmbientMgr {
|
|||||||
// Tree density factors into wind volume. The more trees,
|
// Tree density factors into wind volume. The more trees,
|
||||||
// the lower wind volume. The trees make more of an impact
|
// the lower wind volume. The trees make more of an impact
|
||||||
// the closer the camera is to the ground.
|
// the closer the camera is to the ground.
|
||||||
let tree_multiplier = 1.0
|
let tree_multiplier =
|
||||||
- (((1.0 - tree_density) + ((cam_pos.z - terrain_alt).abs() / 150.0).powi(2)).min(1.0));
|
1.0 - (((1.0 - tree_density) + ((cam_pos.z - terrain_alt + 20.0).abs() / 150.0).powi(2)).min(1.0));
|
||||||
|
|
||||||
return tree_multiplier > 0.05;
|
return tree_multiplier > 0.1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,10 +299,10 @@ impl AmbientChannel {
|
|||||||
// Tree density factors into wind volume. The more trees,
|
// Tree density factors into wind volume. The more trees,
|
||||||
// the lower wind volume. The trees make more of an impact
|
// the lower wind volume. The trees make more of an impact
|
||||||
// the closer the camera is to the ground.
|
// the closer the camera is to the ground.
|
||||||
let tree_multiplier = 1.0
|
let tree_multiplier =
|
||||||
- (((1.0 - tree_density) + ((cam_pos.z - terrain_alt).abs() / 150.0).powi(2)).min(1.0));
|
1.0 - (((1.0 - tree_density) + ((cam_pos.z - terrain_alt + 20.0).abs() / 150.0).powi(2)).min(1.0));
|
||||||
|
|
||||||
if tree_multiplier > 0.05 {
|
if tree_multiplier > 0.1 {
|
||||||
tree_multiplier
|
tree_multiplier
|
||||||
} else {
|
} else {
|
||||||
0.0
|
0.0
|
||||||
|
@ -296,6 +296,7 @@ pub enum SfxInventoryEvent {
|
|||||||
Dropped,
|
Dropped,
|
||||||
Given,
|
Given,
|
||||||
Swapped,
|
Swapped,
|
||||||
|
Craft,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Move to a separate event mapper?
|
// TODO Move to a separate event mapper?
|
||||||
@ -328,6 +329,7 @@ impl From<&InventoryUpdateEvent> for SfxEvent {
|
|||||||
InventoryUpdateEvent::Dropped => SfxEvent::Inventory(SfxInventoryEvent::Dropped),
|
InventoryUpdateEvent::Dropped => SfxEvent::Inventory(SfxInventoryEvent::Dropped),
|
||||||
InventoryUpdateEvent::Given => SfxEvent::Inventory(SfxInventoryEvent::Given),
|
InventoryUpdateEvent::Given => SfxEvent::Inventory(SfxInventoryEvent::Given),
|
||||||
InventoryUpdateEvent::Swapped => SfxEvent::Inventory(SfxInventoryEvent::Swapped),
|
InventoryUpdateEvent::Swapped => SfxEvent::Inventory(SfxInventoryEvent::Swapped),
|
||||||
|
InventoryUpdateEvent::Craft => SfxEvent::Inventory(SfxInventoryEvent::Craft),
|
||||||
_ => SfxEvent::Inventory(SfxInventoryEvent::Swapped),
|
_ => SfxEvent::Inventory(SfxInventoryEvent::Swapped),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -245,10 +245,26 @@ impl SessionState {
|
|||||||
let sfx_triggers = self.scene.sfx_mgr.triggers.read();
|
let sfx_triggers = self.scene.sfx_mgr.triggers.read();
|
||||||
|
|
||||||
let sfx_trigger_item = sfx_triggers.get_key_value(&SfxEvent::from(&inv_event));
|
let sfx_trigger_item = sfx_triggers.get_key_value(&SfxEvent::from(&inv_event));
|
||||||
|
|
||||||
|
match inv_event {
|
||||||
|
InventoryUpdateEvent::Dropped
|
||||||
|
| InventoryUpdateEvent::Swapped
|
||||||
|
| InventoryUpdateEvent::Given
|
||||||
|
| InventoryUpdateEvent::Collected(_)
|
||||||
|
| InventoryUpdateEvent::EntityCollectFailed(_)
|
||||||
|
| InventoryUpdateEvent::BlockCollectFailed(_)
|
||||||
|
| InventoryUpdateEvent::Craft => {
|
||||||
global_state
|
global_state
|
||||||
.audio
|
.audio
|
||||||
.emit_sfx_item(sfx_trigger_item, Some(1.0));
|
.emit_sfx_item(sfx_trigger_item, Some(1.0));
|
||||||
|
|
||||||
|
}
|
||||||
|
_ => global_state
|
||||||
|
.audio
|
||||||
|
.emit_sfx(sfx_trigger_item, client.position().unwrap_or_default(), Some(1.0), false)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
match inv_event {
|
match inv_event {
|
||||||
InventoryUpdateEvent::BlockCollectFailed { pos, reason } => {
|
InventoryUpdateEvent::BlockCollectFailed { pos, reason } => {
|
||||||
self.hud.add_failed_block_pickup(
|
self.hud.add_failed_block_pickup(
|
||||||
|
Loading…
Reference in New Issue
Block a user