Skip to content

Commit

Permalink
PoseWarping Node | Update to Godot 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ywmaa committed Oct 3, 2024
1 parent c074df4 commit 20aadb0
Show file tree
Hide file tree
Showing 67 changed files with 3,840 additions and 455 deletions.
24 changes: 8 additions & 16 deletions .github/workflows/Publish-Godot-Project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,13 @@ env:
PROJECT_NAME: "AMSG" # Needs to be added, PLEASE DON'T USE SPACES
ITCH_PROJECT_NAME: "amsg" # Needs to be added
ITCH_USER_NAME: "ywmaa" # Needs to be added
GODOT_VERSION: 4.1.1 # Needs to be added
GODOT_VERSION: 4.3 # Needs to be added
jobs:
CleanArtifacts:
# This job clears out the previous artifacts made so you don't run out of space in your github account
runs-on: ubuntu-latest
steps:
- uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
expire-in: 1hr

Export:
needs: CleanArtifacts # wait for artifacts to clean before making a new one
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Download + Authorize Godot
run: |
Expand Down Expand Up @@ -91,17 +82,18 @@ jobs:
./godot --headless --path ./ --export-release "Linux/X11" ./exports/${{ env.PROJECT_NAME }}.x86_64
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: exports
path: exports
overwrite: true

Release:
needs: Export
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_github_page
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Version
id: tag_version
Expand All @@ -114,7 +106,7 @@ jobs:
run: exit 1

- name: Download Exports
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: exports
path: exports
Expand Down Expand Up @@ -178,7 +170,7 @@ jobs:
content: v${{ github.event.inputs.export_version }}
mode: 0655

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: VERSION
path: ./VERSION.txt
Expand All @@ -189,7 +181,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download Exports
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: exports
path: exports
Expand Down
Binary file modified AMSG_Examples/Character/Animations/Idle.res
100755 → 100644
Binary file not shown.
Binary file modified AMSG_Examples/Character/Animations/JogForward.res
100755 → 100644
Binary file not shown.
Binary file modified AMSG_Examples/Character/Animations/Run.res
100755 → 100644
Binary file not shown.
Binary file modified AMSG_Examples/Character/Animations/Walk.res
100755 → 100644
Binary file not shown.
204 changes: 114 additions & 90 deletions AMSG_Examples/Character/mixamo_character.tscn

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions AMSG_Examples/Maps/LevelManager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,3 @@ func create_player(id: int) -> void:

func destroy_player(id: int) -> void:
find_child(str(id),true,false).queue_free()




4 changes: 2 additions & 2 deletions AMSG_Examples/Maps/MovementTestMap.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ transform = Transform3D(1, 0, 0, 0, -0.996865, 0.0791203, 0, -0.0791203, -0.9968
[node name="Stairs" type="Node3D" parent="."]

[node name="CSGBox3D8" type="CSGBox3D" parent="Stairs"]
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -1.42272, 1.61775, 1.38929)
transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -0.113655, 1.61365, 1.39355)
use_collision = true
size = Vector3(0.392448, 0.135761, 14.107)
size = Vector3(1.77032, 0.135761, 14.107)
material = ExtResource("3_27oba")

[node name="CSGBox3D9" type="CSGBox3D" parent="Stairs"]
Expand Down
229 changes: 118 additions & 111 deletions AMSG_Examples/Player/Player.tscn

Large diffs are not rendered by default.

20 changes: 13 additions & 7 deletions AMSG_Examples/Player/PlayerController.gd
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ func _physics_process(delta):
return

if lock_system != null && lock_system.is_locked:
direction = Vector3.ZERO
character_component.add_movement_input()
return

#------------------ Input Movement ------------------#
Expand All @@ -69,9 +67,6 @@ func _physics_process(delta):
character_component.add_movement_input(direction, character_component.current_movement_data.run_speed,character_component.current_movement_data.run_acceleration)
else:
character_component.add_movement_input(direction, character_component.current_movement_data.walk_speed,character_component.current_movement_data.walk_acceleration)
else:
direction = Vector3.ZERO
character_component.add_movement_input()


#------------------ Input Crouch ------------------#
Expand Down Expand Up @@ -133,11 +128,22 @@ func _physics_process(delta):
if Input.is_action_just_pressed("interaction"):
character_component.camera_root.Camera.get_node("InteractionRaycast").Interact()

if Input.is_action_just_pressed("show_debug"):
pass
if Input.is_action_just_pressed("switch_distance_matching"):
character_component.pose_warping_active = !character_component.pose_warping_active




var view_changed_recently = false
func _input(event):
if !Engine.is_editor_hint():
if Input.is_key_pressed(KEY_1):
DebugDraw3D.debug_enabled = !DebugDraw3D.debug_enabled
if Input.is_key_pressed(KEY_2):
DebugDraw2D.debug_enabled = !DebugDraw2D.debug_enabled
#if Input.is_key_pressed(KEY_3):
#DebugDrawManager.debug_enabled = !DebugDrawManager.debug_enabled

if event is InputEventMouseMotion:
if !character_component or !controls_the_possessed_character:
return
Expand Down
15 changes: 14 additions & 1 deletion AMSG_Examples/Player/Status.gd
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
extends Control
@onready var character_movement_component = $"../CharacterMovementComponent"

@export var camera_root : CameraComponent
@onready var player = get_parent()
@onready var direction = $Control/Direction
@onready var velocity = $Control/Velocity
@onready var mesh = $Control/mesh

@onready var rich_text_label = $RichTextLabel
@onready var rich_text_label_2 = $RichTextLabel2
var debug_text : String = ""
func _physics_process(_delta):
visible = camera_root.Camera.current
var h_rot = get_parent().get_node("SpringArm3D").transform.basis.get_euler().y
Expand All @@ -14,3 +17,13 @@ func _physics_process(_delta):
# direction.rotation = atan2(player.direction.z, player.direction.x)
velocity.position = Vector2(character_node_velocity.x, character_node_velocity.z) * 10
mesh.rotation = 90-get_node("../Armature").rotation.y - player.rotation.y - .5
if Input.is_action_just_pressed("show_panel"):
rich_text_label.visible = !rich_text_label.visible
debug_text = ""
debug_text += "3D_Debug_Enabled:[color="+true_false_text_color(DebugDraw3D.debug_enabled)+"]" + str(DebugDraw3D.debug_enabled) +"[/color] "
debug_text += "Instructions_Visible:[color="+true_false_text_color(rich_text_label.visible)+"]" + str(rich_text_label.visible) +"[/color] "
debug_text += "Distance_Matching_Enabled:[color="+true_false_text_color(character_movement_component.pose_warping_active)+"]" + str(character_movement_component.pose_warping_active) +"[/color]"
rich_text_label_2.text = debug_text

func true_false_text_color(state:bool) -> String:
return "green" if state else "red"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The Project is made using [Godot](https://github.com/godotengine/godot) 4

you can get Godot 4.2 Stable here : https://godotengine.org/
you can get Godot 4.3 Stable here : https://godotengine.org/

### Watch this video for preview :

Expand Down
1 change: 0 additions & 1 deletion addons/AMSG/AI/AI_Base.gd
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ func _physics_process(delta):
ik_look_at(-$CameraRoot/SpringArm3D.transform.basis.z * 2.0 + Vector3(0.0,1.5,0.0))
Global.rotation_mode.aiming:
ik_look_at(-$CameraRoot/SpringArm3D.transform.basis.z * 2.0 + Vector3(0.0,1.5,0.0))

8 changes: 2 additions & 6 deletions addons/AMSG/Components/AnimationComponents/AnimationBlend.gd
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,11 @@ func _physics_process(_delta):

#On Stopped
if !(Input.is_action_pressed("forward") || Input.is_action_pressed("back") || Input.is_action_pressed("right") || Input.is_action_pressed("left")) and (Input.is_action_just_released("right") || Input.is_action_just_released("back") || Input.is_action_just_released("left") || Input.is_action_just_released("forward")):

var seek_time = 0.1#get_node(anim_player).get_animation(tree_root.get_node("VelocityDirection").get_node("StopAnim").animation).length - movement_script.pose_warping_instance.CalculateStopTime((movement_script.actual_velocity * Vector3(1.0,0.0,1.0)),movement_script.deacceleration * movement_script.input_direction)
movement_script.pose_warping.CalculateStopLocation(movement_script.deacceleration)
var seek_time = 0.0#get_node(anim_player).get_animation(tree_root.get_node("VelocityDirection").get_node("StopAnim").animation).length - movement_script.pose_warping_instance.CalculateStopTime((movement_script.actual_velocity * Vector3(1.0,0.0,1.0)),movement_script.deacceleration * movement_script.input_direction)
set("parameters/VelocityDirection/StopSeek/seek_position",seek_time)
if !movement_script.input_is_moving:
set("parameters/VelocityDirection/Standing/transition_request","Stop")
#Rotate In Place
set("parameters/Turn/blend_amount" , 1 if movement_script.is_rotating_in_place else 0)
set("parameters/RightOrLeft/blend_amount" ,0 if movement_script.rotation_difference_camera_mesh > 0 else 1)




2 changes: 0 additions & 2 deletions addons/AMSG/Components/AttributesComponent/AttributesManager.gd
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ func _ready():
if !(child is GameAttribute):
assert("Only GameAttribute childs are allowed")
attributes[child.attribute_name] = child


Loading

0 comments on commit 20aadb0

Please sign in to comment.