gdquest-demos / godot-4-3d-third-person-controller

Godot 4 demo with a plug-and-play 3D Third-Person Shooter (TPS) character controller inspired by games like Ratchet and Clank.
MIT License
710 stars 78 forks source link

Player's `heart_core_mat.tres` `emission_energy_multiplier` changes value every time the main scene is saved #27

Closed akien-mga closed 1 year ago

akien-mga commented 1 year ago

Every time the main scene is saved, this value in the heart_core_mat.tres material changes:

diff --git a/Player/model/materials/heart_core_mat.tres b/Player/model/materials/heart_core_mat.tres
index ec92b25..7eb6d28 100644
--- a/Player/model/materials/heart_core_mat.tres
+++ b/Player/model/materials/heart_core_mat.tres
@@ -4,4 +4,4 @@
 albedo_color = Color(0, 0, 0, 1)
 emission_enabled = true
 emission = Color(0, 1, 0.392157, 1)
-emission_energy_multiplier = 0.669953
+emission_energy_multiplier = 1.2208
diff --git a/Player/model/materials/heart_core_mat.tres b/Player/model/materials/heart_core_mat.tres
index 7eb6d28..9d3e649 100644
--- a/Player/model/materials/heart_core_mat.tres
+++ b/Player/model/materials/heart_core_mat.tres
@@ -4,4 +4,4 @@
 albedo_color = Color(0, 0, 0, 1)
 emission_enabled = true
 emission = Color(0, 1, 0.392157, 1)
-emission_energy_multiplier = 1.2208
+emission_energy_multiplier = 2.16216

This messes up the git history but also actually changes the material. Might be a Godot bug, but I'm reporting it here first to debug.

Seen with Godot 4.0.4, and 4.1.1.

akien-mga commented 1 year ago

This seems to be due to the autoplaying Player/model/custom_animations/default_heartbeat.tres which animates this value. Godot will save whichever value is currently shown by the playing animation.

The default setup should likely be to play the RESET animation so nothing changes, and enable idle animations at runtime.

The same problem likely causes most of this diff:

diff --git a/Player/CharacterSkin.tscn b/Player/CharacterSkin.tscn
index 9ef311f..457aeb7 100644
--- a/Player/CharacterSkin.tscn
+++ b/Player/CharacterSkin.tscn
@@ -2,7 +2,7 @@

 [ext_resource type="Script" path="res://Player/CharacterSkin.gd" id="2_cp6td"]
 [ext_resource type="PackedScene" uid="uid://db7wkegkjmixy" path="res://Player/model/gdbot.glb" id="2_v8h3f"]
-[ext_resource type="Material" uid="uid://bbishx00t2kip" path="res://Player/model/materials/face_mat.tres" id="3_fvn82"]
+[ext_resource type="Material" uid="uid://dh42cdejchkr3" path="res://Player/model/materials/face_mat.tres" id="3_fvn82"]
 [ext_resource type="AnimationNodeBlendTree" uid="uid://ctycm6blx4sw4" path="res://Player/model/character_blend_tree.tres" id="3_hscum"]
 [ext_resource type="Material" uid="uid://cq6bdna8ieu87" path="res://Player/model/materials/heart_core_mat.tres" id="3_oijnk"]
 [ext_resource type="Animation" uid="uid://b627b68jhaqwt" path="res://Player/model/custom_animations/default_heartbeat.tres" id="3_xjurk"]
@@ -2568,56 +2568,36 @@ main_animation_player = NodePath("gdbot/AnimationPlayer")
 [node name="gdbot" parent="." instance=ExtResource("2_v8h3f")]

 [node name="Skeleton3D" parent="gdbot/Armature" index="0"]
-bones/2/position = Vector3(-0.0156021, 1.36398e-09, 0.516345)
-bones/2/rotation = Quaternion(-0.0678416, 0.705018, 0.703845, -0.0543028)
-bones/3/rotation = Quaternion(1, 7.59422e-10, -7.31731e-08, -1.10193e-11)
-bones/4/rotation = Quaternion(-0.278581, -0.0627559, -0.057901, 0.95661)
-bones/5/rotation = Quaternion(0.367395, 5.66719e-08, -1.01163e-07, 0.930065)
-bones/7/rotation = Quaternion(-0.0616871, 0.279873, 0.124634, 0.949912)
-bones/8/rotation = Quaternion(0.252905, -4.93782e-08, 8.16418e-08, 0.967491)
-bones/10/rotation = Quaternion(-0.493314, -0.540606, -0.470842, 0.49264)
-bones/11/rotation = Quaternion(-9.85764e-10, 1.99044e-08, -0.314076, 0.949398)
+bones/2/rotation = Quaternion(3.09086e-08, 0.707107, 0.707107, 3.09086e-08)
+bones/4/rotation = Quaternion(-0.115911, -2.57656e-08, 5.29041e-08, 0.99326)
+bones/5/rotation = Quaternion(0.198843, 5.30058e-08, -5.38571e-08, 0.980031)
+bones/7/rotation = Quaternion(-0.115911, 8.72134e-08, -6.00749e-08, 0.99326)
+bones/8/rotation = Quaternion(0.198843, -5.00951e-08, 6.82031e-08, 0.980031)
+bones/10/rotation = Quaternion(-0.505414, -0.494527, -0.494527, 0.505414)
+bones/11/rotation = Quaternion(-5.46012e-10, 2.14316e-08, -0.0279458, 0.999609)
 bones/13/rotation = Quaternion(0.0819346, 1.62373e-07, 6.18589e-09, 0.996638)
-bones/14/rotation = Quaternion(-0.0819165, -0.00172035, -0.0209261, 0.996418)
-bones/16/rotation = Quaternion(-0.72012, -0.206885, -0.616648, 0.2416)
-bones/17/rotation = Quaternion(-2.28407e-08, 1.77435e-08, -0.370769, 0.928725)
-bones/19/rotation = Quaternion(-0.391114, -0.0079801, -0.00129221, 0.920307)
-bones/20/rotation = Quaternion(-0.277507, -2.52358e-07, -9.94341e-08, 0.960724)
-bones/21/rotation = Quaternion(-0.38504, -0.130181, 0.00239691, 0.913669)
-bones/22/rotation = Quaternion(-0.277506, 6.90892e-07, -4.39039e-08, 0.960724)
-bones/23/rotation = Quaternion(-0.391124, 0.0040795, 0.000660612, 0.920329)
-bones/24/rotation = Quaternion(-0.277506, 5.78611e-07, 1.10348e-07, 0.960724)
-bones/25/rotation = Quaternion(-0.386896, 0.0855178, -0.0227219, 0.917868)
-bones/26/rotation = Quaternion(-0.277506, -2.58292e-09, -9.82245e-08, 0.960724)
-bones/27/rotation = Quaternion(-0.293954, 0.794438, -0.105766, 0.520838)
-bones/28/rotation = Quaternion(-0.277506, -3.63708e-07, -5.31396e-07, 0.960724)
-bones/29/rotation = Quaternion(-0.72012, -0.206885, -0.616648, 0.2416)
-bones/30/rotation = Quaternion(-2.28407e-08, 1.77435e-08, -0.370769, 0.928725)
-bones/32/rotation = Quaternion(-0.0343786, 0.0690937, -0.444141, 0.892627)
-bones/33/rotation = Quaternion(-0.562538, 0.445746, 0.416464, 0.558049)
-bones/34/rotation = Quaternion(2.12524e-11, 5.23676e-09, 0.00175531, 0.999999)
-bones/37/rotation = Quaternion(-0.632181, 0.237039, 0.706523, 0.212097)
-bones/38/rotation = Quaternion(3.6591e-09, 2.1615e-08, 0.456917, 0.88951)
-bones/40/rotation = Quaternion(-0.391114, 0.00798011, 0.00129221, 0.920307)
-bones/41/rotation = Quaternion(-0.277507, 2.41907e-07, 1.20579e-07, 0.960724)
-bones/42/rotation = Quaternion(-0.38504, 0.130181, -0.00239689, 0.913669)
-bones/43/rotation = Quaternion(-0.277506, -6.4933e-07, 2.01537e-08, 0.960724)
-bones/44/rotation = Quaternion(-0.391124, -0.00407954, -0.000660702, 0.920329)
-bones/45/rotation = Quaternion(-0.277506, -6.01846e-07, -9.99273e-08, 0.960724)
-bones/46/rotation = Quaternion(-0.386896, -0.0855178, 0.0227219, 0.917868)
-bones/47/rotation = Quaternion(-0.277506, -2.36655e-08, 1.00422e-07, 0.960724)
-bones/48/rotation = Quaternion(-0.293954, -0.794438, 0.105766, 0.520838)
-bones/49/rotation = Quaternion(-0.277506, 3.69605e-07, 5.06519e-07, 0.960724)
-bones/50/rotation = Quaternion(-0.632181, 0.237039, 0.706523, 0.212097)
-bones/51/rotation = Quaternion(3.6591e-09, 2.1615e-08, 0.456917, 0.88951)
-bones/53/rotation = Quaternion(0.0247, 0.0496418, 0.444784, 0.89392)
-bones/54/position = Vector3(-0.174585, 0.00406308, 0.113821)
-bones/54/rotation = Quaternion(0, 0, 0.147009, 0.989135)
-bones/55/position = Vector3(0, -1.49012e-08, 0)
+bones/14/rotation = Quaternion(-0.0819346, 0, -1.95347e-08, 0.996638)
+bones/16/rotation = Quaternion(-0.505414, -0.494527, -0.494527, 0.505414)
+bones/17/rotation = Quaternion(-5.46012e-10, 2.14316e-08, -0.0279458, 0.999609)
+bones/19/rotation = Quaternion(-0.120361, -0.00802529, 0.000973064, 0.992697)
+bones/21/rotation = Quaternion(-0.116368, -0.124403, 0.0384288, 0.984635)
+bones/22/rotation = Quaternion(6.38189e-07, 6.45407e-07, -2.47732e-07, 1)
+bones/25/rotation = Quaternion(-0.116986, 0.0758535, -0.0455612, 0.989184)
+bones/26/rotation = Quaternion(8.61473e-09, -1.58325e-08, -7.35745e-08, 1)
+bones/29/rotation = Quaternion(-0.505414, -0.494527, -0.494527, 0.505414)
+bones/30/rotation = Quaternion(-5.46012e-10, 2.14316e-08, -0.0279458, 0.999609)
+bones/33/rotation = Quaternion(-0.505414, 0.494527, 0.494527, 0.505414)
+bones/34/rotation = Quaternion(2.08907e-10, 5.56092e-09, 0.0279458, 0.999609)
+bones/37/rotation = Quaternion(-0.505414, 0.494527, 0.494527, 0.505414)
+bones/38/rotation = Quaternion(2.08907e-10, 5.56092e-09, 0.0279458, 0.999609)
+bones/40/rotation = Quaternion(-0.120361, 0.00802529, -0.000973064, 0.992697)
+bones/42/rotation = Quaternion(-0.116368, 0.124403, -0.0384288, 0.984635)
+bones/43/rotation = Quaternion(6.37723e-07, -6.44941e-07, 2.47732e-07, 1)
+bones/46/rotation = Quaternion(-0.116986, -0.0758535, 0.0455612, 0.989184)
+bones/47/rotation = Quaternion(9.31322e-09, 1.67638e-08, 7.54371e-08, 1)
+bones/50/rotation = Quaternion(-0.505414, 0.494527, 0.494527, 0.505414)
+bones/51/rotation = Quaternion(2.08907e-10, 5.56092e-09, 0.0279458, 0.999609)
 bones/56/rotation = Quaternion(0, 0, 1, 0)
-bones/58/position = Vector3(0.171403, -0.051028, 0.113821)
-bones/58/rotation = Quaternion(0, 0, -0.15168, 0.98843)
-bones/59/position = Vector3(-7.93072e-08, 3.58455e-08, 3.14926e-07)
 bones/60/rotation = Quaternion(0, 0, 1, 0)

 [node name="gdbot_mesh" parent="gdbot/Armature/Skeleton3D" index="0"]
@@ -2639,6 +2619,7 @@ active = true
 parameters/Add2/add_amount = 1.0
 "parameters/Add2 2/add_amount" = 1.0
 parameters/PunchOneShot/active = false
+parameters/PunchOneShot/request = 0
 parameters/StateMachine/playback = SubResource("AnimationNodeStateMachinePlayback_dbxqx")
 parameters/StateMachine/move/blend_position = 0

diff --git a/Player/model/materials/heart_core_mat.tres b/Player/model/materials/heart_core_mat.tres
index 7eb6d28..a1354ac 100644
--- a/Player/model/materials/heart_core_mat.tres
+++ b/Player/model/materials/heart_core_mat.tres
@@ -4,4 +4,4 @@
 albedo_color = Color(0, 0, 0, 1)
 emission_enabled = true
 emission = Color(0, 1, 0.392157, 1)
-emission_energy_multiplier = 1.2208
+emission_energy_multiplier = 2.01452