diff --git a/icon.svg.import b/icon.svg.import index 488e0ff..5a5d701 100644 --- a/icon.svg.import +++ b/icon.svg.import @@ -3,25 +3,27 @@ importer="texture" type="CompressedTexture2D" uid="uid://bnwj7ltdfximr" -path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +path.s3tc="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex" +path.etc2="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.etc2.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc", "etc2_astc"], +"vram_texture": true } [deps] source_file="res://icon.svg" -dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex", "res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.etc2.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -31,7 +33,7 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 svg/scale=1.0 editor/scale_with_editor_scale=false editor/convert_colors_with_editor_theme=false diff --git a/player_controller/PlayerController.tscn b/player_controller/PlayerController.tscn index 4b52ee2..86cf940 100644 --- a/player_controller/PlayerController.tscn +++ b/player_controller/PlayerController.tscn @@ -155,7 +155,7 @@ target_position = Vector3(-1, 0, 0) collision_mask = 2 [node name="DashSystem" parent="." instance=ExtResource("18_q5h8a")] -DashSpeed = 0.1 +DashSpeed = 0.2 PostDashSpeed = 30.0 [node name="WeaponRoot" type="Node3D" parent="."] diff --git a/systems/dash/DashSystem.cs b/systems/dash/DashSystem.cs index bdbf1e1..5528e3c 100644 --- a/systems/dash/DashSystem.cs +++ b/systems/dash/DashSystem.cs @@ -5,7 +5,7 @@ namespace Movementtests.systems; public partial class DashSystem: Node3D { [Export(PropertyHint.Range, "0,0.2,0.01,or_greater")] - public float DashSpeed { get; set; } = 0.05f; + public float DashSpeed { get; set; } = 0.1f; [Export(PropertyHint.Range, "0,1000,1,or_greater")] public float PostDashSpeed { get; set; } = 0f; @@ -27,7 +27,11 @@ public partial class DashSystem: Node3D private MantleSystem _mantleSystem; private MeshInstance3D _dashTarget; + private CpuParticles3D _dashIndicator; + private AnimationPlayer _dashIndicatorAnim; + [Export] + public PackedScene DashIndicatorScene { get; set; } [Signal] public delegate void DashStartedEventHandler(); @@ -48,6 +52,8 @@ public partial class DashSystem: Node3D _dashTarget = GetNode("DashTarget"); _dashTarget.SetVisible(false); + _dashIndicator = GetNode("DashIndicator"); + _dashIndicatorAnim = GetNode("DashIndicator/AnimationPlayer"); } private void ComputeDashLocation() @@ -66,11 +72,16 @@ public partial class DashSystem: Node3D var fraction = _dashCast3D.GetClosestCollisionSafeFraction(); var globalSweepPath = TargetLocation - _dashCast3D.GlobalPosition; var locationAlongPath = _dashCast3D.GlobalPosition + globalSweepPath * fraction; - + + // Pushes the point down when dashing to under a platform so head doesn't clip var maxPushDownDistance = 0.9f; var correctionProportion = (float) Mathf.Remap(CollisionNormal.Y, -0.5, -1, 0, 1); var proportion = (float) Mathf.Remap(_dashCast3D.GlobalRotation.X, 0, 1.57, 0, 1); - PlannedPlayerLocation = locationAlongPath + CollisionNormal * maxPushDownDistance * proportion * correctionProportion; + PlannedPlayerLocation = locationAlongPath + + CollisionNormal + * maxPushDownDistance + * Mathf.Clamp(proportion, 0, 1) + * Mathf.Clamp(correctionProportion, 0, 1); } public void PrepareDash() @@ -88,7 +99,7 @@ public partial class DashSystem: Node3D var mantleLocation = Vector3.Zero; if (HasHit && Mathf.Abs(CollisionNormal.Y) < 0.5f) { - var mantleResult = _mantleSystem.FindMantleLocationAtPoint(CollisionPoint, CollisionNormal); + var mantleResult = _mantleSystem.FindMantleLocationAtPoint(PlannedPlayerLocation, CollisionNormal); ShouldMantle = mantleResult.IsSome(out mantleLocation); } PlannedMantleLocation = mantleLocation; @@ -116,13 +127,19 @@ public partial class DashSystem: Node3D { EmitSignal(SignalName.DashStarted); _dashTarget.SetVisible(false); - var dashTweenInputs = new TweenQueueSystem.TweenInputs(PlannedPlayerLocation, 0.1f); + var dashTweenInputs = new TweenQueueSystem.TweenInputs(PlannedPlayerLocation, DashSpeed); var dashTween = _tweenQueueSystem.TweenToLocation(dashTweenInputs); dashTween.Finished += DashTweenEnded; if (ShouldMantle) { _tweenQueueSystem.QueueTween(PlannedMantleLocation, 0.2f); + return; } + + var dashIndicator = (CpuParticles3D) DashIndicatorScene.Instantiate(); + GetTree().GetRoot().AddChild(dashIndicator); + dashIndicator.GlobalPosition = _dashTarget.GlobalPosition; + dashIndicator.SetEmitting(true); } public void DashToThrownWeapon() diff --git a/systems/dash/dash_indicator.tscn b/systems/dash/dash_indicator.tscn new file mode 100644 index 0000000..411ae71 --- /dev/null +++ b/systems/dash/dash_indicator.tscn @@ -0,0 +1,79 @@ +[gd_scene load_steps=7 format=3 uid="uid://hd0868f4pb63"] + +[ext_resource type="Texture2D" uid="uid://chvt6g0xn5c2m" path="res://systems/dash/light-ring.jpg" id="1_jadbb"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tqt6i"] +transparency = 1 +blend_mode = 1 +shading_mode = 0 +albedo_texture = ExtResource("1_jadbb") +billboard_mode = 1 + +[sub_resource type="PlaneMesh" id="PlaneMesh_jngg2"] +orientation = 2 + +[sub_resource type="Animation" id="Animation_fmn25"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:mesh:size") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(2, 2)] +} + +[sub_resource type="Animation" id="Animation_stbcc"] +resource_name = "start" +length = 0.2 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:mesh:size") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.2), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector2(2, 2), Vector2(0, 0)] +} +tracks/1/type = "method" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath(".") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0.2), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"queue_free" +}] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_3aile"] +_data = { +&"RESET": SubResource("Animation_fmn25"), +&"start": SubResource("Animation_stbcc") +} + +[node name="DashIndicator" type="CPUParticles3D"] +material_override = SubResource("StandardMaterial3D_tqt6i") +emitting = false +amount = 1 +lifetime = 0.5 +one_shot = true +mesh = SubResource("PlaneMesh_jngg2") +gravity = Vector3(0, 0, 0) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +&"": SubResource("AnimationLibrary_3aile") +} +autoplay = "start" diff --git a/systems/dash/dash_system.tscn b/systems/dash/dash_system.tscn index 3294d78..ccf86a8 100644 --- a/systems/dash/dash_system.tscn +++ b/systems/dash/dash_system.tscn @@ -1,8 +1,11 @@ -[gd_scene load_steps=6 format=3 uid="uid://cqduhd4opgwvm"] +[gd_scene load_steps=8 format=3 uid="uid://cqduhd4opgwvm"] [ext_resource type="Script" uid="uid://dwoppk8j5fxeg" path="res://systems/dash/DashSystem.cs" id="1_hwig2"] [ext_resource type="Shape3D" uid="uid://keseacdcooot" path="res://player_controller/resources/PlayerShape.tres" id="2_jngg2"] [ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://systems/mantle/mantle_system.tscn" id="2_pff7b"] +[ext_resource type="PackedScene" uid="uid://hd0868f4pb63" path="res://systems/dash/dash_indicator.tscn" id="2_tqt6i"] + +[sub_resource type="SphereShape3D" id="SphereShape3D_jngg2"] [sub_resource type="SphereMesh" id="SphereMesh_qu4wy"] @@ -10,6 +13,7 @@ [node name="DashSystem" type="Node3D"] script = ExtResource("1_hwig2") +DashIndicatorScene = ExtResource("2_tqt6i") [node name="PlayerShapeCast3D" type="ShapeCast3D" parent="."] shape = ExtResource("2_jngg2") @@ -18,8 +22,8 @@ collision_mask = 2 debug_shape_custom_color = Color(0.863327, 0.636844, 0, 1) [node name="DashCast3D" type="ShapeCast3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.68, 0) -shape = ExtResource("2_jngg2") +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.85, 0) +shape = SubResource("SphereShape3D_jngg2") target_position = Vector3(0, 0, -12) max_results = 1 collision_mask = 2 @@ -32,3 +36,6 @@ surface_material_override/0 = SubResource("StandardMaterial3D_v31n3") [node name="MantleSystem" parent="." instance=ExtResource("2_pff7b")] MantleEndLocationDistanceFromWall = 0.3 MantleHeightCastStart = 2.0 + +[node name="DashIndicator" parent="." instance=ExtResource("2_tqt6i")] +visible = false diff --git a/systems/dash/light-ring.jpg b/systems/dash/light-ring.jpg new file mode 100644 index 0000000..87c09ab --- /dev/null +++ b/systems/dash/light-ring.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9dae91147e42b4b6b18c876bc338b9e8ec5f873c21311dd61e54c24373b7b39 +size 32768 diff --git a/systems/dash/light-ring.jpg.import b/systems/dash/light-ring.jpg.import new file mode 100644 index 0000000..2fe3e0d --- /dev/null +++ b/systems/dash/light-ring.jpg.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://chvt6g0xn5c2m" +path.s3tc="res://.godot/imported/light-ring.jpg-c39549c041934663aceb7b7e60c47efb.s3tc.ctex" +path.etc2="res://.godot/imported/light-ring.jpg-c39549c041934663aceb7b7e60c47efb.etc2.ctex" +metadata={ +"imported_formats": ["s3tc_bptc", "etc2_astc"], +"vram_texture": true +} + +[deps] + +source_file="res://systems/dash/light-ring.jpg" +dest_files=["res://.godot/imported/light-ring.jpg-c39549c041934663aceb7b7e60c47efb.s3tc.ctex", "res://.godot/imported/light-ring.jpg-c39549c041934663aceb7b7e60c47efb.etc2.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0