Merge branch 'multiplayer-rework'

This commit is contained in:
Rendo 2025-12-07 15:54:20 +05:00
commit 2c9ef1cfe1
38 changed files with 535 additions and 288 deletions

View file

@ -2,29 +2,36 @@
[ext_resource type="Script" uid="uid://ddi1alk8oyi1b" path="res://scripts/gui/client_settings_menu.gd" id="1_xqyus"]
[node name="ClientSettings" type="PanelContainer"]
[node name="ClientSettingsMenu" type="CanvasLayer"]
[node name="CenterContainer" type="CenterContainer" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="PanelContainer" type="PanelContainer" parent="CenterContainer"]
visible = false
layout_mode = 2
script = ExtResource("1_xqyus")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/PanelContainer"]
layout_mode = 2
[node name="FullscreenButton" type="CheckButton" parent="VBoxContainer"]
[node name="FullscreenButton" type="CheckButton" parent="CenterContainer/PanelContainer/VBoxContainer"]
layout_mode = 2
text = "Полный экран"
[node name="Sensitivity" type="HBoxContainer" parent="VBoxContainer"]
[node name="Sensitivity" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="VBoxContainer/Sensitivity"]
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/Sensitivity"]
layout_mode = 2
text = "Чувствительность"
[node name="HSlider" type="HSlider" parent="VBoxContainer/Sensitivity"]
[node name="HSlider" type="HSlider" parent="CenterContainer/PanelContainer/VBoxContainer/Sensitivity"]
custom_minimum_size = Vector2(256, 0)
layout_mode = 2
size_flags_horizontal = 3
@ -33,7 +40,7 @@ max_value = 0.1
step = 0.001
value = 0.02
[node name="SpinBox" type="SpinBox" parent="VBoxContainer/Sensitivity"]
[node name="SpinBox" type="SpinBox" parent="CenterContainer/PanelContainer/VBoxContainer/Sensitivity"]
layout_mode = 2
max_value = 0.1
step = 0.001
@ -41,21 +48,21 @@ value = 0.02
allow_greater = true
allow_lesser = true
[node name="GameplayMainAudio" type="HBoxContainer" parent="VBoxContainer"]
[node name="GameplayMainAudio" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="VBoxContainer/GameplayMainAudio"]
[node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/GameplayMainAudio"]
layout_mode = 2
text = "Геймплейные звуки"
[node name="GameplayMainSlider" type="HSlider" parent="VBoxContainer/GameplayMainAudio"]
[node name="GameplayMainSlider" type="HSlider" parent="CenterContainer/PanelContainer/VBoxContainer/GameplayMainAudio"]
layout_mode = 2
size_flags_horizontal = 3
max_value = 1.0
step = 0.01
value = 1.0
[connection signal="toggled" from="VBoxContainer/FullscreenButton" to="." method="_on_check_button_toggled"]
[connection signal="value_changed" from="VBoxContainer/Sensitivity/HSlider" to="." method="_on_h_slider_value_changed"]
[connection signal="value_changed" from="VBoxContainer/Sensitivity/SpinBox" to="." method="_on_spin_box_value_changed"]
[connection signal="value_changed" from="VBoxContainer/GameplayMainAudio/GameplayMainSlider" to="." method="_on_gameplay_main_slider_value_changed"]
[connection signal="toggled" from="CenterContainer/PanelContainer/VBoxContainer/FullscreenButton" to="." method="_on_check_button_toggled"]
[connection signal="value_changed" from="CenterContainer/PanelContainer/VBoxContainer/Sensitivity/HSlider" to="." method="_on_h_slider_value_changed"]
[connection signal="value_changed" from="CenterContainer/PanelContainer/VBoxContainer/Sensitivity/SpinBox" to="." method="_on_spin_box_value_changed"]
[connection signal="value_changed" from="CenterContainer/PanelContainer/VBoxContainer/GameplayMainAudio/GameplayMainSlider" to="." method="_on_gameplay_main_slider_value_changed"]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=81 format=4 uid="uid://dpsr6ug3pkb40"]
[gd_scene load_steps=84 format=4 uid="uid://dpsr6ug3pkb40"]
[ext_resource type="Script" uid="uid://3dphlay25fih" path="res://scripts/player/player.gd" id="1_g2els"]
[ext_resource type="Script" uid="uid://dalwlndejfdhm" path="res://scripts/player/crosshair.gd" id="3_dqkch"]
@ -23,7 +23,6 @@
[ext_resource type="Script" uid="uid://gan0amqbhi4i" path="res://scripts/gui/hud/player_ammo_display.gd" id="12_iortg"]
[ext_resource type="Script" uid="uid://bala54fa32e35" path="res://scripts/gui/hud/player_round_display.gd" id="13_x73hv"]
[ext_resource type="Script" uid="uid://bos7nftlx8tv3" path="res://scripts/gui/hud/player_round_time.gd" id="13_xar7t"]
[ext_resource type="PackedScene" uid="uid://bv6ptrditssow" path="res://scenes/gui/client_settings.tscn" id="16_d267o"]
[ext_resource type="AudioStream" uid="uid://bd4iofirvmiu6" path="res://audio/step_wood.ogg" id="16_fbysy"]
[ext_resource type="Script" uid="uid://da0xv360va3b3" path="res://scripts/audio_system/multiplayer_audio_3d.gd" id="17_0cqlf"]
[ext_resource type="Script" uid="uid://xsgfbuyje35p" path="res://scripts/player/player_pickup.gd" id="17_fjvrb"]
@ -37,6 +36,8 @@
[ext_resource type="Script" uid="uid://b2djbdh05pbcn" path="res://scripts/player/team_color_switcher.gd" id="25_1mtds"]
[ext_resource type="Material" uid="uid://cjb0h3of85nc2" path="res://materials/players/molikman/mat_Molikman.tres" id="26_r2jxp"]
[ext_resource type="Texture2D" uid="uid://15mf4452fse0" path="res://textures/players/molikman/molikman_ingame_Molikman_blue.png" id="27_j3w78"]
[ext_resource type="Script" uid="uid://dsp1sq46c5i3y" path="res://scripts/player/player_interaction.gd" id="37_5amik"]
[ext_resource type="Script" uid="uid://dfvnx8f1v6m5g" path="res://scripts/multiplayer/player_input.gd" id="37_b2eak"]
[sub_resource type="ArrayMesh" id="ArrayMesh_lot4n"]
_surfaces = [{
@ -7401,6 +7402,14 @@ _data = {
&"baked_sp_shoot_empty": SubResource("Animation_do7kw")
}
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_b2eak"]
properties/0/path = NodePath(".:rotation")
properties/0/spawn = true
properties/0/replication_mode = 1
properties/1/path = NodePath("..:rotation")
properties/1/spawn = true
properties/1/replication_mode = 1
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_g2els"]
height = 1.2958984
@ -7411,18 +7420,21 @@ font_size = 32
properties/0/path = NodePath(".:position")
properties/0/spawn = true
properties/0/replication_mode = 1
properties/1/path = NodePath(".:rotation")
properties/1/path = NodePath(".:hp")
properties/1/spawn = true
properties/1/replication_mode = 1
properties/2/path = NodePath("Camera3D:rotation")
properties/2/path = NodePath(".:team")
properties/2/spawn = true
properties/2/replication_mode = 1
properties/3/path = NodePath(".:hp")
properties/2/replication_mode = 2
properties/3/path = NodePath(".:player_id")
properties/3/spawn = true
properties/3/replication_mode = 1
properties/4/path = NodePath(".:team")
properties/3/replication_mode = 0
properties/4/path = NodePath(".:collision_layer")
properties/4/spawn = true
properties/4/replication_mode = 2
properties/4/replication_mode = 0
properties/5/path = NodePath(".:collision_mask")
properties/5/spawn = true
properties/5/replication_mode = 0
[sub_resource type="Curve" id="Curve_fbysy"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 2.5229826, 0.0, 0, 0]
@ -7605,6 +7617,14 @@ _data = {
radius = 0.82177734
height = 3.7087402
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_5amik"]
properties/0/path = NodePath("PlayerInput:direction")
properties/0/spawn = true
properties/0/replication_mode = 1
properties/1/path = NodePath("PlayerInput:compressed_states")
properties/1/spawn = true
properties/1/replication_mode = 1
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("weapon_models")]
collision_layer = 2
collision_mask = 3
@ -8087,9 +8107,11 @@ mesh = SubResource("ArrayMesh_aj0lc")
skin = SubResource("Skin_53wat")
surface_material_override/0 = ExtResource("26_r2jxp")
[node name="VisibleEnabler" type="Node" parent="molikman_ingame"]
[node name="PlayerBasedVisibility" type="Node" parent="molikman_ingame" node_paths=PackedStringArray("reference_player")]
script = ExtResource("4_smehm")
visible_for_others = true
reference_player = NodePath("../..")
metadata/_custom_type_script = "uid://dd5mp72dq43v6"
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
@ -8573,13 +8595,17 @@ libraries = {
&"": SubResource("AnimationLibrary_kyf2b")
}
[node name="VisibilityToggler" type="Node" parent="Camera3D/molikman_hands"]
[node name="VisibilityToggler" type="Node" parent="Camera3D/molikman_hands" node_paths=PackedStringArray("reference_player")]
script = ExtResource("4_smehm")
reference_player = NodePath("../../..")
[node name="DeadSpectator" type="Camera3D" parent="Camera3D"]
fov = 90.0
script = ExtResource("8_rwwcc")
[node name="CameraSync" type="MultiplayerSynchronizer" parent="Camera3D"]
replication_config = SubResource("SceneReplicationConfig_b2eak")
[node name="StandArea" type="Area3D" parent="."]
collision_layer = 0
@ -8636,8 +8662,9 @@ crosses_width = 2.0
crosses_length = 6.0
crosses_offset = 3.0
[node name="VisibleDisabler" type="Node" parent="HUD"]
[node name="VisibleDisabler" type="Node" parent="HUD" node_paths=PackedStringArray("reference_player")]
script = ExtResource("4_smehm")
reference_player = NodePath("../..")
[node name="Healthbar" type="ProgressBar" parent="HUD"]
layout_mode = 1
@ -8690,19 +8717,7 @@ script = ExtResource("13_xar7t")
layout_mode = 2
script = ExtResource("13_x73hv")
[node name="CenterContainer" type="CenterContainer" parent="HUD"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="ClientSettings" parent="HUD/CenterContainer" instance=ExtResource("16_d267o")]
visible = false
layout_mode = 2
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
[node name="PlayerPropertiesSync" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("SceneReplicationConfig_qhqgy")
[node name="StepAudio" type="AudioStreamPlayer3D" parent="."]
@ -8758,7 +8773,7 @@ script = ExtResource("8_f1ej7")
current_state = NodePath("Stand")
metadata/_custom_type_script = "uid://3777rkbebgjm"
[node name="Crouch" type="Node" parent="BodyStateMachine" node_paths=PackedStringArray("stand_up_area", "player", "player_movement", "animation_player", "weapon_system")]
[node name="Crouch" type="Node" parent="BodyStateMachine" node_paths=PackedStringArray("stand_up_area", "player", "player_movement", "player_input", "animation_player", "weapon_system")]
script = ExtResource("9_oprun")
max_speed = 3.0
acceleration = 50.0
@ -8766,36 +8781,39 @@ deceleration = 50.0
stand_up_area = NodePath("../../StandArea")
player = NodePath("../..")
player_movement = NodePath("../../PlayerMovement")
player_input = NodePath("../../PlayerInput")
animation_player = NodePath("../../AnimationPlayer")
weapon_system = NodePath("../../WeaponSystem")
[node name="Stand" type="Node" parent="BodyStateMachine" node_paths=PackedStringArray("player", "player_movement", "weapon_system", "audio")]
[node name="Stand" type="Node" parent="BodyStateMachine" node_paths=PackedStringArray("player", "player_movement", "player_input", "weapon_system", "audio")]
script = ExtResource("10_a8ls1")
max_speed = 6.0
acceleration = 100.0
deceleration = 50.0
JUMP_VELOCITY = 6.0
player = NodePath("../..")
player_movement = NodePath("../../PlayerMovement")
weapon_system = NodePath("../../WeaponSystem")
audio = NodePath("../../StepAudio")
step_delay = 0.25
step_speed_curve = SubResource("Curve_fbysy")
player = NodePath("../..")
player_movement = NodePath("../../PlayerMovement")
player_input = NodePath("../../PlayerInput")
weapon_system = NodePath("../../WeaponSystem")
audio = NodePath("../../StepAudio")
[node name="Walk" type="Node" parent="BodyStateMachine" node_paths=PackedStringArray("player", "player_movement", "weapon_system")]
[node name="Walk" type="Node" parent="BodyStateMachine" node_paths=PackedStringArray("player", "player_movement", "player_input", "weapon_system")]
script = ExtResource("11_qfm1y")
max_speed = 3.0
acceleration = 50.0
deceleration = 50.0
player = NodePath("../..")
player_movement = NodePath("../../PlayerMovement")
player_input = NodePath("../../PlayerInput")
weapon_system = NodePath("../../WeaponSystem")
[node name="Fall" type="Node" parent="BodyStateMachine" node_paths=PackedStringArray("player", "player_movement", "weapon_system", "land_sound")]
[node name="Fall" type="Node" parent="BodyStateMachine" node_paths=PackedStringArray("player", "player_movement", "player_input", "weapon_system", "land_sound")]
script = ExtResource("12_fulsm")
acceleration = 25.0
player = NodePath("../..")
player_movement = NodePath("../../PlayerMovement")
acceleration = 25.0
player_input = NodePath("../../PlayerInput")
weapon_system = NodePath("../../WeaponSystem")
land_sound = NodePath("../../LandAudio")
@ -8803,15 +8821,18 @@ land_sound = NodePath("../../LandAudio")
script = ExtResource("19_rwwcc")
animation_player = NodePath("../../AnimationPlayer")
[node name="PlayerMovement" type="Node" parent="." node_paths=PackedStringArray("player")]
[node name="PlayerMovement" type="Node" parent="." node_paths=PackedStringArray("player", "player_input")]
script = ExtResource("19_70eug")
jump_velocity = 12.0
player = NodePath("..")
player_input = NodePath("../PlayerInput")
[node name="WeaponSystem" type="Node" parent="." node_paths=PackedStringArray("animation_player", "camera", "player")]
[node name="WeaponSystem" type="Node" parent="." node_paths=PackedStringArray("animation_player", "camera", "player", "player_input")]
script = ExtResource("4_qlg0r")
animation_player = NodePath("../Camera3D/molikman_hands/AnimationPlayer")
camera = NodePath("../Camera3D")
player = NodePath("..")
player_input = NodePath("../PlayerInput")
[node name="WeaponSpawner" type="MultiplayerSpawner" parent="WeaponSystem"]
spawn_path = NodePath("..")
@ -8829,9 +8850,9 @@ libraries = {
[node name="TeamUpdater" type="Node" parent="." node_paths=PackedStringArray("player")]
script = ExtResource("7_a8ls1")
player = NodePath("..")
layer = true
inverse = true
player = NodePath("..")
[node name="PickupRange" type="Area3D" parent="." node_paths=PackedStringArray("weapon_spawner", "weapon_system")]
collision_layer = 0
@ -8847,15 +8868,21 @@ shape = SubResource("CapsuleShape3D_3xmak")
[node name="TeamMaterialSwitcher" type="Node" parent="." node_paths=PackedStringArray("player")]
script = ExtResource("25_1mtds")
material = ExtResource("26_r2jxp")
player = NodePath("..")
blue_team_texture = ExtResource("27_j3w78")
player = NodePath("..")
[node name="Interaction" type="Node" parent="."]
script = ExtResource("37_5amik")
[node name="PlayerInput" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("SceneReplicationConfig_5amik")
script = ExtResource("37_b2eak")
[connection signal="died" from="." to="molikman_ingame/VisibleEnabler" method="reverse"]
[connection signal="died" from="." to="Camera3D" method="disable"]
[connection signal="died" from="." to="Camera3D/DeadSpectator" method="set_active"]
[connection signal="died" from="." to="BodyStateMachine/Death" method="on_death"]
[connection signal="died" from="." to="PlayerMovement" method="disable"]
[connection signal="died" from="." to="WeaponSystem" method="disable"]
[connection signal="health_changed" from="." to="HUD/Healthbar" method="on_hp_changed"]
[connection signal="spawned" from="." to="TeamUpdater" method="on_spawned"]
[connection signal="ammo_updated" from="WeaponSystem" to="HUD/AmmoDisplay" method="on_ammo_updated"]
[connection signal="interact_begin" from="PlayerInput" to="Interaction" method="on_player_start_interacting"]
[connection signal="interact_end" from="PlayerInput" to="Interaction" method="on_player_end_interacting"]