From ddad08e457c3dc95d54fcfea670343088e431273 Mon Sep 17 00:00:00 2001 From: unfa Date: Sat, 1 Jan 2022 18:43:50 +0100 Subject: [PATCH] Many small fixes with rockets, halos, particle effects Fixed halo Z test (proximity fade enforced it) Fixed halo scaling is sync Fixed some particle effect issues with muzzle flashes and explosions Added "fine red mist" lingering after killing someone --- Game/Assets/Effects/Gibs.tscn | 63 +++++++++++++------ Game/Assets/Effects/ImpactExplosion.tscn | 10 +-- Game/Assets/Effects/MuzzleFlash.tscn | 2 +- Game/Assets/Weapons/Handgun/Flash.gd | 2 +- Game/Assets/Weapons/Handgun/Handgun.tscn | 10 +++ Game/Assets/Weapons/Projectile.gd | 9 +-- .../Assets/Weapons/RocketLauncher/Rocket.tscn | 6 +- .../RocketLauncher/RocketLauncher.tscn | 11 ++++ 8 files changed, 79 insertions(+), 34 deletions(-) diff --git a/Game/Assets/Effects/Gibs.tscn b/Game/Assets/Effects/Gibs.tscn index bfce8d9..1586013 100644 --- a/Game/Assets/Effects/Gibs.tscn +++ b/Game/Assets/Effects/Gibs.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=16 format=3 uid="uid://egphnvwk6cg"] +[gd_scene load_steps=19 format=3 uid="uid://egphnvwk6cg"] [ext_resource type="Script" path="res://Assets/Effects/Gibs.gd" id="1_o0guu"] +[ext_resource type="Texture2D" uid="uid://pnh872qjk0oy" path="res://Assets/Effects/Flame.png" id="2_2ahev"] [ext_resource type="PackedScene" uid="uid://c5cwnfuw4go1b" path="res://Assets/Audio/SoundPlayer.tscn" id="2_3tb4k"] [ext_resource type="AudioStream" uid="uid://xv1jp0gql8tc" path="res://Assets/SFX/Player_Death_01.wav" id="3_hmhtq"] @@ -8,7 +9,7 @@ offsets = PackedFloat32Array(0, 0.874302, 1) colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) -[sub_resource type="GradientTexture" id="GradientTexture_07eoi"] +[sub_resource type="GradientTexture1D" id="GradientTexture_07eoi"] gradient = SubResource( "Gradient_tjffd" ) [sub_resource type="ParticlesMaterial" id="ParticlesMaterial_jcugi"] @@ -60,36 +61,60 @@ height = 0.2 radial_segments = 8 rings = 4 -[sub_resource type="Gradient" id="Gradient_roxnd"] -colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0) +[sub_resource type="Gradient" id="Gradient_ftxfe"] +offsets = PackedFloat32Array(0, 0.121495, 1) +colors = PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1) -[sub_resource type="GradientTexture" id="GradientTexture_jtdpg"] -gradient = SubResource( "Gradient_roxnd" ) +[sub_resource type="GradientTexture1D" id="GradientTexture1D_ou20n"] +gradient = SubResource( "Gradient_ftxfe" ) + +[sub_resource type="Curve" id="Curve_rpme7"] +_data = [Vector2(0, 0.1), 0.0, 0.887726, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0] + +[sub_resource type="CurveTexture" id="CurveTexture_76rnk"] +curve = SubResource( "Curve_rpme7" ) [sub_resource type="ParticlesMaterial" id="ParticlesMaterial_6gu8h"] -color_ramp = SubResource( "GradientTexture_jtdpg" ) +lifetime_randomness = 0.3 +emission_shape = 1 +emission_sphere_radius = 0.1 +spread = 180.0 +gravity = Vector3(0, -1, 0) +angular_velocity_min = -5.0 +angular_velocity_max = 5.0 +damping_min = 10.0 +damping_max = 14.0 +angle_min = -180.0 +angle_max = 180.0 +scale_min = 4.0 +scale_max = 8.0 +scale_curve = SubResource( "CurveTexture_76rnk" ) +color_ramp = SubResource( "GradientTexture1D_ou20n" ) +hue_variation_min = -0.05 +anim_offset_max = 4.0 collision_enabled = true collision_friction = 0.93 [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_u05mr"] -transparency = 1 +blend_mode = 1 +shading_mode = 0 vertex_color_use_as_albedo = true -albedo_color = Color(1, 0.00784314, 0, 1) -roughness = 0.14 +albedo_color = Color(0.129412, 0, 0, 1) +albedo_texture = ExtResource( "2_2ahev" ) billboard_mode = 3 -particles_anim_h_frames = 1 -particles_anim_v_frames = 1 +particles_anim_h_frames = 2 +particles_anim_v_frames = 2 particles_anim_loop = false +proximity_fade_enable = true [sub_resource type="QuadMesh" id="QuadMesh_ho3xr"] material = SubResource( "StandardMaterial3D_u05mr" ) -size = Vector2(0.1, 0.1) [node name="GibbsEffect" type="Node3D"] script = ExtResource( "1_o0guu" ) [node name="Gibs" type="GPUParticles3D" parent="."] -layers = 4 +layers = 2 emitting = false amount = 32 sub_emitter = NodePath("../Blood") @@ -101,23 +126,21 @@ collision_base_size = 0.1 visibility_aabb = AABB(-4, -3.55666, -4, 8, 4.42876, 8) process_material = SubResource( "ParticlesMaterial_jcugi" ) draw_pass_1 = SubResource( "SphereMesh_ctp33" ) -script = null [node name="Blood" type="GPUParticles3D" parent="."] -visible = false +layers = 2 amount = 16 -lifetime = 0.82 +lifetime = 8.0 +explosiveness = 1.0 randomness = 0.22 fixed_fps = 0 process_material = SubResource( "ParticlesMaterial_6gu8h" ) draw_pass_1 = SubResource( "QuadMesh_ho3xr" ) -script = null [node name="Timer" type="Timer" parent="."] -wait_time = 5.0 +wait_time = 10.0 one_shot = true autostart = true -script = null [node name="SoundPlayer" parent="." instance=ExtResource( "2_3tb4k" )] SoundClip = "res://Assets/SFX/Player_Death_01.wav" diff --git a/Game/Assets/Effects/ImpactExplosion.tscn b/Game/Assets/Effects/ImpactExplosion.tscn index 66cff4f..4231f2b 100644 --- a/Game/Assets/Effects/ImpactExplosion.tscn +++ b/Game/Assets/Effects/ImpactExplosion.tscn @@ -16,11 +16,11 @@ colors = PackedColorArray(3, 2.4, 0.4, 1, 1, 0.503748, 0.133411, 1, 0.13, 0.13, gradient = SubResource( "Gradient_gbvow" ) use_hdr = true -[sub_resource type="Curve" id="Curve_dhha2"] -_data = [Vector2(0, 0.154545), 0.0, 5.74743, 0, 0, Vector2(0.173729, 0.872727), 1.49824, 1.49824, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +[sub_resource type="Curve" id="Curve_b77b7"] +_data = [Vector2(0, 0.154545), 0.0, 5.74743, 0, 0, Vector2(0.109319, 0.572727), 1.49824, 1.49824, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0] -[sub_resource type="CurveTexture" id="CurveTexture_n25a7"] -curve = SubResource( "Curve_dhha2" ) +[sub_resource type="CurveTexture" id="CurveTexture_to7ng"] +curve = SubResource( "Curve_b77b7" ) [sub_resource type="ParticlesMaterial" id="ParticlesMaterial_pw7km"] lifetime_randomness = 0.25 @@ -37,7 +37,7 @@ angle_min = -180.0 angle_max = 180.0 scale_min = 4.0 scale_max = 6.0 -scale_curve = SubResource( "CurveTexture_n25a7" ) +scale_curve = SubResource( "CurveTexture_to7ng" ) color_ramp = SubResource( "GradientTexture1D_1yld1" ) anim_offset_max = 4.0 collision_enabled = true diff --git a/Game/Assets/Effects/MuzzleFlash.tscn b/Game/Assets/Effects/MuzzleFlash.tscn index 598c112..79ec285 100644 --- a/Game/Assets/Effects/MuzzleFlash.tscn +++ b/Game/Assets/Effects/MuzzleFlash.tscn @@ -65,7 +65,7 @@ damping_min = 18.58 damping_max = 18.67 angle_min = -180.0 angle_max = 180.0 -scale_max = 2.5 +scale_max = 1.5 scale_curve = SubResource( "CurveTexture_n25a7" ) color_ramp = SubResource( "GradientTexture1D_lue3h" ) anim_offset_max = 4.0 diff --git a/Game/Assets/Weapons/Handgun/Flash.gd b/Game/Assets/Weapons/Handgun/Flash.gd index 5da6803..6e75a83 100644 --- a/Game/Assets/Weapons/Handgun/Flash.gd +++ b/Game/Assets/Weapons/Handgun/Flash.gd @@ -1,7 +1,7 @@ extends Node3D func _ready(): - print("Muzzle flash spawned") + #print("Muzzle flash spawned") $GPUParticles3D.emitting = true $AnimationPlayer.play("Flash") diff --git a/Game/Assets/Weapons/Handgun/Handgun.tscn b/Game/Assets/Weapons/Handgun/Handgun.tscn index c539acd..f0a0c3e 100644 --- a/Game/Assets/Weapons/Handgun/Handgun.tscn +++ b/Game/Assets/Weapons/Handgun/Handgun.tscn @@ -10,6 +10,16 @@ weapon_damage = 15 [node name="Handgun" parent="." index="0" instance=ExtResource( "2_0ysys" )] +[node name="Static" parent="Handgun/Handgun_Armature/Skeleton3D" index="0"] +layers = 4 +surface_material_override/0 = null +surface_material_override/1 = null + +[node name="Hand" parent="Handgun/HandArmature/Skeleton3D2" index="0"] +layers = 4 +surface_material_override/0 = null + +[editable path="Handgun"] [editable path="SFX/Shoot A"] [editable path="SFX/Shoot B"] [editable path="SFX/Shoot C"] diff --git a/Game/Assets/Weapons/Projectile.gd b/Game/Assets/Weapons/Projectile.gd index afea16a..6028add 100644 --- a/Game/Assets/Weapons/Projectile.gd +++ b/Game/Assets/Weapons/Projectile.gd @@ -23,7 +23,7 @@ var ray_previously : bool = false # Called when the node enters the scene tree for the first time. func _ready(): - + halo.mesh = halo.mesh.duplicate() var halo_material = halo.mesh.surface_get_material(0).duplicate() halo.set_surface_override_material(0, halo_material) #$OmniLight3D/Smoke.emitting = true @@ -37,12 +37,14 @@ func _physics_process(delta): # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): + $Rocket.rotate_z(delta * 4) + time += delta - var flicker = sin(time * 225) + sin(time * 240) / 2 + sin(time * 295) / 3 + var flicker = sin(time * 125) + sin(time * 180) / 2 + sin(time * 295) / 3 $OmniLight3D.light_energy = 3 + flicker /2 - halo.mesh.size = Vector2.ONE * 1.5 + Vector2(flicker, flicker) / 16 + halo.mesh.size = Vector2.ONE * 1.5 + Vector2(flicker, flicker) / 8 var space_state = get_world_3d().direct_space_state var physics_ray_query_parameters_3d = PhysicsRayQueryParameters3D.new() @@ -75,7 +77,6 @@ func give_damage(target: Node, hit_position: Vector3, hit_normal: Vector3, damag # TODO take data from the material of the target and spawn an appropriate hit effect var hit_effect : Node = hit_effect_scene.instantiate() get_tree().root.add_child(hit_effect) - hit_effect.global_transform.origin = hit_position #print(impact_vfx.global_transform) var result = hit_effect.look_at(hit_position + hit_normal) diff --git a/Game/Assets/Weapons/RocketLauncher/Rocket.tscn b/Game/Assets/Weapons/RocketLauncher/Rocket.tscn index e26f832..f71461b 100644 --- a/Game/Assets/Weapons/RocketLauncher/Rocket.tscn +++ b/Game/Assets/Weapons/RocketLauncher/Rocket.tscn @@ -88,7 +88,6 @@ disable_receive_shadows = true billboard_mode = 1 fixed_size = true point_size = 89.7 -proximity_fade_enable = true proximity_fade_distance = 0.25 [sub_resource type="QuadMesh" id="QuadMesh_q2732"] @@ -164,11 +163,12 @@ one_shot = true [node name="AmbientSound" type="AudioStreamPlayer3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00287104, 0.0138369, -0.0329528) stream = ExtResource( "5_v5pxv" ) -unit_db = -8.0 +unit_db = -4.0 unit_size = 4.0 -max_db = 0.0 +max_db = 4.0 pitch_scale = 1.95 autoplay = true +doppler_tracking = 2 [connection signal="body_entered" from="Area3D" to="." method="_on_Area3D_body_entered"] [connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"] diff --git a/Game/Assets/Weapons/RocketLauncher/RocketLauncher.tscn b/Game/Assets/Weapons/RocketLauncher/RocketLauncher.tscn index 5ae8c82..7225a93 100644 --- a/Game/Assets/Weapons/RocketLauncher/RocketLauncher.tscn +++ b/Game/Assets/Weapons/RocketLauncher/RocketLauncher.tscn @@ -19,9 +19,20 @@ transform = Transform3D(1.78814e-07, -1, 0, 1, 1.78814e-07, 0, 0, 0, 1, -0.61308 [node name="Cylinder" parent="RocketLauncher/Handgun_Armature" index="0"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0414381, 0.0118755, -0.000240355) +layers = 4 [node name="Cylinder001" parent="RocketLauncher/Handgun_Armature/Cylinder" index="0"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.259108, -0.0303738, 0.133397) +layers = 4 + +[node name="Hand001" parent="RocketLauncher/Handgun_Armature/Cylinder/Cylinder001/HandArmature001/Skeleton3D" index="0"] +layers = 4 + +[node name="Static" parent="RocketLauncher/Handgun_Armature/Skeleton3D2" index="0"] +layers = 4 + +[node name="Hand" parent="RocketLauncher/HandArmature/Skeleton3D3" index="0"] +layers = 4 [node name="AudioStreamPlayer3D" parent="SFX/Shoot A" index="0"] stream = ExtResource( "4_ni7bd" )