Audio system rework
This commit is contained in:
parent
96f92757b5
commit
347a990421
21 changed files with 173 additions and 29 deletions
|
|
@ -1,9 +1,6 @@
|
|||
^ - completed
|
||||
|
||||
Current plans:
|
||||
Audio system:
|
||||
Positional sound
|
||||
Distance and wall dampening
|
||||
Molikman's abilities:
|
||||
Molik:
|
||||
Visuals
|
||||
|
|
|
|||
10
audio/audio_system/team_amplified_audio.gd
Normal file
10
audio/audio_system/team_amplified_audio.gd
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
extends MultiplayerAudio3D
|
||||
|
||||
class_name TeamAmplifiedAudio3D
|
||||
|
||||
@export var team_target: Player
|
||||
@export var team_linear: float = 0.5
|
||||
|
||||
func _ready() -> void:
|
||||
if Lobby.get_team() == team_target.team:
|
||||
volume_linear = team_linear
|
||||
1
audio/audio_system/team_amplified_audio.gd.uid
Normal file
1
audio/audio_system/team_amplified_audio.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://yrc6t1s7mq3t
|
||||
BIN
audio/molik_bounce.ogg
Normal file
BIN
audio/molik_bounce.ogg
Normal file
Binary file not shown.
19
audio/molik_bounce.ogg.import
Normal file
19
audio/molik_bounce.ogg.import
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://dm52cfih0gboj"
|
||||
path="res://.godot/imported/molik_bounce.ogg-aa3b6e68593aa25f430f81d390ff36ef.oggvorbisstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/molik_bounce.ogg"
|
||||
dest_files=["res://.godot/imported/molik_bounce.ogg-aa3b6e68593aa25f430f81d390ff36ef.oggvorbisstr"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
BIN
audio/molik_idle.ogg
Normal file
BIN
audio/molik_idle.ogg
Normal file
Binary file not shown.
19
audio/molik_idle.ogg.import
Normal file
19
audio/molik_idle.ogg.import
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://blnblkd6eoldv"
|
||||
path="res://.godot/imported/molik_idle.ogg-1e8be0eb94ed1a5eb01a085fbd3131be.oggvorbisstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/molik_idle.ogg"
|
||||
dest_files=["res://.godot/imported/molik_idle.ogg-1e8be0eb94ed1a5eb01a085fbd3131be.oggvorbisstr"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=true
|
||||
loop_offset=0.0
|
||||
bpm=0.0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
BIN
audio/molik_land.ogg
Normal file
BIN
audio/molik_land.ogg
Normal file
Binary file not shown.
19
audio/molik_land.ogg.import
Normal file
19
audio/molik_land.ogg.import
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://b7sxkxs7vn4d"
|
||||
path="res://.godot/imported/molik_land.ogg-f7c5f2a0a159fabcc0b4588fc8a2a694.oggvorbisstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/molik_land.ogg"
|
||||
dest_files=["res://.godot/imported/molik_land.ogg-f7c5f2a0a159fabcc0b4588fc8a2a694.oggvorbisstr"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
BIN
audio/shoot.ogg
BIN
audio/shoot.ogg
Binary file not shown.
Binary file not shown.
|
|
@ -1,4 +1,9 @@
|
|||
[gd_resource type="AudioBusLayout" format=3 uid="uid://3dy3a5ai2baq"]
|
||||
[gd_resource type="AudioBusLayout" load_steps=2 format=3 uid="uid://3dy3a5ai2baq"]
|
||||
|
||||
[sub_resource type="AudioEffectReverb" id="AudioEffectReverb_j3pel"]
|
||||
resource_name = "Reverb"
|
||||
room_size = 0.0
|
||||
wet = 0.16
|
||||
|
||||
[resource]
|
||||
bus/1/name = &"GameplayMain"
|
||||
|
|
@ -7,6 +12,8 @@ bus/1/mute = false
|
|||
bus/1/bypass_fx = false
|
||||
bus/1/volume_db = 0.0
|
||||
bus/1/send = &"Master"
|
||||
bus/1/effect/0/effect = SubResource("AudioEffectReverb_j3pel")
|
||||
bus/1/effect/0/enabled = false
|
||||
bus/2/name = &"GameplayMisc"
|
||||
bus/2/solo = false
|
||||
bus/2/mute = false
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ func shoot(id:int , limb_damage: int, torso_damage: int,head_damage: int, distan
|
|||
if collision != {} and collision["collider"] is Player:
|
||||
var hit_player: Player = collision["collider"]
|
||||
var shape_object: CollisionShape3D = hit_player.shape_owner_get_owner(collision["shape"])
|
||||
var reduction: float = 0
|
||||
var reduction: float = 1
|
||||
var damage: int = 0
|
||||
|
||||
match shape_object.get_groups()[0]:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=86 format=4 uid="uid://dpsr6ug3pkb40"]
|
||||
[gd_scene load_steps=87 format=4 uid="uid://dpsr6ug3pkb40"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://3dphlay25fih" path="res://players/player/player.gd" id="1_l07l8"]
|
||||
[ext_resource type="Material" uid="uid://cjb0h3of85nc2" path="res://materials/players/molikman/mat_Molikman.tres" id="2_330gv"]
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://bqdcjq12tbh0s" path="res://gui/weapon_display/weapon_display.tscn" id="14_tgg0h"]
|
||||
[ext_resource type="Script" uid="uid://gan0amqbhi4i" path="res://gui/hud/player_ammo_display.gd" id="15_8nx10"]
|
||||
[ext_resource type="AudioStream" uid="uid://bd4iofirvmiu6" path="res://audio/step_wood.ogg" id="16_0i367"]
|
||||
[ext_resource type="Script" uid="uid://yrc6t1s7mq3t" path="res://audio/audio_system/team_amplified_audio.gd" id="16_l07l8"]
|
||||
[ext_resource type="Script" uid="uid://da0xv360va3b3" path="res://audio/audio_system/multiplayer_audio_3d.gd" id="17_rgc8v"]
|
||||
[ext_resource type="AudioStream" uid="uid://cdf76gyi58rrd" path="res://audio/land_wood.ogg" id="18_cp35a"]
|
||||
[ext_resource type="AudioStream" uid="uid://cc2mp4y3bkpgp" path="res://audio/plant.ogg" id="19_vndcj"]
|
||||
|
|
@ -8642,52 +8643,65 @@ layout_mode = 1
|
|||
[node name="PlayerPropertiesSync" type="MultiplayerSynchronizer" parent="."]
|
||||
replication_config = SubResource("SceneReplicationConfig_qhqgy")
|
||||
|
||||
[node name="StepAudio" type="AudioStreamPlayer3D" parent="."]
|
||||
[node name="StepAudio" type="AudioStreamPlayer3D" parent="." node_paths=PackedStringArray("team_target")]
|
||||
stream = ExtResource("16_0i367")
|
||||
attenuation_model = 1
|
||||
volume_db = -30.0
|
||||
max_distance = 50.0
|
||||
unit_size = 15.0
|
||||
max_distance = 40.0
|
||||
max_polyphony = 10
|
||||
bus = &"GameplayMain"
|
||||
script = ExtResource("17_rgc8v")
|
||||
attenuation_filter_cutoff_hz = 20500.0
|
||||
script = ExtResource("16_l07l8")
|
||||
team_target = NodePath("..")
|
||||
metadata/_custom_type_script = "uid://da0xv360va3b3"
|
||||
|
||||
[node name="LandAudio" type="AudioStreamPlayer3D" parent="."]
|
||||
[node name="LandAudio" type="AudioStreamPlayer3D" parent="." node_paths=PackedStringArray("team_target")]
|
||||
stream = ExtResource("18_cp35a")
|
||||
attenuation_model = 1
|
||||
volume_db = -30.0
|
||||
max_distance = 75.0
|
||||
unit_size = 30.0
|
||||
max_distance = 50.0
|
||||
max_polyphony = 10
|
||||
bus = &"GameplayMain"
|
||||
script = ExtResource("17_rgc8v")
|
||||
attenuation_filter_cutoff_hz = 20500.0
|
||||
script = ExtResource("16_l07l8")
|
||||
team_target = NodePath("..")
|
||||
metadata/_custom_type_script = "uid://da0xv360va3b3"
|
||||
|
||||
[node name="PlantAudio" type="AudioStreamPlayer3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.7048292, 0)
|
||||
stream = ExtResource("19_vndcj")
|
||||
attenuation_model = 1
|
||||
volume_db = -30.0
|
||||
unit_size = 50.0
|
||||
max_distance = 100.0
|
||||
max_polyphony = 10
|
||||
bus = &"GameplayMain"
|
||||
attenuation_filter_cutoff_hz = 20500.0
|
||||
script = ExtResource("17_rgc8v")
|
||||
metadata/_custom_type_script = "uid://da0xv360va3b3"
|
||||
|
||||
[node name="DamageAudio" type="AudioStreamPlayer3D" parent="."]
|
||||
[node name="DamageAudio" type="AudioStreamPlayer3D" parent="." node_paths=PackedStringArray("team_target")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.0153608, 0)
|
||||
stream = ExtResource("20_lojvk")
|
||||
max_distance = 100.0
|
||||
max_distance = 50.0
|
||||
max_polyphony = 10
|
||||
bus = &"GameplayMain"
|
||||
script = ExtResource("17_rgc8v")
|
||||
attenuation_filter_cutoff_hz = 20500.0
|
||||
script = ExtResource("16_l07l8")
|
||||
team_target = NodePath("..")
|
||||
metadata/_custom_type_script = "uid://da0xv360va3b3"
|
||||
|
||||
[node name="ShootAudio" type="AudioStreamPlayer3D" parent="."]
|
||||
[node name="ShootAudio" type="AudioStreamPlayer3D" parent="." node_paths=PackedStringArray("team_target")]
|
||||
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 1.5493382, 0)
|
||||
stream = ExtResource("21_sa026")
|
||||
attenuation_model = 1
|
||||
volume_db = -30.0
|
||||
max_distance = 100.0
|
||||
unit_size = 35.0
|
||||
max_distance = 75.0
|
||||
max_polyphony = 10
|
||||
bus = &"GameplayMain"
|
||||
script = ExtResource("17_rgc8v")
|
||||
attenuation_filter_cutoff_hz = 20500.0
|
||||
script = ExtResource("16_l07l8")
|
||||
team_target = NodePath("..")
|
||||
metadata/_custom_type_script = "uid://da0xv360va3b3"
|
||||
|
||||
[node name="BodyStateMachine" type="Node" parent="." node_paths=PackedStringArray("current_state")]
|
||||
|
|
|
|||
|
|
@ -60,3 +60,4 @@ func depassive() -> void:
|
|||
func take_damage(damage: int):
|
||||
hp -= damage
|
||||
damaged.emit()
|
||||
$DamageAudio.multiplayer_play()
|
||||
|
|
|
|||
|
|
@ -43,16 +43,17 @@ one_shot = true
|
|||
|
||||
[node name="BeepAudio" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("3_0eiu1")
|
||||
attenuation_model = 1
|
||||
max_distance = 200.0
|
||||
attenuation_model = 3
|
||||
unit_size = 50.0
|
||||
bus = &"GameplayMain"
|
||||
attenuation_filter_cutoff_hz = 10000.0
|
||||
attenuation_filter_cutoff_hz = 20500.0
|
||||
script = ExtResource("4_rcpur")
|
||||
metadata/_custom_type_script = "uid://da0xv360va3b3"
|
||||
|
||||
[node name="DefuseAudio" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("5_rcpur")
|
||||
max_distance = 100.0
|
||||
unit_size = 50.0
|
||||
max_distance = 200.0
|
||||
bus = &"GameplayMain"
|
||||
script = ExtResource("4_rcpur")
|
||||
metadata/_custom_type_script = "uid://da0xv360va3b3"
|
||||
|
|
@ -60,6 +61,8 @@ metadata/_custom_type_script = "uid://da0xv360va3b3"
|
|||
[node name="BoomAudio" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("6_uibus")
|
||||
attenuation_model = 3
|
||||
volume_db = 20.0
|
||||
unit_size = 100.0
|
||||
max_distance = 500.0
|
||||
bus = &"GameplayMisc"
|
||||
script = ExtResource("4_rcpur")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
extends CharacterBody3D
|
||||
|
||||
func _ready() -> void:
|
||||
if is_multiplayer_authority():
|
||||
await get_tree().process_frame
|
||||
await get_tree().process_frame
|
||||
$Idle.multiplayer_play()
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if is_multiplayer_authority() == false:
|
||||
return
|
||||
|
|
@ -17,3 +23,4 @@ func _physics_process(delta: float) -> void:
|
|||
else:
|
||||
var normal = collision.get_normal()
|
||||
velocity = velocity.bounce(normal) * 0.5
|
||||
$MultiplayerAudio3D.multiplayer_play()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://b6qahd6q60js7"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://b6qahd6q60js7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://y1s64ppporww" path="res://weapons/molikman/molik/molik.gd" id="1_aqokr"]
|
||||
[ext_resource type="AudioStream" uid="uid://dm52cfih0gboj" path="res://audio/molik_bounce.ogg" id="2_fb3en"]
|
||||
[ext_resource type="Script" uid="uid://da0xv360va3b3" path="res://audio/audio_system/multiplayer_audio_3d.gd" id="3_jwbhs"]
|
||||
[ext_resource type="AudioStream" uid="uid://blnblkd6eoldv" path="res://audio/molik_idle.ogg" id="4_jwbhs"]
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_fwcyt"]
|
||||
radius = 0.05
|
||||
|
|
@ -26,3 +29,20 @@ shape = SubResource("SphereShape3D_aqokr")
|
|||
|
||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
|
||||
replication_config = SubResource("SceneReplicationConfig_6ic6f")
|
||||
|
||||
[node name="MultiplayerAudio3D" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("2_fb3en")
|
||||
unit_size = 20.0
|
||||
max_distance = 60.0
|
||||
bus = &"GameplayMain"
|
||||
attenuation_filter_cutoff_hz = 20500.0
|
||||
script = ExtResource("3_jwbhs")
|
||||
metadata/_custom_type_script = "uid://da0xv360va3b3"
|
||||
|
||||
[node name="Idle" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("4_jwbhs")
|
||||
unit_size = 15.0
|
||||
max_distance = 60.0
|
||||
bus = &"GameplayMain"
|
||||
script = ExtResource("3_jwbhs")
|
||||
metadata/_custom_type_script = "uid://da0xv360va3b3"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ script = ExtResource("1_e53aq")
|
|||
animation_prefix = &"baked_sp_"
|
||||
registry_entry = &"mm_molik"
|
||||
visibility_target = &"sp"
|
||||
max_ammo = 3
|
||||
max_ammo = 1
|
||||
ammo_mags = 0
|
||||
speed_modifier = 0.9
|
||||
can_be_previous = false
|
||||
|
|
|
|||
|
|
@ -6,9 +6,16 @@ extends Area3D
|
|||
var damage_targets: Array[Player]
|
||||
|
||||
func _ready() -> void:
|
||||
if multiplayer.is_server() == false:
|
||||
return
|
||||
body_entered.connect(on_body_entered)
|
||||
body_exited.connect(on_body_exited)
|
||||
|
||||
await get_tree().process_frame
|
||||
await get_tree().process_frame
|
||||
$Idle.multiplayer_play()
|
||||
$MultiplayerAudio3D.multiplayer_play()
|
||||
|
||||
func damage():
|
||||
for target in damage_targets:
|
||||
target.take_damage(int(dps*damage_timer.wait_time))
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
[gd_scene load_steps=12 format=3 uid="uid://l4t1mflutm3t"]
|
||||
[gd_scene load_steps=15 format=3 uid="uid://l4t1mflutm3t"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bmnqvop2dy5pm" path="res://textures/prototype_yellow_256x256.png" id="1_hr7p8"]
|
||||
[ext_resource type="Script" uid="uid://bo0ij4miuksua" path="res://weapons/molikman/molik/molikman_molotov_fire.gd" id="1_qokq0"]
|
||||
[ext_resource type="Texture2D" uid="uid://b8aqstr5es5x4" path="res://textures/prototype_orange_256x256.png" id="2_qokq0"]
|
||||
[ext_resource type="Script" uid="uid://fdikw4xjemdk" path="res://weapons/molikman/molik/molotov_animation.gd" id="4_6lhod"]
|
||||
[ext_resource type="AudioStream" uid="uid://b7sxkxs7vn4d" path="res://audio/molik_land.ogg" id="5_cq8ds"]
|
||||
[ext_resource type="Script" uid="uid://da0xv360va3b3" path="res://audio/audio_system/multiplayer_audio_3d.gd" id="6_apqju"]
|
||||
[ext_resource type="AudioStream" uid="uid://blnblkd6eoldv" path="res://audio/molik_idle.ogg" id="7_apqju"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_ykxjp"]
|
||||
resource_local_to_scene = true
|
||||
|
|
@ -85,5 +88,22 @@ gpu_particles = NodePath("../GPUParticles3D")
|
|||
collision_shape = NodePath("../CollisionShape3D")
|
||||
expansion_mult = 1.333
|
||||
|
||||
[node name="MultiplayerAudio3D" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("5_cq8ds")
|
||||
unit_size = 20.0
|
||||
max_distance = 60.0
|
||||
bus = &"GameplayMain"
|
||||
attenuation_filter_cutoff_hz = 20500.0
|
||||
script = ExtResource("6_apqju")
|
||||
metadata/_custom_type_script = "uid://da0xv360va3b3"
|
||||
|
||||
[node name="Idle" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("7_apqju")
|
||||
unit_size = 15.0
|
||||
max_distance = 60.0
|
||||
bus = &"GameplayMain"
|
||||
script = ExtResource("6_apqju")
|
||||
metadata/_custom_type_script = "uid://da0xv360va3b3"
|
||||
|
||||
[connection signal="timeout" from="DieTimer" to="MolotovAnimation" method="die"]
|
||||
[connection signal="timeout" from="DamageTimer" to="." method="damage"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue