├── AMSG_Examples
├── 3DObjects
│ └── Apple
│ │ ├── Apple.tscn
│ │ ├── AppleTexture.png
│ │ └── AppleTexture.png.import
├── Character
│ ├── Animations
│ │ ├── CrouchIdle.res
│ │ ├── CrouchWalkingForward.res
│ │ ├── Falling.res
│ │ ├── FallingStart.res
│ │ ├── FallingToRoll.res
│ │ ├── HardFalling.res
│ │ ├── Idle.res
│ │ ├── Idle1.res
│ │ ├── Idle2.res
│ │ ├── JogForward.res
│ │ ├── Jogbackward.res
│ │ ├── Kick.res
│ │ ├── Run.res
│ │ ├── RunToStop.res
│ │ ├── TPose.res
│ │ ├── TurnLeft.res
│ │ ├── TurnRight.res
│ │ ├── Walk.res
│ │ └── WalkingBackward.res
│ ├── BetterBoneAttachment3D.gd
│ ├── Character.blend
│ ├── Character.glb
│ ├── Character.glb.import
│ ├── Mesh
│ │ ├── .res
│ │ ├── Alpha_Body_MAT.res
│ │ ├── Alpha_Joints_MAT.res
│ │ ├── Character_Alpha_Joints.res
│ │ └── Character_Alpha_Surface.res
│ ├── crouch_movement_values.tres
│ ├── footstep_sound
│ │ ├── footstep1.wav
│ │ ├── footstep1.wav.import
│ │ ├── footstep10.wav
│ │ ├── footstep10.wav.import
│ │ ├── footstep2.wav
│ │ ├── footstep2.wav.import
│ │ ├── footstep3.wav
│ │ ├── footstep3.wav.import
│ │ ├── footstep4.wav
│ │ ├── footstep4.wav.import
│ │ ├── footstep5.wav
│ │ ├── footstep5.wav.import
│ │ ├── footstep6.wav
│ │ ├── footstep6.wav.import
│ │ ├── footstep7.wav
│ │ ├── footstep7.wav.import
│ │ ├── footstep8.wav
│ │ ├── footstep8.wav.import
│ │ ├── footstep9.wav
│ │ └── footstep9.wav.import
│ ├── mixamo_character.tscn
│ └── standing_movement_values.tres
├── GameLogic
│ └── SpawnPoint
│ │ └── player_spawn_location.tscn
├── Lut.JPG
├── Lut.JPG.import
├── Maps
│ ├── Grid.png
│ ├── Grid.png.import
│ ├── GridMat.tres
│ ├── LevelManager.gd
│ ├── MovementTestMap.tscn
│ └── default_env.tres
├── Player
│ ├── Player.tscn
│ ├── PlayerController.gd
│ ├── Status.gd
│ ├── UI
│ │ └── Debug
│ │ │ ├── circle.png
│ │ │ ├── circle.png.import
│ │ │ ├── direction.png
│ │ │ ├── direction.png.import
│ │ │ ├── velocity.png
│ │ │ └── velocity.png.import
│ └── flashlight
│ │ ├── Flashlight.gd
│ │ ├── Flashlight.tscn
│ │ ├── light_off.wav
│ │ ├── light_off.wav.import
│ │ ├── light_on.wav
│ │ └── light_on.wav.import
├── UI
│ └── test_ui.tscn
├── icon.png
└── icon.png.import
├── LICENSE
├── README.md
├── addons
├── AMSG
│ ├── AI
│ │ └── AI_Base.gd
│ ├── AMSG.gd
│ ├── Components
│ │ ├── AnimationComponents
│ │ │ ├── AnimationBlend.gd
│ │ │ ├── AnimationTreeBlendTree.tres
│ │ │ ├── AnimationTreeComponent.tscn
│ │ │ └── StandingStateMachine.tres
│ │ ├── AttributesComponent
│ │ │ ├── AttributesManager.gd
│ │ │ ├── AttributesManager.tscn
│ │ │ ├── GameAttribute.gd
│ │ │ ├── GameAttribute.tscn
│ │ │ ├── HealthAttribute.gd
│ │ │ └── StaminaAttribute.gd
│ │ ├── CameraComponent.gd
│ │ ├── CharacterMovementComponent.gd
│ │ ├── CombatComponent
│ │ │ ├── CombatSystem.gd
│ │ │ └── CombatSystem.tscn
│ │ ├── Interaction.gd
│ │ ├── LockComponent
│ │ │ └── LockSystem.gd
│ │ ├── MantleComponent
│ │ │ ├── MantleComponent.gd
│ │ │ └── MantleComponent.tscn
│ │ ├── Networking.tscn
│ │ ├── PlayerGameplayComponent.gd
│ │ ├── PlayerNetworkingComponent.gd
│ │ └── TargetingComponent
│ │ │ ├── TargetingComponent.gd
│ │ │ └── TargetingComponent.tscn
│ ├── Data
│ │ ├── camera_values.gd
│ │ └── movement_values.gd
│ ├── Global.gd
│ ├── Interactable
│ │ ├── Interactable.gd
│ │ └── Light
│ │ │ └── InteractableLight.gd
│ └── plugin.cfg
├── PoseWarping
│ ├── MotionWarping.gd
│ ├── MotionWarping.tscn
│ ├── PoseWarping.gd
│ ├── PoseWarping.tscn
│ ├── PoseWarpingPlugin.gd
│ └── plugin.cfg
└── debug_draw_3d
│ ├── LICENSE
│ ├── README.md
│ ├── debug_draw_3d.gdextension
│ └── libs
│ ├── .gdignore
│ ├── libdd3d.android.template_debug.arm32.so
│ ├── libdd3d.android.template_debug.arm64.so
│ ├── libdd3d.android.template_debug.x86_32.so
│ ├── libdd3d.android.template_debug.x86_64.so
│ ├── libdd3d.android.template_release.arm32.so
│ ├── libdd3d.android.template_release.arm64.so
│ ├── libdd3d.android.template_release.x86_32.so
│ ├── libdd3d.android.template_release.x86_64.so
│ ├── libdd3d.ios.template_debug.universal.dylib
│ ├── libdd3d.ios.template_release.universal.dylib
│ ├── libdd3d.ios.template_release.universal.enabled.dylib
│ ├── libdd3d.linux.editor.x86_64.so
│ ├── libdd3d.linux.template_release.x86_64.enabled.so
│ ├── libdd3d.linux.template_release.x86_64.so
│ ├── libdd3d.macos.editor.universal.framework
│ ├── Resources
│ │ └── Info.plist
│ └── libdd3d.macos.editor.universal
│ ├── libdd3d.macos.template_release.universal.enabled.framework
│ ├── Resources
│ │ └── Info.plist
│ └── libdd3d.macos.template_release.universal.enabled
│ ├── libdd3d.macos.template_release.universal.framework
│ ├── Resources
│ │ └── Info.plist
│ └── libdd3d.macos.template_release.universal
│ ├── libdd3d.web.template_debug.wasm32.wasm
│ ├── libdd3d.web.template_release.wasm32.enabled.wasm
│ ├── libdd3d.web.template_release.wasm32.wasm
│ ├── libdd3d.windows.editor.x86_64.dll
│ ├── libdd3d.windows.template_release.x86_64.dll
│ └── libdd3d.windows.template_release.x86_64.enabled.dll
├── default_bus_layout.tres
├── examples_dd3d
├── DebugDrawDemoScene.gd
├── DebugDrawDemoScene.tscn
├── DebugDrawDemoSceneCS.cs
├── DebugDrawDemoSceneCS.tscn
├── Roboto-Bold.ttf
├── Roboto-Bold.ttf.import
├── VisualizerAudioBus.tres
├── addon_icon.gd
├── addon_icon.tscn
├── demo_camera_movement.gd
├── demo_music_visualizer.gd
├── demo_settings_panel.gd
└── demo_web_docs_version_select.gd
├── export_presets.cfg
└── project.godot
/AMSG_Examples/3DObjects/Apple/AppleTexture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/3DObjects/Apple/AppleTexture.png
--------------------------------------------------------------------------------
/AMSG_Examples/3DObjects/Apple/AppleTexture.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bf5lvgcg5k6jb"
6 | path.s3tc="res://.godot/imported/AppleTexture.png-0e56774ce833ae2da1a005b085602ee9.s3tc.ctex"
7 | metadata={
8 | "imported_formats": ["s3tc_bptc"],
9 | "vram_texture": true
10 | }
11 |
12 | [deps]
13 |
14 | source_file="res://AMSG_Examples/3DObjects/Apple/AppleTexture.png"
15 | dest_files=["res://.godot/imported/AppleTexture.png-0e56774ce833ae2da1a005b085602ee9.s3tc.ctex"]
16 |
17 | [params]
18 |
19 | compress/mode=2
20 | compress/high_quality=false
21 | compress/lossy_quality=0.7
22 | compress/hdr_compression=1
23 | compress/normal_map=0
24 | compress/channel_pack=0
25 | mipmaps/generate=true
26 | mipmaps/limit=-1
27 | roughness/mode=0
28 | roughness/src_normal=""
29 | process/fix_alpha_border=true
30 | process/premult_alpha=false
31 | process/normal_map_invert_y=false
32 | process/hdr_as_srgb=false
33 | process/hdr_clamp_exposure=false
34 | process/size_limit=0
35 | detect_3d/compress_to=0
36 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/CrouchIdle.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/CrouchIdle.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/CrouchWalkingForward.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/CrouchWalkingForward.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/Falling.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/Falling.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/FallingStart.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/FallingStart.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/FallingToRoll.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/FallingToRoll.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/HardFalling.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/HardFalling.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/Idle.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/Idle.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/Idle1.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/Idle1.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/Idle2.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/Idle2.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/JogForward.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/JogForward.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/Jogbackward.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/Jogbackward.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/Kick.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/Kick.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/Run.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/Run.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/RunToStop.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/RunToStop.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/TPose.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/TPose.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/TurnLeft.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/TurnLeft.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/TurnRight.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/TurnRight.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/Walk.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/Walk.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Animations/WalkingBackward.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Animations/WalkingBackward.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/BetterBoneAttachment3D.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Marker3D
3 | class_name BetterBoneAttachment3D
4 | ## This is just a placeholder for BoneAttachment3D from my PR https://github.com/godotengine/godot/pull/82192/
5 |
6 | @export var bone_name : String
7 | @export var skeleton : Skeleton3D
8 | var bone_idx : int
9 |
10 | enum {BONE_POSE, BONE_POSE_OVERRIDE, BONE_POSE_NO_OVERRIDE, BONE_REST}
11 | @export_enum("BONE_POSE", "BONE_POSE_OVERRIDE", "BONE_POSE_NO_OVERRIDE", "BONE_REST") var bone_pose_mode : int = BONE_POSE
12 |
13 | func _ready():
14 | bone_idx = skeleton.find_bone(bone_name)
15 | print(bone_idx)
16 |
17 |
18 | func _process(delta):
19 | match bone_pose_mode:
20 | BONE_POSE:
21 | set_global_transform(skeleton.get_global_transform() * skeleton.get_bone_global_pose(bone_idx))
22 | BONE_POSE_OVERRIDE:
23 | set_global_transform(skeleton.get_global_transform() * skeleton.get_bone_global_pose_override(bone_idx))
24 | BONE_POSE_NO_OVERRIDE:
25 | set_global_transform(skeleton.get_global_transform() * skeleton.get_bone_global_pose_no_override(bone_idx))
26 | BONE_REST:
27 | set_global_transform(skeleton.get_global_transform() * skeleton.get_bone_global_rest(bone_idx))
28 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Character.blend:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Character.blend
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Character.glb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Character.glb
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Mesh/.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Mesh/.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Mesh/Alpha_Body_MAT.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Mesh/Alpha_Body_MAT.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Mesh/Alpha_Joints_MAT.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Mesh/Alpha_Joints_MAT.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Mesh/Character_Alpha_Joints.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Mesh/Character_Alpha_Joints.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/Mesh/Character_Alpha_Surface.res:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/Mesh/Character_Alpha_Surface.res
--------------------------------------------------------------------------------
/AMSG_Examples/Character/crouch_movement_values.tres:
--------------------------------------------------------------------------------
1 | [gd_resource type="Resource" script_class="movement_values" load_steps=2 format=3 uid="uid://bo31hnmxahuqb"]
2 |
3 | [ext_resource type="Script" path="res://addons/AMSG/Data/movement_values.gd" id="1_i6rpj"]
4 |
5 | [resource]
6 | script = ExtResource("1_i6rpj")
7 | walk_speed = 1.5
8 | run_speed = 2.0
9 | sprint_speed = 3.0
10 | walk_acceleration = 20.0
11 | run_acceleration = 20.0
12 | sprint_acceleration = 20.0
13 | idle_rotation_rate = 0.5
14 | walk_rotation_rate = 4.0
15 | run_rotation_rate = 5.0
16 | sprint_rotation_rate = 20.0
17 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep1.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/footstep_sound/footstep1.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep1.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://cffn28kxpgkqi"
6 | path="res://.godot/imported/footstep1.wav-e7173c42337309fb9eb74fc00a36b6ce.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Character/footstep_sound/footstep1.wav"
11 | dest_files=["res://.godot/imported/footstep1.wav-e7173c42337309fb9eb74fc00a36b6ce.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep10.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/footstep_sound/footstep10.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep10.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://dk8ppwj1wgdjo"
6 | path="res://.godot/imported/footstep10.wav-edb1e8b1b6f9c527f0f6dbaf8d2495b7.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Character/footstep_sound/footstep10.wav"
11 | dest_files=["res://.godot/imported/footstep10.wav-edb1e8b1b6f9c527f0f6dbaf8d2495b7.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep2.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/footstep_sound/footstep2.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep2.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://bpnobn6wg8hxp"
6 | path="res://.godot/imported/footstep2.wav-bda5bc229232fcef2607daff19b9aa62.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Character/footstep_sound/footstep2.wav"
11 | dest_files=["res://.godot/imported/footstep2.wav-bda5bc229232fcef2607daff19b9aa62.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep3.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/footstep_sound/footstep3.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep3.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://dy0na0kjknlqw"
6 | path="res://.godot/imported/footstep3.wav-28dc238fb84e90506b6008796cab7995.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Character/footstep_sound/footstep3.wav"
11 | dest_files=["res://.godot/imported/footstep3.wav-28dc238fb84e90506b6008796cab7995.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep4.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/footstep_sound/footstep4.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep4.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://dstan1vc4w7xy"
6 | path="res://.godot/imported/footstep4.wav-60f39b83dde1ffc00d2fb4255cccf6ed.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Character/footstep_sound/footstep4.wav"
11 | dest_files=["res://.godot/imported/footstep4.wav-60f39b83dde1ffc00d2fb4255cccf6ed.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep5.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/footstep_sound/footstep5.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep5.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://bnmj1hycr7gpt"
6 | path="res://.godot/imported/footstep5.wav-a8b00fac13ad3a2ca62a574fef77ca7c.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Character/footstep_sound/footstep5.wav"
11 | dest_files=["res://.godot/imported/footstep5.wav-a8b00fac13ad3a2ca62a574fef77ca7c.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep6.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/footstep_sound/footstep6.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep6.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://cgko5gxdkrsmp"
6 | path="res://.godot/imported/footstep6.wav-48ebd3b4ffc90bf4874d026e04e36948.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Character/footstep_sound/footstep6.wav"
11 | dest_files=["res://.godot/imported/footstep6.wav-48ebd3b4ffc90bf4874d026e04e36948.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep7.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/footstep_sound/footstep7.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep7.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://3f6a8dp4r7ax"
6 | path="res://.godot/imported/footstep7.wav-4d5b4ee29015ed71ea28fb1b34cd16de.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Character/footstep_sound/footstep7.wav"
11 | dest_files=["res://.godot/imported/footstep7.wav-4d5b4ee29015ed71ea28fb1b34cd16de.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep8.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/footstep_sound/footstep8.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep8.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://rt6uhd3xqtdr"
6 | path="res://.godot/imported/footstep8.wav-0faaf944bbb466e5f18988620174e1d3.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Character/footstep_sound/footstep8.wav"
11 | dest_files=["res://.godot/imported/footstep8.wav-0faaf944bbb466e5f18988620174e1d3.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep9.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Character/footstep_sound/footstep9.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Character/footstep_sound/footstep9.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://7x8t5eg1vvp3"
6 | path="res://.godot/imported/footstep9.wav-94c316a2263b092566a2d8b38686838b.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Character/footstep_sound/footstep9.wav"
11 | dest_files=["res://.godot/imported/footstep9.wav-94c316a2263b092566a2d8b38686838b.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/Character/standing_movement_values.tres:
--------------------------------------------------------------------------------
1 | [gd_resource type="Resource" script_class="movement_values" load_steps=2 format=3 uid="uid://buhjkpv85gdmi"]
2 |
3 | [ext_resource type="Script" path="res://addons/AMSG/Data/movement_values.gd" id="1_i36h3"]
4 |
5 | [resource]
6 | script = ExtResource("1_i36h3")
7 | walk_speed = 1.75
8 | run_speed = 3.75
9 | sprint_speed = 6.5
10 | walk_acceleration = 20.0
11 | run_acceleration = 20.0
12 | sprint_acceleration = 20.0
13 | idle_rotation_rate = 0.5
14 | walk_rotation_rate = 4.0
15 | run_rotation_rate = 5.0
16 | sprint_rotation_rate = 20.0
17 |
--------------------------------------------------------------------------------
/AMSG_Examples/GameLogic/SpawnPoint/player_spawn_location.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene format=3 uid="uid://daj0dc45avukm"]
2 |
3 | [node name="PlayerSpawnLocation" type="Marker3D"]
4 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.91311, 7.03314, 0)
5 |
6 | [node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."]
7 | _spawnable_scenes = PackedStringArray("res://AMSG_Examples/Player/Player.tscn")
8 | spawn_path = NodePath("..")
9 |
--------------------------------------------------------------------------------
/AMSG_Examples/Lut.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Lut.JPG
--------------------------------------------------------------------------------
/AMSG_Examples/Lut.JPG.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dcd3eiacliu6f"
6 | path="res://.godot/imported/Lut.JPG-190eca90821bdc8b1ba351ed89c59c9f.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://AMSG_Examples/Lut.JPG"
14 | dest_files=["res://.godot/imported/Lut.JPG-190eca90821bdc8b1ba351ed89c59c9f.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/AMSG_Examples/Maps/Grid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Maps/Grid.png
--------------------------------------------------------------------------------
/AMSG_Examples/Maps/Grid.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://c0cjfbiwbr1eh"
6 | path.s3tc="res://.godot/imported/Grid.png-89e09d5e1bfc67fa8b43a5e8124bb217.s3tc.ctex"
7 | metadata={
8 | "imported_formats": ["s3tc_bptc"],
9 | "vram_texture": true
10 | }
11 |
12 | [deps]
13 |
14 | source_file="res://AMSG_Examples/Maps/Grid.png"
15 | dest_files=["res://.godot/imported/Grid.png-89e09d5e1bfc67fa8b43a5e8124bb217.s3tc.ctex"]
16 |
17 | [params]
18 |
19 | compress/mode=2
20 | compress/high_quality=false
21 | compress/lossy_quality=0.7
22 | compress/hdr_compression=1
23 | compress/normal_map=0
24 | compress/channel_pack=0
25 | mipmaps/generate=true
26 | mipmaps/limit=-1
27 | roughness/mode=0
28 | roughness/src_normal=""
29 | process/fix_alpha_border=true
30 | process/premult_alpha=false
31 | process/normal_map_invert_y=false
32 | process/hdr_as_srgb=false
33 | process/hdr_clamp_exposure=false
34 | process/size_limit=0
35 | detect_3d/compress_to=0
36 |
--------------------------------------------------------------------------------
/AMSG_Examples/Maps/GridMat.tres:
--------------------------------------------------------------------------------
1 | [gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bf6te7t23qtp3"]
2 |
3 | [ext_resource type="Texture2D" uid="uid://c0cjfbiwbr1eh" path="res://AMSG_Examples/Maps/Grid.png" id="1_bneee"]
4 |
5 | [resource]
6 | albedo_texture = ExtResource("1_bneee")
7 | metallic_specular = 0.0
8 | uv1_triplanar = true
9 | uv1_world_triplanar = true
10 |
--------------------------------------------------------------------------------
/AMSG_Examples/Maps/LevelManager.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | class_name LevelManager
3 | ## This is responsible for spawning the player, managing the level itself
4 | ## and also includes simple UI and network connection for quick testing.
5 |
6 | @export_group("Test")
7 | ## It will show a network connection UI and allow you to spawn a test player character.
8 | ## Should be disabled if you have a main manu that will handle player connection, level and player spawning.
9 | @export var enable_testing : bool = true
10 | ## The test player character that is going to be spawned
11 | @export var player_character = preload("res://AMSG_Examples/Player/Player.tscn")
12 | @export var testing_ui = preload("res://AMSG_Examples/UI/test_ui.tscn")
13 | @export_group("Network")
14 | ## Default port to connect in testing
15 | @export var port := 8313
16 | ## Default IP Address to connect in testing
17 | @export var ip_address_to_connect := "localhost"
18 | @export_group("Spawn")
19 | @export var spawn_locations : Array[Node3D]
20 |
21 | var singleplayer := false
22 | var is_the_server_a_player := true #if it is peer to peer the server will also have a playable character
23 | # Called when the node enters the scene tree for the first time.
24 |
25 | var spawned_test_ui : Control
26 | func _enter_tree():
27 | # Start the server if Godot passed the "--server" argument,
28 | # and start the client if Godot passed the "--client" argument.
29 | if "--listen_server" in OS.get_cmdline_args():
30 | _on_server_pressed()
31 | elif "--client" in OS.get_cmdline_args():
32 | _on_client_pressed()
33 | elif "--server" in OS.get_cmdline_args():
34 | _on_d_server_pressed()
35 |
36 | if enable_testing:
37 | spawned_test_ui = testing_ui.instantiate()
38 | add_child(spawned_test_ui)
39 | spawned_test_ui.listen_server_button.connect("pressed", _on_server_pressed)
40 | spawned_test_ui.d_server_button.connect("pressed", _on_d_server_pressed)
41 | spawned_test_ui.client_button.connect("pressed", _on_client_pressed)
42 | spawned_test_ui.single_player_button.connect("pressed", _on_singleplayer_pressed)
43 | spawned_test_ui.main_menu_button.connect("pressed", _on_main_menu_pressed)
44 | spawned_test_ui.ip_textbox.connect("text_changed", _on_ip_address_text_changed)
45 |
46 | func _on_server_pressed():
47 | is_the_server_a_player = true
48 | start_network(true)
49 | get_window().title = "Server"
50 |
51 | func _on_d_server_pressed():
52 | is_the_server_a_player = false
53 | start_network(true)
54 | get_window().title = "Dedicated Server"
55 |
56 | func _on_client_pressed():
57 | start_network(false)
58 | get_window().title = "Client"
59 |
60 |
61 | func _on_singleplayer_pressed():
62 | single_player()
63 | get_window().title = "Singleplayer/Offline"
64 |
65 |
66 | func _on_main_menu_pressed():
67 | spawned_test_ui.listen_server_button.visible = true
68 | spawned_test_ui.d_server_button.visible = true
69 | spawned_test_ui.client_button.visible = true
70 | spawned_test_ui.single_player_button.visible = true
71 | Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
72 | if singleplayer:
73 | for Spawn in spawn_locations:
74 | for c in Spawn.get_children():
75 | c.queue_free()
76 | else:
77 | if multiplayer.is_server():
78 | for p in multiplayer.get_peers():
79 | destroy_player(p)
80 | if is_the_server_a_player:
81 | destroy_player(1)
82 | multiplayer.set_multiplayer_peer(null)
83 |
84 |
85 | func _input(event):
86 | if Input.is_action_just_pressed("exit"):
87 | _on_main_menu_pressed()
88 |
89 |
90 | func _on_ip_address_text_changed():
91 | if spawned_test_ui.ip_textbox.text == "":
92 | ip_address_to_connect = "localhost"
93 | else:
94 | ip_address_to_connect = spawned_test_ui.ip_textbox.text
95 |
96 |
97 |
98 |
99 | ######## Basic Network Handeling for testing ########
100 |
101 |
102 |
103 | func single_player():
104 | singleplayer = true
105 | spawned_test_ui.listen_server_button.visible = false
106 | spawned_test_ui.d_server_button.visible = false
107 | spawned_test_ui.client_button.visible = false
108 | spawned_test_ui.single_player_button.visible = false
109 | var p = player_character.instantiate()
110 | spawn_locations.pick_random().add_child(p)
111 |
112 |
113 | func start_network(server:bool) -> void:
114 | singleplayer = false
115 | spawned_test_ui.listen_server_button.visible = false
116 | spawned_test_ui.d_server_button.visible = false
117 | spawned_test_ui.client_button.visible = false
118 | spawned_test_ui.single_player_button.visible = false
119 | var peer = ENetMultiplayerPeer.new()
120 | #on server disconnected
121 | multiplayer.server_disconnected.connect(self.server_disconnected)
122 | #on connection failed
123 | multiplayer.connection_failed.connect(self.connection_failed)
124 | if server:
125 |
126 | #listen to peer connections, and create new player for them
127 | multiplayer.peer_connected.connect(self.player_joined)
128 | #listen to peer disconnections, and destroy their players
129 | multiplayer.peer_disconnected.connect(self.player_disconnected)
130 |
131 | peer.create_server(port)
132 | multiplayer.set_multiplayer_peer(peer)
133 | if is_the_server_a_player:
134 | create_player(1)
135 | print("server listening on %s" %IP.get_local_addresses()[0])
136 | else:
137 | peer.create_client(ip_address_to_connect,port)
138 | multiplayer.set_multiplayer_peer(peer)
139 |
140 |
141 | func player_joined(id:int):
142 | create_player(id)
143 | func player_disconnected(id:int):
144 | destroy_player(id)
145 | func server_disconnected():
146 | _on_main_menu_pressed()
147 | func connection_failed():
148 | print("connection failed")
149 |
150 |
151 | func create_player(id: int) -> void:
152 | var p = player_character.instantiate()
153 | p.set_name(str(id))
154 | spawn_locations.pick_random().add_child(p)
155 | # p.top_level = true
156 |
157 | func destroy_player(id: int) -> void:
158 | find_child(str(id),true,false).queue_free()
159 |
--------------------------------------------------------------------------------
/AMSG_Examples/Maps/MovementTestMap.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=13 format=3 uid="uid://mpaxkxn0fdto"]
2 |
3 | [ext_resource type="Environment" uid="uid://cfsln575lgopi" path="res://AMSG_Examples/Maps/default_env.tres" id="1_7h7du"]
4 | [ext_resource type="Script" path="res://AMSG_Examples/Maps/LevelManager.gd" id="1_rvsng"]
5 | [ext_resource type="PackedScene" uid="uid://daj0dc45avukm" path="res://AMSG_Examples/GameLogic/SpawnPoint/player_spawn_location.tscn" id="2_0g8sc"]
6 | [ext_resource type="Material" uid="uid://bf6te7t23qtp3" path="res://AMSG_Examples/Maps/GridMat.tres" id="3_27oba"]
7 | [ext_resource type="Script" path="res://addons/AMSG/Interactable/Light/InteractableLight.gd" id="4_kyyln"]
8 | [ext_resource type="PackedScene" uid="uid://f1hgkwi56ss6" path="res://AMSG_Examples/3DObjects/Apple/Apple.tscn" id="6_aiuj0"]
9 |
10 | [sub_resource type="BoxShape3D" id="BoxShape3D_2afi4"]
11 |
12 | [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dss5n"]
13 | albedo_color = Color(0.941176, 0, 0.227451, 1)
14 |
15 | [sub_resource type="BoxMesh" id="BoxMesh_n4eeh"]
16 | material = SubResource("StandardMaterial3D_dss5n")
17 |
18 | [sub_resource type="BoxMesh" id="BoxMesh_jwhxk"]
19 |
20 | [sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_5twjj"]
21 | points = PackedVector3Array(1, 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1)
22 |
23 | [sub_resource type="SphereMesh" id="SphereMesh_frhet"]
24 |
25 | [node name="Node" type="Node" node_paths=PackedStringArray("spawn_locations")]
26 | script = ExtResource("1_rvsng")
27 | spawn_locations = [NodePath("PlayerSpawnLocation")]
28 |
29 | [node name="PlayerSpawnLocation" parent="." instance=ExtResource("2_0g8sc")]
30 |
31 | [node name="light" type="StaticBody3D" parent="." groups=["detectable_object"]]
32 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.84419, 1.95787, 16.7421)
33 | collision_layer = 2
34 | script = ExtResource("4_kyyln")
35 | light = NodePath("../SpotLight3D")
36 |
37 | [node name="CollisionShape3D" type="CollisionShape3D" parent="light"]
38 | shape = SubResource("BoxShape3D_2afi4")
39 |
40 | [node name="MeshInstance3D" type="MeshInstance3D" parent="light/CollisionShape3D"]
41 | layers = 2
42 | mesh = SubResource("BoxMesh_n4eeh")
43 | skeleton = NodePath("../../..")
44 |
45 | [node name="CSGBox3D" type="CSGBox3D" parent="."]
46 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.21105, 0.573563, 2.89924)
47 | material_override = ExtResource("3_27oba")
48 | use_collision = true
49 | size = Vector3(50, 2, 50)
50 |
51 | [node name="CSGBox3D1" type="CSGBox3D" parent="."]
52 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.31349, 2.97282, -22.5958)
53 | use_collision = true
54 | size = Vector3(49.873, 3, 1)
55 | material = ExtResource("3_27oba")
56 |
57 | [node name="CSGBox3D2" type="CSGBox3D" parent="."]
58 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.31349, 2.97282, 28.4035)
59 | use_collision = true
60 | size = Vector3(49.873, 3, 1)
61 | material = ExtResource("3_27oba")
62 |
63 | [node name="CSGBox3D3" type="CSGBox3D" parent="."]
64 | transform = Transform3D(-0.00308923, 0, 0.999995, 0, 1, 0, -0.999995, 0, -0.00308923, 25.873, 2.97282, 2.67917)
65 | use_collision = true
66 | size = Vector3(55, 3, 1)
67 | material = ExtResource("3_27oba")
68 |
69 | [node name="CSGBox3D4" type="CSGBox3D" parent="."]
70 | transform = Transform3D(-0.00308923, 0, 0.999995, 0, 1, 0, -0.999995, 0, -0.00308923, -23.5016, 2.97282, 2.67917)
71 | use_collision = true
72 | size = Vector3(55, 3, 1)
73 | material = ExtResource("3_27oba")
74 |
75 | [node name="CSGBox3D5" type="CSGBox3D" parent="."]
76 | transform = Transform3D(-0.843984, -0.536342, -0.0052146, -0.536332, 0.844001, -0.00331375, 0.00617843, -3.16889e-10, -0.99998, 10.3494, 1.99632, 1.41695)
77 | use_collision = true
78 | size = Vector3(4.60107, 0.502591, 14.107)
79 | material = ExtResource("3_27oba")
80 |
81 | [node name="CSGBox3D7" type="CSGBox3D" parent="."]
82 | transform = Transform3D(0.849607, 0.527317, -0.0102242, -0.527376, 0.849622, -0.004133, 0.00650729, 0.00890342, 0.999939, 18.6499, 2.07674, 1.42846)
83 | use_collision = true
84 | size = Vector3(4.60107, 0.502591, 14.0192)
85 | material = ExtResource("3_27oba")
86 |
87 | [node name="CSGBox3D6" type="CSGBox3D" parent="."]
88 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, 14.4541, 3.1768, 1.38929)
89 | use_collision = true
90 | size = Vector3(4.60107, 0.502591, 14.107)
91 | material = ExtResource("3_27oba")
92 |
93 | [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
94 | transform = Transform3D(0.998819, 0.0194639, 0.0445193, -0.0467522, 0.634491, 0.771515, -0.0132304, -0.772685, 0.634652, -0.531392, 8.38026, -2.80088)
95 | layers = 0
96 | shadow_enabled = true
97 |
98 | [node name="SpotLight3D" type="SpotLight3D" parent="."]
99 | transform = Transform3D(1, 0, 0, 0, -0.996865, 0.0791203, 0, -0.0791203, -0.996865, 0.789293, 2.01648, 14.7671)
100 |
101 | [node name="Stairs" type="Node3D" parent="."]
102 |
103 | [node name="CSGBox3D8" type="CSGBox3D" parent="Stairs"]
104 | 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)
105 | use_collision = true
106 | size = Vector3(1.77032, 0.135761, 14.107)
107 | material = ExtResource("3_27oba")
108 |
109 | [node name="CSGBox3D9" type="CSGBox3D" parent="Stairs"]
110 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -1.80449, 1.74329, 1.38929)
111 | use_collision = true
112 | size = Vector3(0.392448, 0.135761, 14.107)
113 | material = ExtResource("3_27oba")
114 |
115 | [node name="CSGBox3D10" type="CSGBox3D" parent="Stairs"]
116 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -2.17758, 1.87023, 1.38929)
117 | use_collision = true
118 | size = Vector3(0.392448, 0.135761, 14.107)
119 | material = ExtResource("3_27oba")
120 |
121 | [node name="@CSGBox3D10@19582" type="CSGBox3D" parent="Stairs"]
122 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -2.55936, 1.99577, 1.38929)
123 | use_collision = true
124 | size = Vector3(0.392448, 0.135761, 14.107)
125 | material = ExtResource("3_27oba")
126 |
127 | [node name="CSGBox3D11" type="CSGBox3D" parent="Stairs"]
128 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -2.8971, 2.11789, 1.38929)
129 | use_collision = true
130 | size = Vector3(0.392448, 0.135761, 14.107)
131 | material = ExtResource("3_27oba")
132 |
133 | [node name="@CSGBox3D11@20746" type="CSGBox3D" parent="Stairs"]
134 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -3.27887, 2.24343, 1.38929)
135 | use_collision = true
136 | size = Vector3(0.392448, 0.135761, 14.107)
137 | material = ExtResource("3_27oba")
138 |
139 | [node name="@CSGBox3D11@20747" type="CSGBox3D" parent="Stairs"]
140 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -3.65196, 2.37037, 1.38929)
141 | use_collision = true
142 | size = Vector3(0.392448, 0.135761, 14.107)
143 | material = ExtResource("3_27oba")
144 |
145 | [node name="CSGBox3D1019582" type="CSGBox3D" parent="Stairs"]
146 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -4.03373, 2.49591, 1.38929)
147 | use_collision = true
148 | size = Vector3(0.392448, 0.135761, 14.107)
149 | material = ExtResource("3_27oba")
150 |
151 | [node name="CSGBox3D12" type="CSGBox3D" parent="Stairs"]
152 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -4.41911, 2.62279, 1.38929)
153 | use_collision = true
154 | size = Vector3(0.392448, 0.135761, 14.107)
155 | material = ExtResource("3_27oba")
156 |
157 | [node name="@CSGBox3D12@21676" type="CSGBox3D" parent="Stairs"]
158 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -4.80088, 2.74833, 1.38929)
159 | use_collision = true
160 | size = Vector3(0.392448, 0.135761, 14.107)
161 | material = ExtResource("3_27oba")
162 |
163 | [node name="@CSGBox3D12@21677" type="CSGBox3D" parent="Stairs"]
164 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -5.17397, 2.87527, 1.38929)
165 | use_collision = true
166 | size = Vector3(0.392448, 0.135761, 14.107)
167 | material = ExtResource("3_27oba")
168 |
169 | [node name="CSGBox3D1019583" type="CSGBox3D" parent="Stairs"]
170 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -5.55574, 3.00081, 1.38929)
171 | use_collision = true
172 | size = Vector3(0.392448, 0.135761, 14.107)
173 | material = ExtResource("3_27oba")
174 |
175 | [node name="@CSGBox3D12@21678" type="CSGBox3D" parent="Stairs"]
176 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -5.89349, 3.12293, 1.38929)
177 | use_collision = true
178 | size = Vector3(0.392448, 0.135761, 14.107)
179 | material = ExtResource("3_27oba")
180 |
181 | [node name="CSGBox3D1120746" type="CSGBox3D" parent="Stairs"]
182 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -6.27526, 3.24847, 1.38929)
183 | use_collision = true
184 | size = Vector3(0.392448, 0.135761, 14.107)
185 | material = ExtResource("3_27oba")
186 |
187 | [node name="CSGBox3D1120747" type="CSGBox3D" parent="Stairs"]
188 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -6.64835, 3.37541, 1.38929)
189 | use_collision = true
190 | size = Vector3(0.392448, 0.135761, 14.107)
191 | material = ExtResource("3_27oba")
192 |
193 | [node name="@CSGBox3D1019583@21679" type="CSGBox3D" parent="Stairs"]
194 | transform = Transform3D(-0.999963, -0.00595152, -0.00617832, -0.0059514, 0.999982, -3.67712e-05, 0.00617843, 0, -0.99998, -7.03012, 3.50095, 1.38929)
195 | use_collision = true
196 | size = Vector3(0.392448, 0.135761, 14.107)
197 | material = ExtResource("3_27oba")
198 |
199 | [node name="RigidDynamicBody3D" type="RigidBody3D" parent="." groups=["detectable_object"]]
200 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.92094, 2.54135, 14.9625)
201 | gravity_scale = -0.07
202 | lock_rotation = true
203 |
204 | [node name="MeshInstance3D" type="MeshInstance3D" parent="RigidDynamicBody3D"]
205 | gi_mode = 2
206 | mesh = SubResource("BoxMesh_jwhxk")
207 |
208 | [node name="CollisionShape3D" type="CollisionShape3D" parent="RigidDynamicBody3D"]
209 | transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
210 | shape = SubResource("ConvexPolygonShape3D_5twjj")
211 |
212 | [node name="RigidDynamicBody3D2" type="RigidBody3D" parent="." groups=["detectable_object"]]
213 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.11323, 5.04718, 13.5922)
214 | mass = 0.01
215 |
216 | [node name="MeshInstance3D" type="MeshInstance3D" parent="RigidDynamicBody3D2"]
217 | gi_mode = 2
218 | mesh = SubResource("BoxMesh_jwhxk")
219 |
220 | [node name="CollisionShape3D" type="CollisionShape3D" parent="RigidDynamicBody3D2"]
221 | transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
222 | shape = SubResource("ConvexPolygonShape3D_5twjj")
223 |
224 | [node name="RigidDynamicBody3D3" type="RigidBody3D" parent="." groups=["detectable_object"]]
225 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.89079, 5.04718, 13.7933)
226 | mass = 0.01
227 |
228 | [node name="MeshInstance3D" type="MeshInstance3D" parent="RigidDynamicBody3D3"]
229 | gi_mode = 2
230 | mesh = SubResource("BoxMesh_jwhxk")
231 |
232 | [node name="CollisionShape3D" type="CollisionShape3D" parent="RigidDynamicBody3D3"]
233 | transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
234 | shape = SubResource("ConvexPolygonShape3D_5twjj")
235 |
236 | [node name="RigidDynamicBody3D4" type="RigidBody3D" parent="." groups=["detectable_object"]]
237 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.51824, 6.10535, 13.6351)
238 | mass = 0.01
239 |
240 | [node name="MeshInstance3D" type="MeshInstance3D" parent="RigidDynamicBody3D4"]
241 | gi_mode = 2
242 | mesh = SubResource("BoxMesh_jwhxk")
243 |
244 | [node name="CollisionShape3D" type="CollisionShape3D" parent="RigidDynamicBody3D4"]
245 | transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
246 | shape = SubResource("ConvexPolygonShape3D_5twjj")
247 |
248 | [node name="RigidDynamicBody3D5" type="RigidBody3D" parent="." groups=["detectable_object"]]
249 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.85594, 6.10535, 13.6351)
250 | mass = 0.01
251 |
252 | [node name="MeshInstance3D" type="MeshInstance3D" parent="RigidDynamicBody3D5"]
253 | gi_mode = 2
254 | mesh = SubResource("BoxMesh_jwhxk")
255 |
256 | [node name="CollisionShape3D" type="CollisionShape3D" parent="RigidDynamicBody3D5"]
257 | transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
258 | shape = SubResource("ConvexPolygonShape3D_5twjj")
259 |
260 | [node name="Apple" parent="." instance=ExtResource("6_aiuj0")]
261 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.07152, 4.14037, 7.15481)
262 |
263 | [node name="@Apple@40298" parent="." instance=ExtResource("6_aiuj0")]
264 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.5983, 4.14037, 7.57517)
265 |
266 | [node name="@Apple@40303" parent="." instance=ExtResource("6_aiuj0")]
267 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.64226, 4.14037, 7.48438)
268 |
269 | [node name="@Apple@40308" parent="." instance=ExtResource("6_aiuj0")]
270 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.31481, 4.14037, 7.25267)
271 |
272 | [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
273 | environment = ExtResource("1_7h7du")
274 |
275 | [node name="FogVolume" type="FogVolume" parent="."]
276 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14.4926, 1.50598, 1.53421)
277 | size = Vector3(8.04038, 2.81726, 14.0993)
278 |
279 | [node name="StopLocation" type="MeshInstance3D" parent="."]
280 | transform = Transform3D(0.309258, 0, 0, 0, 0.309258, 0, 0, 0, 0.309258, 0, 2.47683, 0)
281 | mesh = SubResource("SphereMesh_frhet")
282 |
283 | [node name="Label3D" type="Label3D" parent="."]
284 | transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0.873827, 3.49466, 16.8514)
285 | pixel_size = 0.008
286 | text = "Look at the red box and press F to switch the light"
287 |
288 | [node name="CSGSphere3D" type="CSGSphere3D" parent="."]
289 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.32753, 0.0729122, -7.36135)
290 | use_collision = true
291 | radius = 2.09949
292 | radial_segments = 32
293 | rings = 32
294 |
--------------------------------------------------------------------------------
/AMSG_Examples/Maps/default_env.tres:
--------------------------------------------------------------------------------
1 | [gd_resource type="Environment" load_steps=4 format=3 uid="uid://cfsln575lgopi"]
2 |
3 | [ext_resource type="Texture2D" uid="uid://dcd3eiacliu6f" path="res://AMSG_Examples/Lut.JPG" id="1_5tnx1"]
4 |
5 | [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_8pwhp"]
6 | sky_top_color = Color(0.576471, 0.690196, 0.733333, 1)
7 | sun_angle_max = 120.35
8 |
9 | [sub_resource type="Sky" id="1"]
10 | sky_material = SubResource("ProceduralSkyMaterial_8pwhp")
11 |
12 | [resource]
13 | background_mode = 2
14 | sky = SubResource("1")
15 | tonemap_mode = 3
16 | sdfgi_use_occlusion = true
17 | glow_levels/3 = 16.0
18 | glow_levels/5 = 16.0
19 | glow_normalized = true
20 | glow_blend_mode = 0
21 | glow_hdr_threshold = 0.5
22 | glow_map = ExtResource("1_5tnx1")
23 | fog_enabled = true
24 | fog_light_color = Color(0.27451, 0.423529, 0.607843, 1)
25 | fog_density = 0.004
26 | volumetric_fog_enabled = true
27 | volumetric_fog_density = 0.007
28 |
--------------------------------------------------------------------------------
/AMSG_Examples/Player/PlayerController.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | class_name PlayerController
3 |
4 | #####################################
5 | #Controls Settings
6 | @export var OnePressJump := false
7 | @export var UsingSprintToggle := false
8 | @export var UsingCrouchToggle := false
9 | #####################################
10 |
11 | @export var character_component : PlayerGameplayComponent
12 | @export var networking : PlayerNetworkingComponent
13 |
14 | var controls_the_possessed_character:bool=false
15 | var peer_id:int
16 | var inputs :int
17 | var input_vector :Vector2
18 | var h_rotation :float
19 | #var v_rotation :float
20 | var previous_rotation_mode
21 | var direction := Vector3.ZERO
22 |
23 | #####################################
24 | #Locks System
25 | @export var lock_system : LockSystem
26 | #####################################
27 |
28 | @export var mouse_sensitivity : float = 0.01
29 |
30 |
31 |
32 |
33 | func _ready():
34 | Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
35 |
36 | possess_character(character_component,true)
37 |
38 |
39 |
40 | func possess_character(p_character_component:CharacterMovementComponent,control:bool):
41 | if character_component:
42 | character_component.camera_root.Camera.current = false
43 | controls_the_possessed_character = control
44 | character_component = p_character_component
45 | character_component.camera_root.Camera.current = networking.is_local_authority()
46 |
47 |
48 | func _physics_process(delta):
49 | if !networking.is_local_authority():
50 | return
51 |
52 | if lock_system != null && lock_system.is_locked:
53 | return
54 |
55 | #------------------ Input Movement ------------------#
56 | h_rotation = character_component.camera_root.HObject.transform.basis.get_euler().y
57 | var v_rotation = character_component.camera_root.VObject.transform.basis.get_euler().x
58 |
59 | if Input.is_action_pressed("forward") || Input.is_action_pressed("back") || Input.is_action_pressed("right") || Input.is_action_pressed("left") :
60 | direction = Vector3(Input.get_action_strength("right") - Input.get_action_strength("left"),
61 | remap(v_rotation,-PI/2,PI/2,-1.0,1.0) if character_component.is_flying == true else 0.0,
62 | Input.get_action_strength("back") - Input.get_action_strength("forward"))
63 | direction = direction.rotated(Vector3.UP,h_rotation).normalized()
64 | if character_component.gait == Global.gait.sprinting :
65 | character_component.add_movement_input(direction, character_component.current_movement_data.sprint_speed,character_component.current_movement_data.sprint_acceleration)
66 | elif character_component.gait == Global.gait.running:
67 | character_component.add_movement_input(direction, character_component.current_movement_data.run_speed,character_component.current_movement_data.run_acceleration)
68 | else:
69 | character_component.add_movement_input(direction, character_component.current_movement_data.walk_speed,character_component.current_movement_data.walk_acceleration)
70 |
71 |
72 | #------------------ Input Crouch ------------------#
73 | if UsingCrouchToggle == false:
74 | if Input.is_action_pressed("crouch"):
75 | if character_component.stance != Global.stance.crouching:
76 | character_component.stance = Global.stance.crouching
77 | else:
78 | if character_component.stance != Global.stance.standing:
79 | character_component.stance = Global.stance.standing
80 | else:
81 | if Input.is_action_just_pressed("crouch"):
82 | character_component.stance = Global.stance.standing if character_component.stance == Global.stance.crouching else Global.stance.crouching
83 | #------------------ Sprint ------------------#
84 | if UsingSprintToggle:
85 | if Input.is_action_just_pressed("sprint"):
86 | if character_component.gait == Global.gait.walking:
87 | character_component.gait = Global.gait.running
88 | elif character_component.gait == Global.gait.running:
89 | character_component.gait = Global.gait.sprinting
90 | elif character_component.gait == Global.gait.sprinting:
91 | character_component.gait = Global.gait.walking
92 | else:
93 | if Input.is_action_just_pressed("sprint"):
94 | if character_component.gait == Global.gait.walking:
95 | character_component.gait = Global.gait.running
96 | elif character_component.gait == Global.gait.running:
97 | character_component.gait = Global.gait.sprinting
98 | if Input.is_action_just_released("sprint"):
99 | if character_component.gait == Global.gait.sprinting or character_component.gait == Global.gait.walking:
100 | character_component.gait = Global.gait.walking
101 | elif character_component.gait == Global.gait.running:
102 | await get_tree().create_timer(0.4).timeout
103 | if character_component.gait == Global.gait.running:
104 | character_component.gait = Global.gait.walking
105 | #------------------ Input Aim ------------------#
106 | if Input.is_action_pressed("aim"):
107 | if character_component.rotation_mode != Global.rotation_mode.aiming:
108 | previous_rotation_mode = character_component.rotation_mode
109 | character_component.rotation_mode = Global.rotation_mode.aiming
110 | else:
111 | if character_component.rotation_mode == Global.rotation_mode.aiming:
112 | character_component.rotation_mode = previous_rotation_mode
113 | #------------------ Jump ------------------#=
114 | if OnePressJump == true:
115 | if Input.is_action_just_pressed("jump"):
116 | if character_component.stance != Global.stance.standing:
117 | character_component.stance = Global.stance.standing
118 | else:
119 | character_component.jump()
120 | else:
121 | if Input.is_action_pressed("jump"):
122 | if character_component.stance != Global.stance.standing:
123 | character_component.stance = Global.stance.standing
124 | else:
125 | character_component.jump()
126 |
127 | #------------------ Interaction ------------------#
128 | if Input.is_action_just_pressed("interaction"):
129 | character_component.camera_root.Camera.get_node("InteractionRaycast").Interact()
130 |
131 | if Input.is_action_just_pressed("show_debug"):
132 | pass
133 | if Input.is_action_just_pressed("switch_distance_matching"):
134 | character_component.pose_warping_active = !character_component.pose_warping_active
135 |
136 |
137 | var view_changed_recently = false
138 | func _input(event):
139 | if !Engine.is_editor_hint():
140 | if Input.is_key_pressed(KEY_1):
141 | DebugDraw3D.debug_enabled = !DebugDraw3D.debug_enabled
142 | if Input.is_key_pressed(KEY_2):
143 | DebugDraw2D.debug_enabled = !DebugDraw2D.debug_enabled
144 | #if Input.is_key_pressed(KEY_3):
145 | #DebugDrawManager.debug_enabled = !DebugDrawManager.debug_enabled
146 |
147 | if event is InputEventMouseMotion:
148 | if !character_component or !controls_the_possessed_character:
149 | return
150 | character_component.camera_root.camera_h += -event.relative.x * mouse_sensitivity
151 | character_component.camera_root.camera_v += -event.relative.y * mouse_sensitivity
152 | #------------------ Motion Warping test------------------#
153 | if event.is_action_pressed("fire"):
154 | character_component.anim_ref.active = false
155 | get_node("../MotionWarping").add_sync_position(Vector3(4.762,1.574,-1.709),Vector3(0,PI,0),"kick_target",self,character_component.mesh_ref)
156 | get_node("../AnimationPlayer").play("Kick")
157 | await get_tree().create_timer(2.6).timeout
158 | character_component.anim_ref.active = true
159 |
160 | #------------------ Change Camera View ------------------#
161 | if Input.is_action_just_released("switch_camera_view"):
162 | if view_changed_recently == false:
163 | view_changed_recently = true
164 | character_component.camera_root.view_angle = character_component.camera_root.view_angle + 1 if character_component.camera_root.view_angle < 2 else 0
165 | await get_tree().create_timer(0.3).timeout
166 | view_changed_recently = false
167 | else:
168 | view_changed_recently = false
169 | if Input.is_action_just_pressed("switch_camera_view"):
170 | await get_tree().create_timer(0.2).timeout
171 | if view_changed_recently == false:
172 | character_component.camera_root.view_mode = character_component.camera_root.view_mode + 1 if character_component.camera_root.view_mode < 1 else 0
173 | view_changed_recently = true
174 | if networking.is_local_authority():
175 | if event.is_action_pressed("EnableSDFGI"):
176 | var postprocess = preload("res://AMSG_Examples/Maps/default_env.tres")
177 | postprocess.sdfgi_enabled = not postprocess.sdfgi_enabled
178 | postprocess.ssil_enabled = not postprocess.ssil_enabled
179 | postprocess.ssao_enabled = not postprocess.ssao_enabled
180 | postprocess.ssr_enabled = not postprocess.ssr_enabled
181 | postprocess.glow_enabled = not postprocess.glow_enabled
182 | if event.is_action_pressed("ragdoll"):
183 | character_component.ragdoll = true
184 |
185 |
186 | if character_component.rotation_mode == Global.rotation_mode.velocity_direction:
187 | if character_component.camera_root != null:
188 | if character_component.camera_root.view_mode == Global.view_mode.first_person:
189 | character_component.camera_root.view_mode = Global.view_mode.third_person
190 |
191 | if(Input.is_action_pressed("pause")):
192 | if(lock_system.contains_lock("pauseGame")):
193 | lock_system.remove_lock("pauseGame")
194 | else:
195 | lock_system.add_lock("pauseGame")
196 |
--------------------------------------------------------------------------------
/AMSG_Examples/Player/Status.gd:
--------------------------------------------------------------------------------
1 | extends Control
2 | @onready var character_movement_component = $"../CharacterMovementComponent"
3 |
4 | @export var camera_root : CameraComponent
5 | @onready var player = get_parent()
6 | @onready var direction = $Control/Direction
7 | @onready var velocity = $Control/Velocity
8 | @onready var mesh = $Control/mesh
9 | @onready var rich_text_label = $RichTextLabel
10 | @onready var rich_text_label_2 = $RichTextLabel2
11 | var debug_text : String = ""
12 | func _physics_process(_delta):
13 | visible = camera_root.Camera.current
14 | var h_rot = get_parent().get_node("SpringArm3D").transform.basis.get_euler().y
15 | var character_node_velocity = player.velocity if player is CharacterBody3D else player.linear_velocity
16 | $Control.set_rotation(h_rot)
17 | # direction.rotation = atan2(player.direction.z, player.direction.x)
18 | velocity.position = Vector2(character_node_velocity.x, character_node_velocity.z) * 10
19 | mesh.rotation = 90-get_node("../Armature").rotation.y - player.rotation.y - .5
20 | if Input.is_action_just_pressed("show_panel"):
21 | rich_text_label.visible = !rich_text_label.visible
22 | debug_text = ""
23 | debug_text += "3D_Debug_Enabled:[color="+true_false_text_color(DebugDraw3D.debug_enabled)+"]" + str(DebugDraw3D.debug_enabled) +"[/color] "
24 | debug_text += "Instructions_Visible:[color="+true_false_text_color(rich_text_label.visible)+"]" + str(rich_text_label.visible) +"[/color] "
25 | debug_text += "Distance_Matching_Enabled:[color="+true_false_text_color(character_movement_component.pose_warping_active)+"]" + str(character_movement_component.pose_warping_active) +"[/color]"
26 | rich_text_label_2.text = debug_text
27 |
28 | func true_false_text_color(state:bool) -> String:
29 | return "green" if state else "red"
30 |
--------------------------------------------------------------------------------
/AMSG_Examples/Player/UI/Debug/circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Player/UI/Debug/circle.png
--------------------------------------------------------------------------------
/AMSG_Examples/Player/UI/Debug/circle.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dpkisrpco54qj"
6 | path="res://.godot/imported/circle.png-bc756eb36090bb45c162c7c395bd325e.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://AMSG_Examples/Player/UI/Debug/circle.png"
14 | dest_files=["res://.godot/imported/circle.png-bc756eb36090bb45c162c7c395bd325e.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=1
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/AMSG_Examples/Player/UI/Debug/direction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Player/UI/Debug/direction.png
--------------------------------------------------------------------------------
/AMSG_Examples/Player/UI/Debug/direction.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://ijv6wr22hov8"
6 | path="res://.godot/imported/direction.png-6aeae12aea4a3b74f566790ca48f11d5.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://AMSG_Examples/Player/UI/Debug/direction.png"
14 | dest_files=["res://.godot/imported/direction.png-6aeae12aea4a3b74f566790ca48f11d5.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=1
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/AMSG_Examples/Player/UI/Debug/velocity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Player/UI/Debug/velocity.png
--------------------------------------------------------------------------------
/AMSG_Examples/Player/UI/Debug/velocity.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://ck5riwbh478s4"
6 | path="res://.godot/imported/velocity.png-1d9e4b73ab49623978c32500b4446591.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://AMSG_Examples/Player/UI/Debug/velocity.png"
14 | dest_files=["res://.godot/imported/velocity.png-1d9e4b73ab49623978c32500b4446591.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=1
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/AMSG_Examples/Player/flashlight/Flashlight.gd:
--------------------------------------------------------------------------------
1 | extends SpotLight3D
2 |
3 |
4 | var light_on_sound = preload("res://AMSG_Examples/Player/flashlight/light_on.wav")
5 | var light_off_sound = preload("res://AMSG_Examples/Player/flashlight/light_off.wav")
6 | var can_use = true
7 |
8 | func _ready():
9 | hide()
10 |
11 | func _input(_event):
12 | if Input.is_action_pressed("flashlight"):
13 | if can_use:
14 | can_use = false
15 | visible = !visible
16 | if visible:
17 | play_sound(light_on_sound, -10)
18 | else:
19 | play_sound(light_off_sound, -10)
20 | else:
21 | can_use = true
22 |
23 |
24 | func play_sound(sound, volume):
25 | var audio_node = AudioStreamPlayer.new()
26 | add_child(audio_node)
27 | audio_node.stream = sound
28 | audio_node.volume_db = volume
29 | audio_node.pitch_scale = randf_range(0.95, 1.05)
30 | audio_node.play()
31 | await get_tree().create_timer(2.0).timeout
32 | audio_node.queue_free()
33 |
--------------------------------------------------------------------------------
/AMSG_Examples/Player/flashlight/Flashlight.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://bpe4kqq0dsptn"]
2 |
3 | [ext_resource type="Script" path="res://AMSG_Examples/Player/flashlight/Flashlight.gd" id="1_2fd76"]
4 |
5 | [node name="Flashlight" type="SpotLight3D"]
6 | script = ExtResource("1_2fd76")
7 |
--------------------------------------------------------------------------------
/AMSG_Examples/Player/flashlight/light_off.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Player/flashlight/light_off.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Player/flashlight/light_off.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://cucrwfqvn2cx3"
6 | path="res://.godot/imported/light_off.wav-64db62be0bd0877a17a419164ebdbd0a.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Player/flashlight/light_off.wav"
11 | dest_files=["res://.godot/imported/light_off.wav-64db62be0bd0877a17a419164ebdbd0a.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/Player/flashlight/light_on.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/Player/flashlight/light_on.wav
--------------------------------------------------------------------------------
/AMSG_Examples/Player/flashlight/light_on.wav.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="wav"
4 | type="AudioStreamWAV"
5 | uid="uid://cvr02ya5qaegd"
6 | path="res://.godot/imported/light_on.wav-6600e039605970d15368347a64bbc212.sample"
7 |
8 | [deps]
9 |
10 | source_file="res://AMSG_Examples/Player/flashlight/light_on.wav"
11 | dest_files=["res://.godot/imported/light_on.wav-6600e039605970d15368347a64bbc212.sample"]
12 |
13 | [params]
14 |
15 | force/8_bit=false
16 | force/mono=false
17 | force/max_rate=false
18 | force/max_rate_hz=44100
19 | edit/trim=false
20 | edit/normalize=false
21 | edit/loop_mode=0
22 | edit/loop_begin=0
23 | edit/loop_end=-1
24 | compress/mode=0
25 |
--------------------------------------------------------------------------------
/AMSG_Examples/UI/test_ui.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://cpte38hjq65na"]
2 |
3 | [sub_resource type="GDScript" id="GDScript_5sjy5"]
4 | script/source = "extends Control
5 |
6 |
7 | @export var single_player_button : Button
8 | @export var listen_server_button : Button
9 | @export var d_server_button : Button
10 | @export var client_button : Button
11 | @export var main_menu_button : Button
12 | @export var ip_textbox : TextEdit
13 | "
14 |
15 | [node name="TestUI" type="Control" node_paths=PackedStringArray("single_player_button", "listen_server_button", "d_server_button", "client_button", "main_menu_button", "ip_textbox")]
16 | layout_mode = 3
17 | anchors_preset = 15
18 | anchor_right = 1.0
19 | anchor_bottom = 1.0
20 | grow_horizontal = 2
21 | grow_vertical = 2
22 | size_flags_horizontal = 3
23 | size_flags_vertical = 3
24 | script = SubResource("GDScript_5sjy5")
25 | single_player_button = NodePath("CenterContainer/VBoxContainer/HBoxContainer2/SingleplayerButton")
26 | listen_server_button = NodePath("CenterContainer/VBoxContainer/HBoxContainer/ListenServerButton")
27 | d_server_button = NodePath("CenterContainer/VBoxContainer/HBoxContainer/DServerButton")
28 | client_button = NodePath("CenterContainer/VBoxContainer/HBoxContainer2/ClientButton")
29 | main_menu_button = NodePath("MainMenuButton")
30 | ip_textbox = NodePath("CenterContainer/VBoxContainer/HBoxContainer2/ClientButton/IP_addressTextBox")
31 |
32 | [node name="CenterContainer" type="CenterContainer" parent="."]
33 | layout_mode = 1
34 | anchors_preset = 15
35 | anchor_right = 1.0
36 | anchor_bottom = 1.0
37 | grow_horizontal = 2
38 | grow_vertical = 2
39 |
40 | [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
41 | custom_minimum_size = Vector2(500, 100)
42 | layout_mode = 2
43 |
44 | [node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer"]
45 | layout_mode = 2
46 | size_flags_vertical = 3
47 |
48 | [node name="ListenServerButton" type="Button" parent="CenterContainer/VBoxContainer/HBoxContainer"]
49 | layout_mode = 2
50 | size_flags_horizontal = 3
51 | text = "Listen Server
52 | "
53 |
54 | [node name="DServerButton" type="Button" parent="CenterContainer/VBoxContainer/HBoxContainer"]
55 | layout_mode = 2
56 | size_flags_horizontal = 3
57 | text = "Dedicated Server
58 | "
59 |
60 | [node name="HBoxContainer2" type="HBoxContainer" parent="CenterContainer/VBoxContainer"]
61 | layout_mode = 2
62 | size_flags_vertical = 3
63 |
64 | [node name="ClientButton" type="Button" parent="CenterContainer/VBoxContainer/HBoxContainer2"]
65 | layout_mode = 2
66 | size_flags_horizontal = 3
67 | text = "Client
68 | "
69 |
70 | [node name="IP_addressTextBox" type="TextEdit" parent="CenterContainer/VBoxContainer/HBoxContainer2/ClientButton"]
71 | layout_mode = 1
72 | anchors_preset = 15
73 | anchor_right = 1.0
74 | anchor_bottom = 1.0
75 | offset_top = 50.0
76 | offset_bottom = 50.0
77 | grow_horizontal = 2
78 | grow_vertical = 2
79 | size_flags_horizontal = 3
80 | placeholder_text = "localhost"
81 | metadata/_edit_layout_mode = 0
82 | metadata/_edit_use_custom_anchors = false
83 |
84 | [node name="SingleplayerButton" type="Button" parent="CenterContainer/VBoxContainer/HBoxContainer2"]
85 | layout_mode = 2
86 | size_flags_horizontal = 3
87 | text = "Singleplayer
88 | "
89 |
90 | [node name="MainMenuButton" type="Button" parent="."]
91 | layout_mode = 1
92 | anchors_preset = 3
93 | anchor_left = 1.0
94 | anchor_top = 1.0
95 | anchor_right = 1.0
96 | anchor_bottom = 1.0
97 | offset_left = -143.0
98 | offset_top = -47.0
99 | grow_horizontal = 0
100 | grow_vertical = 0
101 | size_flags_horizontal = 4
102 | size_flags_vertical = 4
103 | text = "Main Menu"
104 |
--------------------------------------------------------------------------------
/AMSG_Examples/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/AMSG_Examples/icon.png
--------------------------------------------------------------------------------
/AMSG_Examples/icon.png.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dkclvfkl080vn"
6 | path="res://.godot/imported/icon.png-91290734e58f6569ce9232be7f2819e7.ctex"
7 | metadata={
8 | "vram_texture": false
9 | }
10 |
11 | [deps]
12 |
13 | source_file="res://AMSG_Examples/icon.png"
14 | dest_files=["res://.godot/imported/icon.png-91290734e58f6569ce9232be7f2819e7.ctex"]
15 |
16 | [params]
17 |
18 | compress/mode=0
19 | compress/high_quality=false
20 | compress/lossy_quality=0.7
21 | compress/hdr_compression=1
22 | compress/normal_map=0
23 | compress/channel_pack=0
24 | mipmaps/generate=false
25 | mipmaps/limit=-1
26 | roughness/mode=0
27 | roughness/src_normal=""
28 | process/fix_alpha_border=true
29 | process/premult_alpha=false
30 | process/normal_map_invert_y=false
31 | process/hdr_as_srgb=false
32 | process/hdr_clamp_exposure=false
33 | process/size_limit=0
34 | detect_3d/compress_to=1
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021-2022 ywmaa
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Welcome to the Advanced-Movement-System-Godot V1
2 |
3 | The Project is made using [Godot](https://github.com/godotengine/godot) 4
4 |
5 | you can get Godot 4.3 Stable here : https://godotengine.org/
6 |
7 | ### Watch this video for preview :
8 |
9 | [](https://youtu.be/TiIriuw9s9U)
10 |
11 | # This project is a template for creating advanced Third/First Person movement in [GODOT](https://github.com/godotengine/godot)
12 | You may use it in any other camera type like RTS, but you will need to tweak it yourself.
13 |
14 | ## (adding to existing project)
15 | 1- copy the files to your Godot project
16 |
17 | 2- Add the following Input Maps to your project
18 |
19 | ```
20 | [input]
21 |
22 | forward
23 | back
24 | left
25 | right
26 | jump
27 | sprint
28 | aim
29 | crouch
30 | interaction
31 | switch_camera_view
32 | ragdoll
33 | flashlight
34 | EnableSDFGI
35 | exit
36 | fire
37 | pause
38 | ```
39 |
40 | 3- autoload the "Global.gd" GDscript, you can find it in "res://addons/AMSG/Global.gd"
41 |
42 |
43 | # Importing characters and animations from mixamo to Godot 4
44 | https://youtu.be/59vKbXKuaNI
45 |
46 | # Animation Retargeting in Godot 4 tutroial :
47 | https://godotengine.org/article/animation-retargeting-in-godot-4-0 .
48 |
49 | # For how to fix the armature wrong bones orientation and create a control rig for mixamo character in blender to animate the character :
50 | https://youtu.be/zfaskQ2BK1s .
51 |
52 | # Guide for combining animations from mixamo
53 | https://youtu.be/3NrsSdEUSWI .
54 |
55 | # Guide for importing animations from blender (If you don't have a ready game rig (Control Rig only)
56 | https://youtu.be/qwz9aPdVoFg .
57 |
58 | # if you don't know what does this (game rig,control rig) mean, then this will help
59 | https://youtube.com/playlist?list=PLdcL5aF8ZcJvCyqWeCBYVGKbQgrQngen3) .
60 |
61 |
62 | ## How to Move (Key Bindings) :
63 |
64 | (W,A,S,D) Move In The Four Directions
65 |
66 | (Shift) Run
67 |
68 | (Shift) Sprint (Press Shift Again before the character returns to walking (0.4 second))
69 |
70 | (C) Long Press : Switch First/Third Person View
71 |
72 | (C) One Press : Switch Camera Angle (Right Shoulder,Left Shoulder,Head(Center) )
73 |
74 | (P) Pause : Toggles a lock on player movement, and shows a message on-screen
75 |
76 | (Space) Jump
77 |
78 | (CTRL) Crouch/UnCrouch
79 |
80 |
81 |
82 | (F) Interaction
83 |
84 | (L) Flashlight
85 |
86 | (G) To toggle High graphics : SDFGI (Global illumination),SSIL, SSAO,SSR,Glow
87 |
--------------------------------------------------------------------------------
/addons/AMSG/AI/AI_Base.gd:
--------------------------------------------------------------------------------
1 | extends CharacterMovementComponent
2 | class_name AI
3 |
4 |
5 | var h_rotation :float
6 | var v_rotation :float
7 |
8 | var direction := Vector3.FORWARD
9 |
10 | var Previousrotation_mode
11 | func _ready():
12 | super._ready()
13 |
14 |
15 | func _physics_process(delta):
16 | super._physics_process(delta)
17 |
18 |
19 | #------------------ Input Movement ------------------#
20 | h_rotation = $CameraRoot.HObject.transform.basis.get_euler().y
21 | v_rotation = $CameraRoot.VObject.transform.basis.get_euler().x
22 |
23 |
24 | add_movement_input(Vector3(0.0,0.0,1.0), current_movement_data.walk_speed,current_movement_data.walk_acceleration)
25 |
26 | #------------------ Look At ------------------#
27 | match rotation_mode:
28 | Global.rotation_mode.velocity_direction:
29 | if input_is_moving:
30 | ik_look_at(actual_velocity + Vector3(0.0,1.0,0.0))
31 | Global.rotation_mode.looking_direction:
32 | ik_look_at(-$CameraRoot/SpringArm3D.transform.basis.z * 2.0 + Vector3(0.0,1.5,0.0))
33 | Global.rotation_mode.aiming:
34 | ik_look_at(-$CameraRoot/SpringArm3D.transform.basis.z * 2.0 + Vector3(0.0,1.5,0.0))
35 |
--------------------------------------------------------------------------------
/addons/AMSG/AMSG.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends EditorPlugin
3 |
4 |
5 | func _enter_tree():
6 | # Initialization of the plugin goes here.
7 | pass
8 |
9 |
10 | func _exit_tree():
11 | # Clean-up of the plugin goes here.
12 | pass
13 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/AnimationComponents/AnimationBlend.gd:
--------------------------------------------------------------------------------
1 | extends AnimationTree
2 | class_name AnimBlend
3 | @onready @export var movement_script : CharacterMovementComponent # I use this to get variables from main movement script
4 |
5 | func _physics_process(_delta):
6 | if !movement_script:
7 | return
8 |
9 | #Set Animation State
10 | match movement_script.movement_state:
11 | Global.movement_state.none:
12 | pass
13 | Global.movement_state.grounded:
14 | set("parameters/InAir/blend_amount" , 0)
15 | Global.movement_state.in_air:
16 | set("parameters/InAir/blend_amount" , 1)
17 | Global.movement_state.mantling:
18 | pass
19 | Global.movement_state.ragdoll:
20 | pass
21 |
22 | #standing
23 | if !movement_script.input_is_moving:
24 | set("parameters/VelocityDirection/Standing/transition_request","Idle")
25 | set("parameters/VelocityDirection/crouching/transition_request","Idle")
26 | if movement_script.gait == Global.gait.walking and movement_script.input_is_moving:
27 | set("parameters/VelocityDirection/Standing/transition_request","Walk")
28 | set("parameters/VelocityDirection/crouching/transition_request","Walk")
29 | if movement_script.gait == Global.gait.running and movement_script.input_is_moving:
30 | set("parameters/VelocityDirection/Standing/transition_request","Jog")
31 | if movement_script.gait == Global.gait.sprinting and movement_script.input_is_moving:
32 | set("parameters/VelocityDirection/Standing/transition_request","Run")
33 |
34 | #Couch/stand switch
35 | match movement_script.stance:
36 | Global.stance.standing:
37 | set("parameters/VelocityDirection/crouch/transition_request" , "stand")
38 | Global.stance.crouching:
39 |
40 | set("parameters/VelocityDirection/crouch/transition_request" , "crouch")
41 |
42 |
43 | if movement_script.rotation_mode == Global.rotation_mode.looking_direction or movement_script.rotation_mode == Global.rotation_mode.aiming:
44 | if movement_script.animation_is_moving_backward_relative_to_camera == false:
45 | set("parameters/VelocityDirection/WalkFB/transition_request","Forward")
46 | set("parameters/VelocityDirection/JogFB/transition_request","Forward")
47 | else:
48 | set("parameters/VelocityDirection/WalkFB/transition_request","Backward")
49 | set("parameters/VelocityDirection/JogFB/transition_request","Backward")
50 |
51 | else:
52 | set("parameters/VelocityDirection/WalkFB/transition_request","Forward")
53 | set("parameters/VelocityDirection/JogFB/transition_request","Forward")
54 |
55 | #On Stopped
56 | 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")):
57 | movement_script.pose_warping.CalculateStopLocation(movement_script.deacceleration)
58 | 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)
59 | set("parameters/VelocityDirection/StopSeek/seek_position",seek_time)
60 | if !movement_script.input_is_moving:
61 | set("parameters/VelocityDirection/Standing/transition_request","Stop")
62 | #Rotate In Place
63 | set("parameters/Turn/blend_amount" , 1 if movement_script.is_rotating_in_place else 0)
64 | set("parameters/RightOrLeft/blend_amount" ,0 if movement_script.rotation_difference_camera_mesh > 0 else 1)
65 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/AnimationComponents/AnimationTreeBlendTree.tres:
--------------------------------------------------------------------------------
1 | [gd_resource type="AnimationNodeBlendTree" load_steps=23 format=3 uid="uid://vjkfv8poa6di"]
2 |
3 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_mb2kt"]
4 | animation = &"TurnLeft"
5 |
6 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2rfjg"]
7 | animation = &"TurnRight"
8 |
9 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_v6381"]
10 | animation = &"Falling"
11 |
12 | [sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_nojly"]
13 | sync = true
14 |
15 | [sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_85ljr"]
16 | sync = true
17 |
18 | [sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_2agtf"]
19 | filter_enabled = true
20 | filters = ["Armature/Skeleton3D:Hips", "Armature/Skeleton3D:LeftFoot", "Armature/Skeleton3D:LeftLeg", "Armature/Skeleton3D:LeftToeBase", "Armature/Skeleton3D:LeftUpLeg", "Armature/Skeleton3D:RightFoot", "Armature/Skeleton3D:RightLeg", "Armature/Skeleton3D:RightToeBase", "Armature/Skeleton3D:RightUpLeg"]
21 | sync = true
22 |
23 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_urp0s"]
24 | animation = &"CrouchIdle"
25 |
26 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ei4oj"]
27 | animation = &"CrouchWalkingForward"
28 |
29 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_y1cwa"]
30 | animation = &"Idle"
31 |
32 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_tk6mn"]
33 | animation = &"Jogbackward"
34 |
35 | [sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_5harx"]
36 | sync = true
37 | xfade_time = 0.1
38 | input_0/name = "Forward"
39 | input_0/auto_advance = false
40 | input_0/reset = true
41 | input_1/name = "Backward"
42 | input_1/auto_advance = false
43 | input_1/reset = true
44 |
45 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_m0htu"]
46 | animation = &"JogForward"
47 |
48 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ygb5o"]
49 | animation = &"Run"
50 |
51 | [sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_dcoe6"]
52 | sync = true
53 | xfade_time = 0.2
54 | input_0/name = "Idle"
55 | input_0/auto_advance = false
56 | input_0/reset = true
57 | input_1/name = "Walk"
58 | input_1/auto_advance = false
59 | input_1/reset = true
60 | input_2/name = "Run"
61 | input_2/auto_advance = false
62 | input_2/reset = true
63 | input_3/name = "Jog"
64 | input_3/auto_advance = false
65 | input_3/reset = true
66 | input_4/name = "Stop"
67 | input_4/auto_advance = false
68 | input_4/reset = true
69 |
70 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_81j80"]
71 | animation = &"RunToStop"
72 |
73 | [sub_resource type="AnimationNodeTimeSeek" id="AnimationNodeTimeSeek_iea8q"]
74 |
75 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2wk0k"]
76 | animation = &"WalkingBackward"
77 |
78 | [sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_f311e"]
79 | sync = true
80 | xfade_time = 0.1
81 | input_0/name = "Forward"
82 | input_0/auto_advance = false
83 | input_0/reset = true
84 | input_1/name = "Backward"
85 | input_1/auto_advance = false
86 | input_1/reset = true
87 |
88 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_bmtvy"]
89 | animation = &"Walk"
90 |
91 | [sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_3twx3"]
92 | sync = true
93 | xfade_time = 0.3
94 | input_0/name = "stand"
95 | input_0/auto_advance = false
96 | input_0/reset = true
97 | input_1/name = "crouch"
98 | input_1/auto_advance = false
99 | input_1/reset = true
100 |
101 | [sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_rufvy"]
102 | sync = true
103 | xfade_time = 0.2
104 | input_0/name = "Idle"
105 | input_0/auto_advance = false
106 | input_0/reset = true
107 | input_1/name = "Walk"
108 | input_1/auto_advance = false
109 | input_1/reset = true
110 |
111 | [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_ml0kl"]
112 | graph_offset = Vector2(-623.521, -64.6002)
113 | nodes/CrouchIdle/node = SubResource("AnimationNodeAnimation_urp0s")
114 | nodes/CrouchIdle/position = Vector2(-380, 640)
115 | nodes/CrouchWalkingForward/node = SubResource("AnimationNodeAnimation_ei4oj")
116 | nodes/CrouchWalkingForward/position = Vector2(-380, 760)
117 | nodes/Idle/node = SubResource("AnimationNodeAnimation_y1cwa")
118 | nodes/Idle/position = Vector2(-480, -260)
119 | nodes/JogBackward/node = SubResource("AnimationNodeAnimation_tk6mn")
120 | nodes/JogBackward/position = Vector2(-500, 340)
121 | nodes/JogFB/node = SubResource("AnimationNodeTransition_5harx")
122 | nodes/JogFB/position = Vector2(-320, 240)
123 | nodes/JogForward/node = SubResource("AnimationNodeAnimation_m0htu")
124 | nodes/JogForward/position = Vector2(-500, 240)
125 | nodes/Run/node = SubResource("AnimationNodeAnimation_ygb5o")
126 | nodes/Run/position = Vector2(-480, 120)
127 | nodes/Standing/node = SubResource("AnimationNodeTransition_dcoe6")
128 | nodes/Standing/position = Vector2(-140, -120)
129 | nodes/StopAnim/node = SubResource("AnimationNodeAnimation_81j80")
130 | nodes/StopAnim/position = Vector2(-520, 460)
131 | nodes/StopSeek/node = SubResource("AnimationNodeTimeSeek_iea8q")
132 | nodes/StopSeek/position = Vector2(-340, 460)
133 | nodes/WalkBackward/node = SubResource("AnimationNodeAnimation_2wk0k")
134 | nodes/WalkBackward/position = Vector2(-520, 0)
135 | nodes/WalkFB/node = SubResource("AnimationNodeTransition_f311e")
136 | nodes/WalkFB/position = Vector2(-320, -120)
137 | nodes/WalkForward/node = SubResource("AnimationNodeAnimation_bmtvy")
138 | nodes/WalkForward/position = Vector2(-480, -120)
139 | nodes/crouch/node = SubResource("AnimationNodeTransition_3twx3")
140 | nodes/crouch/position = Vector2(100, 180)
141 | nodes/crouching/node = SubResource("AnimationNodeTransition_rufvy")
142 | nodes/crouching/position = Vector2(-120, 640)
143 | node_connections = [&"output", 0, &"crouch", &"crouch", 0, &"Standing", &"crouch", 1, &"crouching", &"crouching", 0, &"CrouchIdle", &"crouching", 1, &"CrouchWalkingForward", &"WalkFB", 0, &"WalkForward", &"WalkFB", 1, &"WalkBackward", &"StopSeek", 0, &"StopAnim", &"JogFB", 0, &"JogForward", &"JogFB", 1, &"JogBackward", &"Standing", 0, &"Idle", &"Standing", 1, &"WalkFB", &"Standing", 2, &"Run", &"Standing", 3, &"JogFB", &"Standing", 4, &"StopSeek"]
144 |
145 | [resource]
146 | resource_local_to_scene = true
147 | graph_offset = Vector2(176.043, 371.32)
148 | nodes/AnimTurnLeft/node = SubResource("AnimationNodeAnimation_mb2kt")
149 | nodes/AnimTurnLeft/position = Vector2(500, 1540)
150 | nodes/AnimTurnRight/node = SubResource("AnimationNodeAnimation_2rfjg")
151 | nodes/AnimTurnRight/position = Vector2(500, 1660)
152 | nodes/FallAnimation/node = SubResource("AnimationNodeAnimation_v6381")
153 | nodes/FallAnimation/position = Vector2(1060, 1600)
154 | nodes/InAir/node = SubResource("AnimationNodeBlend2_nojly")
155 | nodes/InAir/position = Vector2(1280, 1380)
156 | nodes/RightOrLeft/node = SubResource("AnimationNodeBlend2_85ljr")
157 | nodes/RightOrLeft/position = Vector2(720, 1560)
158 | nodes/Turn/node = SubResource("AnimationNodeBlend2_2agtf")
159 | nodes/Turn/position = Vector2(980, 1400)
160 | nodes/VelocityDirection/node = SubResource("AnimationNodeBlendTree_ml0kl")
161 | nodes/VelocityDirection/position = Vector2(680, 1400)
162 | nodes/output/position = Vector2(1540, 1400)
163 | node_connections = [&"output", 0, &"InAir", &"InAir", 0, &"Turn", &"InAir", 1, &"FallAnimation", &"RightOrLeft", 0, &"AnimTurnLeft", &"RightOrLeft", 1, &"AnimTurnRight", &"Turn", 0, &"VelocityDirection", &"Turn", 1, &"RightOrLeft"]
164 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/AnimationComponents/AnimationTreeComponent.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=45 format=3 uid="uid://dsdvjuk7muqkf"]
2 |
3 | [ext_resource type="Script" path="res://addons/AMSG/Components/AnimationComponents/AnimationBlend.gd" id="1_iikhh"]
4 | [ext_resource type="AnimationNodeStateMachinePlayback" uid="uid://b8p1518kwrou2" path="res://addons/AMSG/Components/AnimationComponents/StandingStateMachine.tres" id="2_oomli"]
5 |
6 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_mb2kt"]
7 | animation = &"TurnLeft"
8 |
9 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2rfjg"]
10 | animation = &"TurnRight"
11 |
12 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_v6381"]
13 | animation = &"Falling"
14 |
15 | [sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_nojly"]
16 | sync = true
17 |
18 | [sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_85ljr"]
19 | sync = true
20 |
21 | [sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_2agtf"]
22 | filter_enabled = true
23 | filters = ["Armature/Skeleton3D:Hips", "Armature/Skeleton3D:LeftFoot", "Armature/Skeleton3D:LeftLeg", "Armature/Skeleton3D:LeftToeBase", "Armature/Skeleton3D:LeftUpLeg", "Armature/Skeleton3D:RightFoot", "Armature/Skeleton3D:RightLeg", "Armature/Skeleton3D:RightToeBase", "Armature/Skeleton3D:RightUpLeg"]
24 | sync = true
25 |
26 | [sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_3twx3"]
27 | sync = true
28 | xfade_time = 0.3
29 | input_0/name = "stand"
30 | input_0/auto_advance = false
31 | input_0/reset = true
32 | input_1/name = "crouch"
33 | input_1/auto_advance = false
34 | input_1/reset = true
35 |
36 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_id6x0"]
37 | animation = &"CrouchIdle"
38 |
39 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_cri6g"]
40 | animation = &"CrouchWalkingForward"
41 |
42 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_urt4k"]
43 | advance_mode = 2
44 | advance_condition = &"idle"
45 |
46 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6juuf"]
47 | xfade_time = 0.2
48 | switch_mode = 1
49 | advance_mode = 2
50 | advance_condition = &"walking"
51 |
52 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_611fp"]
53 | xfade_time = 0.2
54 | switch_mode = 1
55 | advance_mode = 2
56 | advance_condition = &"idle"
57 |
58 | [sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_2xodt"]
59 | states/CrouchIdle/node = SubResource("AnimationNodeAnimation_id6x0")
60 | states/CrouchIdle/position = Vector2(321, 100)
61 | states/CrouchWalkingForward/node = SubResource("AnimationNodeAnimation_cri6g")
62 | states/CrouchWalkingForward/position = Vector2(560, 100)
63 | states/Start/position = Vector2(157, 100)
64 | transitions = ["Start", "CrouchIdle", SubResource("AnimationNodeStateMachineTransition_urt4k"), "CrouchIdle", "CrouchWalkingForward", SubResource("AnimationNodeStateMachineTransition_6juuf"), "CrouchWalkingForward", "CrouchIdle", SubResource("AnimationNodeStateMachineTransition_611fp")]
65 |
66 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_u8pjd"]
67 | animation = &"Idle"
68 |
69 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_4dxpj"]
70 | animation = &"Jogbackward"
71 |
72 | [sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_mk3d0"]
73 | input_0/name = "Forward"
74 | input_0/auto_advance = false
75 | input_0/reset = true
76 | input_1/name = "Backward"
77 | input_1/auto_advance = false
78 | input_1/reset = true
79 |
80 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6bsh6"]
81 | animation = &"JogForward"
82 |
83 | [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_r61ry"]
84 | graph_offset = Vector2(-467, 62.6111)
85 | nodes/Backward/node = SubResource("AnimationNodeAnimation_4dxpj")
86 | nodes/Backward/position = Vector2(-100, 220)
87 | nodes/FB/node = SubResource("AnimationNodeTransition_mk3d0")
88 | nodes/FB/position = Vector2(140, 140)
89 | nodes/Forward/node = SubResource("AnimationNodeAnimation_6bsh6")
90 | nodes/Forward/position = Vector2(-100, 100)
91 | node_connections = [&"FB", 0, &"Forward", &"FB", 1, &"Backward", &"output", 0, &"FB"]
92 |
93 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_pgipy"]
94 | animation = &"Run"
95 |
96 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_hwdqf"]
97 | animation = &"RunToStop"
98 |
99 | [sub_resource type="AnimationNodeTimeSeek" id="AnimationNodeTimeSeek_3wh8r"]
100 |
101 | [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_xw0ge"]
102 | graph_offset = Vector2(-348.252, 95.8945)
103 | nodes/StopAnim/node = SubResource("AnimationNodeAnimation_hwdqf")
104 | nodes/StopAnim/position = Vector2(-260, 180)
105 | nodes/StopSeek/node = SubResource("AnimationNodeTimeSeek_3wh8r")
106 | nodes/StopSeek/position = Vector2(-60, 160)
107 | node_connections = [&"StopSeek", 0, &"StopAnim", &"output", 0, &"StopSeek"]
108 |
109 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_dxjg6"]
110 | animation = &"WalkingBackward"
111 |
112 | [sub_resource type="AnimationNodeTransition" id="AnimationNodeTransition_tyxgb"]
113 | input_0/name = "Forward"
114 | input_0/auto_advance = false
115 | input_0/reset = true
116 | input_1/name = "Backward"
117 | input_1/auto_advance = false
118 | input_1/reset = true
119 |
120 | [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_3y4dp"]
121 | animation = &"Walk"
122 |
123 | [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_3e37y"]
124 | graph_offset = Vector2(-388, 64)
125 | nodes/Backward/node = SubResource("AnimationNodeAnimation_dxjg6")
126 | nodes/Backward/position = Vector2(-100, 180)
127 | nodes/FB/node = SubResource("AnimationNodeTransition_tyxgb")
128 | nodes/FB/position = Vector2(140, 100)
129 | nodes/Forward/node = SubResource("AnimationNodeAnimation_3y4dp")
130 | nodes/Forward/position = Vector2(-60, 60)
131 | node_connections = [&"FB", 0, &"Forward", &"FB", 1, &"Backward", &"output", 0, &"FB"]
132 |
133 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_wnbtw"]
134 | xfade_time = 0.2
135 | switch_mode = 2
136 | advance_mode = 2
137 | advance_condition = &"idle"
138 |
139 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_rvsaa"]
140 | advance_mode = 2
141 | advance_condition = &"stop"
142 |
143 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_s0egl"]
144 | xfade_time = 0.2
145 | switch_mode = 1
146 | advance_mode = 2
147 | advance_condition = &"sprinting"
148 |
149 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xf5i1"]
150 | advance_mode = 2
151 | advance_condition = &"idle"
152 |
153 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_nbs2g"]
154 | xfade_time = 0.2
155 | switch_mode = 1
156 | advance_mode = 2
157 | advance_condition = &"walking"
158 |
159 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_rs3n0"]
160 | advance_mode = 2
161 | advance_condition = &"stop"
162 |
163 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6gab4"]
164 | xfade_time = 0.2
165 | switch_mode = 1
166 | advance_mode = 2
167 | advance_condition = &"running"
168 |
169 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6m5a2"]
170 | xfade_time = 0.2
171 | switch_mode = 1
172 | advance_mode = 2
173 | advance_condition = &"walking"
174 |
175 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_hy2h2"]
176 | xfade_time = 0.2
177 | switch_mode = 1
178 | advance_mode = 2
179 | advance_condition = &"running"
180 |
181 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2tyel"]
182 | xfade_time = 0.2
183 | switch_mode = 1
184 | advance_mode = 2
185 | advance_condition = &"sprinting"
186 |
187 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_7h1qf"]
188 | advance_mode = 2
189 | advance_condition = &"stop"
190 |
191 | [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4twgu"]
192 | xfade_time = 0.2
193 | switch_mode = 1
194 | advance_mode = 2
195 | advance_condition = &"running"
196 |
197 | [sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_ieguh"]
198 | states/Idle/node = SubResource("AnimationNodeAnimation_u8pjd")
199 | states/Idle/position = Vector2(137, 278)
200 | states/Jog/node = SubResource("AnimationNodeBlendTree_r61ry")
201 | states/Jog/position = Vector2(687.227, 134)
202 | states/Run/node = SubResource("AnimationNodeAnimation_pgipy")
203 | states/Run/position = Vector2(881, 296)
204 | states/Start/position = Vector2(22, 278)
205 | states/Stopping/node = SubResource("AnimationNodeBlendTree_xw0ge")
206 | states/Stopping/position = Vector2(505, 327)
207 | states/Walk/node = SubResource("AnimationNodeBlendTree_3e37y")
208 | states/Walk/position = Vector2(216.227, 134)
209 | transitions = ["Stopping", "Idle", SubResource("AnimationNodeStateMachineTransition_wnbtw"), "Run", "Stopping", SubResource("AnimationNodeStateMachineTransition_rvsaa"), "Idle", "Run", SubResource("AnimationNodeStateMachineTransition_s0egl"), "Start", "Idle", SubResource("AnimationNodeStateMachineTransition_xf5i1"), "Idle", "Walk", SubResource("AnimationNodeStateMachineTransition_nbs2g"), "Walk", "Stopping", SubResource("AnimationNodeStateMachineTransition_rs3n0"), "Walk", "Jog", SubResource("AnimationNodeStateMachineTransition_6gab4"), "Jog", "Walk", SubResource("AnimationNodeStateMachineTransition_6m5a2"), "Run", "Jog", SubResource("AnimationNodeStateMachineTransition_hy2h2"), "Jog", "Run", SubResource("AnimationNodeStateMachineTransition_2tyel"), "Jog", "Stopping", SubResource("AnimationNodeStateMachineTransition_7h1qf"), "Idle", "Jog", SubResource("AnimationNodeStateMachineTransition_4twgu")]
210 | graph_offset = Vector2(-45.773, 131)
211 |
212 | [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_ml0kl"]
213 | graph_offset = Vector2(-389.513, 396.941)
214 | nodes/crouch/node = SubResource("AnimationNodeTransition_3twx3")
215 | nodes/crouch/position = Vector2(100, 180)
216 | nodes/crouching/node = SubResource("AnimationNodeStateMachine_2xodt")
217 | nodes/crouching/position = Vector2(-100, 420)
218 | nodes/standing/node = SubResource("AnimationNodeStateMachine_ieguh")
219 | nodes/standing/position = Vector2(-120, 40)
220 | node_connections = [&"crouch", 0, &"standing", &"crouch", 1, &"crouching", &"output", 0, &"crouch"]
221 |
222 | [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_5nmia"]
223 | resource_local_to_scene = true
224 | graph_offset = Vector2(288.5, 1117.67)
225 | nodes/AnimTurnLeft/node = SubResource("AnimationNodeAnimation_mb2kt")
226 | nodes/AnimTurnLeft/position = Vector2(500, 1540)
227 | nodes/AnimTurnRight/node = SubResource("AnimationNodeAnimation_2rfjg")
228 | nodes/AnimTurnRight/position = Vector2(500, 1660)
229 | nodes/FallAnimation/node = SubResource("AnimationNodeAnimation_v6381")
230 | nodes/FallAnimation/position = Vector2(1060, 1600)
231 | nodes/InAir/node = SubResource("AnimationNodeBlend2_nojly")
232 | nodes/InAir/position = Vector2(1280, 1380)
233 | nodes/RightOrLeft/node = SubResource("AnimationNodeBlend2_85ljr")
234 | nodes/RightOrLeft/position = Vector2(720, 1560)
235 | nodes/Turn/node = SubResource("AnimationNodeBlend2_2agtf")
236 | nodes/Turn/position = Vector2(980, 1400)
237 | nodes/VelocityDirection/node = SubResource("AnimationNodeBlendTree_ml0kl")
238 | nodes/VelocityDirection/position = Vector2(680, 1400)
239 | nodes/output/position = Vector2(1540, 1400)
240 | node_connections = [&"InAir", 0, &"Turn", &"InAir", 1, &"FallAnimation", &"RightOrLeft", 0, &"AnimTurnLeft", &"RightOrLeft", 1, &"AnimTurnRight", &"Turn", 0, &"VelocityDirection", &"Turn", 1, &"RightOrLeft", &"output", 0, &"InAir"]
241 |
242 | [sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_wc2uc"]
243 |
244 | [node name="AnimationTree" type="AnimationTree"]
245 | tree_root = SubResource("AnimationNodeBlendTree_5nmia")
246 | anim_player = NodePath("../Character/AnimationPlayer")
247 | parameters/InAir/blend_amount = 0.0
248 | parameters/RightOrLeft/blend_amount = 0.0
249 | parameters/Turn/blend_amount = 0.0
250 | parameters/VelocityDirection/crouch/current = 0
251 | parameters/VelocityDirection/crouching/playback = SubResource("AnimationNodeStateMachinePlayback_wc2uc")
252 | parameters/VelocityDirection/crouching/conditions/idle = false
253 | parameters/VelocityDirection/crouching/conditions/walking = false
254 | parameters/VelocityDirection/standing/playback = ExtResource("2_oomli")
255 | parameters/VelocityDirection/standing/conditions/idle = true
256 | parameters/VelocityDirection/standing/conditions/running = false
257 | parameters/VelocityDirection/standing/conditions/sprinting = false
258 | parameters/VelocityDirection/standing/conditions/stop = false
259 | parameters/VelocityDirection/standing/conditions/walking = false
260 | parameters/VelocityDirection/standing/Jog/FB/current = 0
261 | parameters/VelocityDirection/standing/Stopping/StopSeek/seek_position = -1.0
262 | parameters/VelocityDirection/standing/Walk/FB/current = 0
263 | script = ExtResource("1_iikhh")
264 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/AnimationComponents/StandingStateMachine.tres:
--------------------------------------------------------------------------------
1 | [gd_resource type="AnimationNodeStateMachinePlayback" format=3 uid="uid://b8p1518kwrou2"]
2 |
3 | [resource]
4 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/AttributesComponent/AttributesManager.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | class_name AttributesManager
3 |
4 |
5 | @export var character : Node
6 | var attributes : Dictionary
7 |
8 | func _ready():
9 | for child in get_children():
10 | if !(child is GameAttribute):
11 | assert("Only GameAttribute childs are allowed")
12 | attributes[child.attribute_name] = child
13 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/AttributesComponent/AttributesManager.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://bei5f3xkiw2ur"]
2 |
3 | [ext_resource type="Script" path="res://addons/AMSG/Components/AttributesComponent/AttributesManager.gd" id="1_clwd3"]
4 |
5 | [node name="AttributesManager" type="Node"]
6 | script = ExtResource("1_clwd3")
7 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/AttributesComponent/GameAttribute.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | class_name GameAttribute
3 |
4 |
5 | @onready var attributes_manager : AttributesManager = get_parent()
6 |
7 | @export_category("Attribute")
8 | ## Is the attribute name
9 | @export var attribute_name : String
10 | ## Is the attribute minimum value
11 | @export var minimum_value : float
12 | ## Is the attribute maximum value
13 | @export var maximum_value : float
14 | ## Is the attribute initial value
15 | @export var current_value : float :
16 | set(v):
17 | set_attribute(current_value, v)
18 | current_value = v
19 | var can_use:bool = true
20 |
21 |
22 | func set_attribute(prev_v, current_v):
23 | pass
24 |
25 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/AttributesComponent/GameAttribute.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=3 format=3 uid="uid://bkw0qe3jh352j"]
2 |
3 | [ext_resource type="Script" path="res://addons/AMSG/Components/AttributesComponent/GameAttribute.gd" id="1_ksoe7"]
4 |
5 | [sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_j6ls8"]
6 | properties/0/path = NodePath(".:current_value")
7 | properties/0/spawn = true
8 | properties/0/replication_mode = 2
9 |
10 | [node name="GameAttribute" type="Node"]
11 | script = ExtResource("1_ksoe7")
12 |
13 | [node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
14 | replication_config = SubResource("SceneReplicationConfig_j6ls8")
15 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/AttributesComponent/HealthAttribute.gd:
--------------------------------------------------------------------------------
1 | extends GameAttribute
2 |
3 |
4 |
5 |
6 | @export_category("Visual Bar")
7 | @export var health_bar : ProgressBar
8 |
9 |
10 | func set_attribute(prev_v, current_v):
11 | if !attributes_manager:
12 | return
13 | if current_v <= 0.0: # and not dead
14 | pass #death
15 |
16 |
17 |
18 | func _process(delta):
19 | if health_bar:
20 | health_bar.max_value = maximum_value
21 | health_bar.value = current_value
22 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/AttributesComponent/StaminaAttribute.gd:
--------------------------------------------------------------------------------
1 | extends GameAttribute
2 |
3 |
4 | @export_category("Energy")
5 | var regenerating_cooldown : bool = false
6 | func enable_normal_cooldown_gen():
7 | await get_tree().create_timer(cooldown_regen_wait_time_no_exaust).timeout
8 | if !cooldown_exausted and !being_used:
9 | regenerating_cooldown = true
10 | func enable_exaust_cooldown_gen():
11 | await get_tree().create_timer(cooldown_regen_wait_time_exaust).timeout
12 | if !being_used:
13 | regenerating_cooldown = true
14 | func regenerate_cooldown(delta):
15 | if regenerating_cooldown:
16 |
17 | current_value = clampf(current_value+(cooldown_regeneration_speed*delta),minimum_value,maximum_value)
18 | if cooldown_exausted and current_value == maximum_value:
19 | cooldown_exausted = false
20 | if cooldown_fill_sound:
21 | cooldown_fill_sound.play()
22 | return
23 | if current_value == maximum_value:
24 | regenerating_cooldown = false
25 | if cooldown_fill_sound:
26 | cooldown_fill_sound.play()
27 | return
28 |
29 |
30 | ## cooldown regeneration value in each second
31 | @export var cooldown_regeneration_speed : float = 10.0
32 | ## cooldown wait time in seconds berfore starting to regenerate
33 | @export var cooldown_regen_wait_time_no_exaust : float = 2.0
34 | ## cooldown wait time in case of exausted in seconds berfore starting to regenerate
35 | @export var cooldown_regen_wait_time_exaust : float = 4.0
36 | var cooldown_exausted : bool = false:
37 | set(value):
38 | cooldown_exausted = value
39 | if cooldown_exausted:
40 | if cooldown_exaust_sound:
41 | cooldown_exaust_sound.play()
42 |
43 | @export_category("Visual Bar")
44 | @export var cooldown_bar : ProgressBar
45 | @export var cooldown_unfill_normal_color : Color
46 | @export var cooldown_unfill_exaust_color : Color
47 |
48 | @export_category("Sound Effects")
49 | @export var cooldown_exaust_sound : AudioStreamPlayer3D
50 | @export var cooldown_fill_sound : AudioStreamPlayer3D
51 | var being_used : bool = false
52 | func set_attribute(prev_v, current_v):
53 | if current_v < prev_v:
54 | if current_v <= 1.0:
55 | cooldown_exausted = true
56 | regenerating_cooldown = false
57 | if current_v < maximum_value:
58 | if cooldown_exausted:
59 | enable_exaust_cooldown_gen()
60 | else:
61 | enable_normal_cooldown_gen()
62 | func _process(delta):
63 | can_use = !cooldown_exausted
64 |
65 | regenerate_cooldown(delta)
66 | if cooldown_bar:
67 | cooldown_bar.max_value = maximum_value
68 | cooldown_bar.value = current_value
69 | cooldown_bar.get_theme_stylebox("background").bg_color = cooldown_unfill_normal_color if !cooldown_exausted else cooldown_unfill_exaust_color
70 |
71 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/CameraComponent.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | class_name CameraComponent
3 | ## Script used to control the camera for the player
4 |
5 | @export var networking : PlayerNetworkingComponent
6 | #####################################
7 | #Refrences
8 | @export var SpringArm : SpringArm3D
9 | @export var Camera : Camera3D
10 | @export var PlayerRef : CharacterMovementComponent
11 | @onready var HObject = SpringArm
12 | @onready var VObject = SpringArm
13 | #####################################
14 |
15 | var CameraHOffset := 0.0
16 | @export var view_angle : Global.view_angle = Global.view_angle.right_shoulder:
17 | get: return view_angle
18 | set(Newview_angle):
19 | # if view_mode == Global.view_mode.first_person:
20 | # return
21 | view_angle = Newview_angle
22 | if Camera:
23 | match Newview_angle:
24 | Global.view_angle.right_shoulder:
25 | CameraHOffset = 0.45
26 | update_camera_offset()
27 | Global.view_angle.left_shoulder:
28 | CameraHOffset = -0.45
29 | update_camera_offset()
30 | Global.view_angle.head:
31 | CameraHOffset = 0.0
32 | update_camera_offset()
33 |
34 |
35 | @export var view_mode : Global.view_mode = Global.view_mode.third_person :
36 | get: return view_mode
37 | set(Newview_mode):
38 | view_mode = Newview_mode
39 | if VObject:
40 | VObject.rotation.x = 0.0
41 | if SpringArm:
42 | match view_mode:
43 | Global.view_mode.first_person:
44 | view_angle = Global.view_angle.head
45 | PlayerRef.rotation_mode = Global.rotation_mode.looking_direction
46 | SpringArm.spring_length = -0.4
47 | VObject = Camera
48 | Global.view_mode.third_person:
49 | SpringArm.spring_length = 1.75
50 | VObject = SpringArm
51 |
52 |
53 | var camera_h : float = 0
54 | var camera_v : float = 0
55 | @export var camera_vertical_min : float = -90
56 | @export var camera_vertical_max : float = 90
57 |
58 | ## Assign a [camera_values] resource to it and change its values to tweak camera settings
59 | @export var camera_settings : camera_values = camera_values.new()
60 | @export var first_person_camera_bone : BoneAttachment3D
61 | var current_fov : float = 90.0
62 | var acceleration_h = 10
63 | var acceleration_v = 10
64 |
65 | var spring_arm_position_relative_to_player : Vector3
66 | func _ready():
67 | spring_arm_position_relative_to_player = SpringArm.position
68 | SpringArm.top_level = true
69 |
70 | func _physics_process(delta):
71 | if camera_settings.camera_change_fov_on_speed and PlayerRef.actual_velocity.length() > camera_settings.camera_fov_change_starting_speed:
72 | smooth_fov(current_fov + clampf((PlayerRef.actual_velocity.length()-camera_settings.camera_fov_change_starting_speed)*(camera_settings.camera_max_fov_change/10.0),0,camera_settings.camera_max_fov_change))
73 |
74 | SpringArm.position = SpringArm.position.lerp((get_parent().global_position + spring_arm_position_relative_to_player) if view_mode == Global.view_mode.third_person else first_person_camera_bone.global_position,(1/camera_settings.camera_inertia) if view_mode == Global.view_mode.third_person else 1.0)
75 |
76 | camera_v = clamp(camera_v,deg_to_rad(camera_vertical_min),deg_to_rad(camera_vertical_max))
77 | HObject.rotation.y = lerp(HObject.rotation.y,camera_h,delta * acceleration_h)
78 | VObject.rotation.x = lerp(VObject.rotation.x,camera_v,delta * acceleration_v)
79 |
80 | match PlayerRef.rotation_mode:
81 | Global.rotation_mode.aiming:
82 | if PlayerRef.gait == Global.gait.sprinting: # character can't sprint while aiming
83 | PlayerRef.gait = Global.gait.running
84 | smooth_fov(60.0)
85 | Global.rotation_mode.velocity_direction:
86 | smooth_fov(90.0)
87 | Global.rotation_mode.looking_direction:
88 | smooth_fov(90.0)
89 |
90 |
91 | func update_camera_offset():
92 | var tween := create_tween()
93 | tween.tween_property(Camera,"h_offset",CameraHOffset,0.5).set_ease(Tween.EASE_IN_OUT).set_trans(Tween.TRANS_EXPO)
94 |
95 | var changing_view := false
96 | func smooth_fov(_current_fov:float):
97 | current_fov = _current_fov
98 | if changing_view:
99 | return
100 | changing_view=true
101 | var tween := create_tween()
102 | tween.tween_property(Camera,"fov",current_fov,0.1)
103 | tween.tween_callback(func(): changing_view=false)
104 |
105 |
106 |
107 | func smooth_camera_transition(pos:Vector3, look_at:Vector3, duration:float = 1.0 ,ease:Tween.EaseType = Tween.EASE_IN_OUT, trans:Tween.TransitionType = Tween.TRANS_LINEAR):
108 | # Camera.global_position = Camera.to_global(Camera.global_position)
109 | Camera.top_level = true
110 | var tween := create_tween()
111 | tween.set_parallel()
112 | tween.tween_property(Camera,"position",pos,duration).set_ease(ease).set_trans(trans)
113 | tween.tween_method(func(arr:Array): Camera.look_at_from_position(arr[0],arr[1]),[Camera.position,look_at],[pos,look_at],duration).set_ease(ease).set_trans(trans)
114 |
115 | var reseting : bool = false
116 | func reset_camera_transition(smooth_transition: bool = true):
117 | if Camera.top_level == false:
118 | return
119 | if smooth_transition:
120 |
121 | if reseting == true:
122 | return
123 | reseting = true
124 | Camera.top_level = false
125 | var tween := create_tween()
126 | tween.set_parallel()
127 | tween.tween_property(Camera,"position",Vector3(0,0,SpringArm.spring_length),1.0)
128 | tween.tween_property(Camera,"rotation",Vector3.ZERO,1.0)
129 | tween.tween_callback(func(): reseting=false)
130 |
131 | else:
132 | Camera.rotation = Vector3.ZERO
133 | Camera.top_level = false
134 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/CombatComponent/CombatSystem.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | class_name CombatSystem
3 |
4 |
5 | enum {NATURAL_OBJECT=0}
6 | var team_id : int = 0
7 |
8 | @export var attribute_map : AttributesManager
9 |
10 | var last_attacker_id : int
11 |
12 | @rpc("any_peer","reliable")
13 | func damage(dmg:float,attacker_player_peer_id:int,impact_point:Vector3=Vector3.ZERO, impact_force:float=0.0, impact_bone_name:String=""):
14 | last_attacker_id = attacker_player_peer_id
15 |
16 | var health = attribute_map.attributes["health"].current_value
17 | if dmg > health and health > 25.0:
18 | attribute_map.attributes["health"].current_value = 1.0
19 | else:
20 | attribute_map.attributes["health"].current_value -= dmg
21 | # print("player : " + str(multiplayer.get_unique_id()) + " health : " + str(health))
22 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/CombatComponent/CombatSystem.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://wh4rtve4au55"]
2 |
3 | [ext_resource type="Script" path="res://addons/AMSG/Components/CombatComponent/CombatSystem.gd" id="1_b0xxq"]
4 |
5 | [node name="CombatSystem" type="Node"]
6 | script = ExtResource("1_b0xxq")
7 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/Interaction.gd:
--------------------------------------------------------------------------------
1 | extends RayCast3D
2 |
3 | var current_collider
4 |
5 | @onready var interaction_label = get_node("../../../Status/InteractionLabel")
6 | var collider = get_collider()
7 |
8 | func _ready():
9 | if interaction_label:
10 | interaction_label.set_text("")
11 |
12 | func _process(_delta):
13 | collider = get_collider()
14 | if is_colliding() and collider is Interactable:
15 | if current_collider != collider:
16 | set_interaction_text(collider.get_interaction_text())
17 | current_collider = collider
18 |
19 | elif current_collider:
20 | current_collider = null
21 | set_interaction_text("")
22 |
23 | func Interact():
24 | if is_colliding() and collider is Interactable:
25 | collider.interact()
26 | set_interaction_text(collider.get_interaction_text())
27 |
28 | func set_interaction_text(text):
29 | if interaction_label:
30 | if text == "":
31 | interaction_label.set_text("")
32 | interaction_label.set_visible(false)
33 | else:
34 | var interaction_key = OS.get_keycode_string(InputMap.action_get_events("interaction")[0].keycode)
35 | interaction_label.set_text("Press %s to %s" % [interaction_key , text])
36 | interaction_label.set_visible(true)
37 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/LockComponent/LockSystem.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | class_name LockSystem
3 |
4 | #The array of locks that are presently applied. The player can perform an action if this array is empty.
5 | #The locks can be used for any manner of things: player movement in cutscenes, restricting dialogue choices, door open conditions etc
6 | var _locks = []
7 |
8 | var lock_count : int :
9 | get:
10 | return _locks.size()
11 |
12 | #An event to hook into - primarily for debugging.
13 | signal Lock_Added(lockName:String)
14 | signal Lock_Removed(lockName:String)
15 |
16 | #This one should only emit if is_locked would have changed.
17 | signal Lock_Status_Changed(newStatus:bool)
18 |
19 | #A getter to see if any locks are being applied
20 | @export var is_locked : bool :
21 | get:
22 | return _check_is_locked()
23 |
24 | #If a lock called lock_name hasn't already been added, adds one.
25 | func add_lock(lock_name:String):
26 | #Don't add duplicate locks
27 | if(contains_lock(lock_name)):
28 | print_debug("Lock %lock is already added." % lock_name)
29 | return
30 | else:
31 | #Add locks and emit events
32 | _locks.append(lock_name)
33 | emit_signal("Lock_Added", lock_name)
34 | #if this is the first and only lock, the locked status has changed to true
35 | if(_locks.size() == 1):
36 | Lock_Status_Changed.emit(true)
37 | return;
38 |
39 | #Removes a lock with the name lock_name. Prints a message if it's not in there.
40 | func remove_lock(lock_name:String):
41 | if(contains_lock(lock_name)):
42 | _locks.erase(lock_name)
43 | #If there's now zero locks remaining, emit event
44 | if(_locks.size() == 0):
45 | Lock_Status_Changed.emit(false)
46 | else:
47 | print_debug("Lock %lock cannot be removed as it isn't there." % lock_name)
48 |
49 | #Returns true if _locks has any entries added, false if no locks are being applied
50 | func _check_is_locked():
51 | return _locks.size() > 0;
52 |
53 | #Returns true if a lock called lock_name is already added to _locks
54 | func contains_lock(lock_name:String):
55 | for lock in _locks:
56 | if lock == lock_name:
57 | return true;
58 | return false;
59 |
60 | #Prints all current locks - useful for tracking down issues when locks haven't been lifted
61 | func debug_locks():
62 | var log = "Printing all locks"
63 | for lock in _locks:
64 | print_debug("\n" + str(lock))
65 |
66 | #To be used for debug - for when the locks need to be bypassed to test.
67 | func debug_release_all_locks():
68 | for lock in _locks:
69 | Lock_Removed.emit(lock)
70 | _locks.clear();
71 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/MantleComponent/MantleComponent.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Node3D
3 | class_name MantleComponent
4 | @export var character_collision_shape : CollisionShape3D
5 | @export var character_node : PhysicsBody3D
6 | @export var animation_tree : AnimationTree
7 | @export var mantle_anim : String = "Mantle"
8 | #@export var character_height : float = 1.75
9 | @onready var ledge_top_detect : RayCast3D = $LedgeTopDetect
10 | @onready var ledge_detect : RayCast3D = $LedgeDetect
11 | @onready var shape_cast_3d = $ShapeCast3D
12 | @onready var ledge_ground_detect = $LedgeGroundDetect
13 |
14 | var is_climbing : bool
15 |
16 | func _get_configuration_warnings():
17 | if not get_parent() is Skeleton3D:
18 | return ["Parent Must be Skeleton3D."]
19 |
20 | func _ready():
21 | if not get_parent() is Skeleton3D:
22 | assert(false, "Parent Must be Skeleton3D.")
23 | update_configuration_warnings()
24 | if not character_node is CharacterBody3D and not character_node is RigidBody3D:
25 | assert(false, "Character Node Must be either CharacterBody3D or RigidBody3D, please choose the right node from the inspector.")
26 | shape_cast_3d.shape = character_collision_shape.shape
27 | #shape_cast_3d.position = character_collision_shape.position
28 | shape_cast_3d.add_exception(character_node)
29 | ledge_top_detect.add_exception(character_node)
30 | ledge_detect.add_exception(character_node)
31 | ledge_ground_detect.add_exception(character_node)
32 | func _physics_process(delta):
33 | ledge_detect.position.y = shape_cast_3d.shape.height#character_height
34 | ledge_top_detect.position.y = shape_cast_3d.shape.height + 0.25#character_height + 0.25
35 | ledge_ground_detect.position.y = ledge_top_detect.position.y
36 | ledge_ground_detect.position.z = 1
37 | ledge_detect.rotation_degrees.x = -90
38 | ledge_top_detect.rotation_degrees.x = -90
39 | func detect_ledge():
40 | if is_climbing:
41 | return
42 | if ledge_detect.is_colliding() and ledge_ground_detect.is_colliding() and !ledge_top_detect.is_colliding():
43 | shape_cast_3d.global_position = shape_cast_3d.shape.height/2*Vector3.UP + Vector3(0,0.1,0) + ledge_ground_detect.get_collision_point()
44 | if !shape_cast_3d.is_colliding(): #The character can fit into the mantle location, Climb
45 | mantle()
46 |
47 |
48 | func mantle():
49 | is_climbing = true
50 | if character_node is RigidBody3D:
51 | character_node.freeze_mode = RigidBody3D.FREEZE_MODE_STATIC
52 | if character_node is CharacterBody3D:
53 | character_node.velocity = Vector3.ZERO
54 | character_node.move_and_slide()
55 | animation_tree.active = false
56 |
57 | var anim_player : AnimationPlayer = get_node(String(animation_tree.get_path()) + "/" + String(animation_tree.anim_player))
58 | anim_player.connect("animation_finished", func(anim):\
59 | character_node.global_position = shape_cast_3d.global_position;\
60 | animation_tree.active = true;\
61 | await get_tree().create_timer(0.1).timeout;\
62 | is_climbing = false
63 | )
64 | anim_player.play(mantle_anim)
65 |
66 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/MantleComponent/MantleComponent.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=3 format=3 uid="uid://dpniuhmc5sj82"]
2 |
3 | [ext_resource type="Script" path="res://addons/AMSG/Components/MantleComponent/MantleComponent.gd" id="1_ix4sf"]
4 |
5 | [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_70w0s"]
6 | resource_local_to_scene = true
7 | radius = 0.375
8 | height = 1.75
9 |
10 | [node name="MantleComponent" type="Node3D"]
11 | script = ExtResource("1_ix4sf")
12 | mantle_anim = "Kick"
13 |
14 | [node name="ShapeCast3D" type="ShapeCast3D" parent="."]
15 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
16 | top_level = true
17 | shape = SubResource("CapsuleShape3D_70w0s")
18 | target_position = Vector3(0, 0, 0)
19 |
20 | [node name="LedgeTopDetect" type="RayCast3D" parent="."]
21 | transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 2, 0)
22 |
23 | [node name="LedgeDetect" type="RayCast3D" parent="."]
24 | transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 1.75, 0)
25 |
26 | [node name="LedgeGroundDetect" type="RayCast3D" parent="."]
27 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 1)
28 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/Networking.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=3 format=3 uid="uid://cegbfvlakd2rw"]
2 |
3 | [ext_resource type="Script" path="res://addons/AMSG/Components/PlayerNetworkingComponent.gd" id="1_88p3o"]
4 |
5 | [sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_rxj2q"]
6 | properties/0/path = NodePath(":sync_camera_h_transform")
7 | properties/0/spawn = true
8 | properties/0/replication_mode = 1
9 | properties/1/path = NodePath(":sync_camera_v_transform")
10 | properties/1/spawn = true
11 | properties/1/replication_mode = 1
12 | properties/2/path = NodePath(":sync_view_mode")
13 | properties/2/spawn = true
14 | properties/2/replication_mode = 1
15 | properties/3/path = NodePath(":sync_CameraHOffset")
16 | properties/3/spawn = true
17 | properties/3/replication_mode = 1
18 | properties/4/path = NodePath(":sync_position")
19 | properties/4/spawn = true
20 | properties/4/replication_mode = 1
21 | properties/5/path = NodePath(":sync_mesh_rotation")
22 | properties/5/spawn = true
23 | properties/5/replication_mode = 1
24 | properties/6/path = NodePath(":sync_direction")
25 | properties/6/spawn = true
26 | properties/6/replication_mode = 1
27 | properties/7/path = NodePath(":sync_input_is_moving")
28 | properties/7/spawn = true
29 | properties/7/replication_mode = 1
30 | properties/8/path = NodePath(":sync_gait")
31 | properties/8/spawn = true
32 | properties/8/replication_mode = 1
33 | properties/9/path = NodePath(":sync_rotation_mode")
34 | properties/9/spawn = true
35 | properties/9/replication_mode = 1
36 | properties/10/path = NodePath(":sync_stance")
37 | properties/10/spawn = true
38 | properties/10/replication_mode = 1
39 | properties/11/path = NodePath(":sync_movement_state")
40 | properties/11/spawn = true
41 | properties/11/replication_mode = 1
42 | properties/12/path = NodePath(":sync_movement_action")
43 | properties/12/spawn = true
44 | properties/12/replication_mode = 1
45 | properties/13/path = NodePath(":sync_velocity")
46 | properties/13/spawn = true
47 | properties/13/replication_mode = 1
48 |
49 | [node name="Networking" type="Node"]
50 | script = ExtResource("1_88p3o")
51 |
52 | [node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
53 | replication_config = SubResource("SceneReplicationConfig_rxj2q")
54 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/PlayerGameplayComponent.gd:
--------------------------------------------------------------------------------
1 | extends CharacterMovementComponent
2 | class_name PlayerGameplayComponent
3 |
4 | @export_group("Stamina System", "stamina_")
5 | @export var stamina_use: bool = false
6 | @export var stamina_energy_consumption: float = 15.0#per second
7 | @export var stamina_attribute: GameAttribute
8 |
9 | @export var networking : PlayerNetworkingComponent
10 | @export var targeting_component : TargetingComponent
11 |
12 | func _ready():
13 | super._ready()
14 | targeting_component.connect("detected", func(p): print(p))
15 |
16 |
17 | func _process(delta):
18 | super._process(delta)
19 | if gait != Global.gait.sprinting and stamina_use:
20 | stamina_attribute.being_used = false
21 | if gait == Global.gait.sprinting and stamina_use:
22 | if !stamina_attribute.can_use or stamina_attribute.current_value < stamina_energy_consumption*delta:
23 | gait = Global.gait.running
24 | return
25 | stamina_attribute.being_used = true
26 | stamina_attribute.current_value -= stamina_energy_consumption*delta
27 |
28 | func _physics_process(delta):
29 | super._physics_process(delta)
30 | # Debug()
31 | if !networking.is_local_authority():
32 | if input_is_moving:
33 | if gait == Global.gait.sprinting:
34 | add_movement_input(input_direction, current_movement_data.sprint_speed,current_movement_data.sprint_acceleration)
35 | elif gait == Global.gait.running:
36 | add_movement_input(input_direction, current_movement_data.run_speed,current_movement_data.run_acceleration)
37 | else:
38 | add_movement_input(input_direction, current_movement_data.walk_speed,current_movement_data.walk_acceleration)
39 | return
40 | #------------------ Look At ------------------#
41 | match rotation_mode:
42 | Global.rotation_mode.velocity_direction:
43 | if input_is_moving:
44 | ik_look_at(actual_velocity + Vector3(0.0,1.0,0.0))
45 | Global.rotation_mode.looking_direction:
46 | ik_look_at(camera_root.SpringArm.transform.basis.z * 2.0 + Vector3(0.0,1.5,0.0))
47 | Global.rotation_mode.aiming:
48 | ik_look_at(camera_root.SpringArm.transform.basis.z * 2.0 + Vector3(0.0,1.5,0.0))
49 | #func Debug():
50 | # $Status/Label.text = "InputSpeed : %s" % input_velocity.length()
51 | # $Status/Label2.text = "ActualSpeed : %s" % get_velocity().length()
52 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/PlayerNetworkingComponent.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | class_name PlayerNetworkingComponent
3 | @export var character_movement_component : NodePath
4 | @onready var PlayerRef = get_node(character_movement_component)
5 |
6 |
7 | var sync_camera_h_transform : Transform3D
8 | var sync_camera_v_transform : Transform3D
9 | var sync_view_mode : Global.view_mode = Global.view_mode.third_person
10 | var sync_CameraHOffset : float
11 | var sync_position : Vector3:
12 | set(value):
13 | sync_position = value
14 | processed_position = false
15 | var sync_mesh_rotation : Vector3
16 | var sync_direction : Vector3
17 | var sync_input_is_moving : bool
18 | var sync_gait : Global.gait = Global.gait.walking
19 | var sync_rotation_mode : Global.rotation_mode = Global.rotation_mode.velocity_direction
20 | var sync_stance : Global.stance = Global.stance.standing
21 | var sync_movement_state : Global.movement_state = Global.movement_state.grounded
22 | var sync_movement_action : Global.movement_action = Global.movement_action.none
23 | var sync_velocity : Vector3
24 | var processed_position : bool
25 |
26 |
27 | func _ready():
28 | $MultiplayerSynchronizer.set_multiplayer_authority(str(get_parent().name).to_int())
29 |
30 |
31 | func is_local_authority() -> bool:
32 | if multiplayer.multiplayer_peer is OfflineMultiplayerPeer:
33 | return true
34 | else:
35 | return str(get_parent().name).to_int() == multiplayer.get_unique_id()
36 |
37 | #sync player on clients
38 | func _physics_process(_delta):
39 | if !is_local_authority():
40 | if not processed_position:
41 | PlayerRef.character_node.position = sync_position
42 | processed_position = true
43 | PlayerRef.mesh_ref.rotation = sync_mesh_rotation
44 | PlayerRef.input_direction = sync_direction
45 | PlayerRef.gait = sync_gait
46 | PlayerRef.stance = sync_stance
47 | PlayerRef.rotation_mode = sync_rotation_mode
48 | PlayerRef.camera_root.VObject.transform = sync_camera_v_transform
49 | PlayerRef.camera_root.HObject.transform = sync_camera_h_transform
50 | PlayerRef.camera_root.view_mode = sync_CameraHOffset
51 | PlayerRef.camera_root.CameraHOffset = sync_CameraHOffset
52 | PlayerRef.movement_state = sync_movement_state
53 | PlayerRef.movement_action = sync_movement_action
54 | # PlayerRef.velocity = sync_velocity
55 | PlayerRef.input_is_moving = sync_input_is_moving
56 | return
57 |
58 | sync_position = PlayerRef.character_node.position
59 | sync_mesh_rotation = PlayerRef.mesh_ref.rotation
60 | sync_direction = PlayerRef.input_direction
61 | sync_gait = PlayerRef.gait
62 | sync_stance = PlayerRef.stance
63 | sync_rotation_mode = PlayerRef.rotation_mode
64 | sync_camera_h_transform = PlayerRef.camera_root.HObject.transform
65 | sync_camera_v_transform = PlayerRef.camera_root.VObject.transform
66 | sync_movement_state = PlayerRef.movement_state
67 | sync_movement_action = PlayerRef.movement_action
68 | sync_input_is_moving = PlayerRef.input_is_moving
69 | sync_view_mode = PlayerRef.camera_root.view_mode
70 | sync_CameraHOffset = PlayerRef.camera_root.CameraHOffset
71 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/TargetingComponent/TargetingComponent.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | class_name TargetingComponent
3 |
4 | @export var detection_raycast : RayCast3D
5 | @export var combat_component : CombatSystem
6 |
7 | @export var detectable_object_group : String = "detectable_object" # we can use the node group feature in Godot
8 | @export var detectable_player_group : String = "player" # I am calling any Enemy/AI/Ally a player
9 |
10 |
11 | var detected_object : Node3D
12 | var detected_object_combat_component : CombatSystem
13 |
14 | var detected_player : Node3D
15 | var detected_player_combat_component : CombatSystem
16 |
17 |
18 | signal object_detected(object: Node3D, object_combat_component:CombatSystem)
19 | signal enemy_detected(object: Node3D, player_combat_component:CombatSystem)
20 | signal ally_detected(object: Node3D, player_combat_component:CombatSystem)
21 | signal player_detected(object: Node3D, player_combat_component:CombatSystem)
22 | signal detected(object: Node3D) #this activates for all
23 |
24 | func _ready():
25 | detection_raycast.add_exception(get_parent())
26 |
27 | func _process(delta):
28 | if detection_raycast.is_colliding():
29 | if detected_player == detection_raycast.get_collider() or detected_object == detection_raycast.get_collider():
30 | return
31 |
32 | if detection_raycast.get_collider().is_in_group(detectable_object_group):
33 | detected_object = detection_raycast.get_collider()
34 | detected.emit(detected_object)
35 |
36 | detected_object_combat_component = detected_object.find_child("CombatSystem")
37 | if !detected_object_combat_component:
38 | object_detected.emit(detected_object, null)
39 | return
40 | object_detected.emit(detected_object, detected_object_combat_component)
41 | return
42 |
43 | if detection_raycast.get_collider().is_in_group(detectable_player_group):
44 | detected_player = detection_raycast.get_collider()
45 | detected.emit(detected_player)
46 | detected_player_combat_component = detected_player.find_child("CombatSystem")
47 | if !detected_player_combat_component:
48 | player_detected.emit(detected_player, null)
49 | return
50 | player_detected.emit(detected_player, detected_player_combat_component)
51 | if detected_player_combat_component.team_id != combat_component.NATURAL_OBJECT and detected_player_combat_component.team_id != combat_component.team_id:
52 | enemy_detected.emit(detected_player, detected_player_combat_component)
53 | if detected_player_combat_component.team_id == combat_component.team_id:
54 | ally_detected.emit(detected_player, detected_player_combat_component)
55 | return
56 |
--------------------------------------------------------------------------------
/addons/AMSG/Components/TargetingComponent/TargetingComponent.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://dsum6nu2c2wm5"]
2 |
3 | [ext_resource type="Script" path="res://addons/AMSG/Components/TargetingComponent/TargetingComponent.gd" id="1_i15da"]
4 |
5 | [node name="TargetingComponent" type="Node"]
6 | script = ExtResource("1_i15da")
7 |
--------------------------------------------------------------------------------
/addons/AMSG/Data/camera_values.gd:
--------------------------------------------------------------------------------
1 | extends Resource
2 | class_name camera_values
3 |
4 |
5 | @export var camera_inertia : float = 7.5
6 | @export var camera_change_fov_on_speed : bool = false
7 | @export var camera_max_fov_change : float = 20.0
8 | @export var camera_fov_change_starting_speed : float = 0.0
9 | @export var target_fov : float = 90.0
10 |
11 |
12 | func _init(_camera_inertia: float = camera_inertia, _camera_change_fov_on_speed: bool = camera_change_fov_on_speed, _camera_max_fov_change: float = camera_max_fov_change,\
13 | _camera_fov_change_starting_speed : float = camera_fov_change_starting_speed, _target_fov : float = target_fov):
14 |
15 | camera_inertia = _camera_inertia
16 | camera_change_fov_on_speed = _camera_change_fov_on_speed
17 | camera_max_fov_change = _camera_max_fov_change
18 |
19 | camera_fov_change_starting_speed = _camera_fov_change_starting_speed
20 | target_fov = _target_fov
21 |
--------------------------------------------------------------------------------
/addons/AMSG/Data/movement_values.gd:
--------------------------------------------------------------------------------
1 | extends Resource
2 | class_name movement_values
3 |
4 | @export var walk_speed : float = 1.75
5 | @export var run_speed : float = 3.75
6 | @export var sprint_speed : float = 6.5
7 |
8 | @export var walk_acceleration : float = 20.0
9 | @export var run_acceleration : float = 20.0
10 | @export var sprint_acceleration : float = 20.0
11 |
12 | @export var idle_rotation_rate : float = 0.5
13 | @export var walk_rotation_rate : float = 4.0
14 | @export var run_rotation_rate : float = 5.0
15 | @export var sprint_rotation_rate : float = 20.0
16 |
17 |
18 |
19 | func _init(_walk_speed: float = walk_speed, _run_speed: float = run_speed, _sprint_speed: float = sprint_speed,\
20 | _walk_acceleration : float = walk_acceleration, _run_acceleration : float = run_acceleration, _sprint_acceleration : float = sprint_acceleration,\
21 | _idle_rotation_rate : float = idle_rotation_rate, _walk_rotation_rate : float = walk_rotation_rate, _run_rotation_rate : float = run_rotation_rate, _sprint_rotation_rate : float = sprint_rotation_rate):
22 | walk_speed = _walk_speed
23 | run_speed = _run_speed
24 | sprint_speed = _sprint_speed
25 |
26 | walk_acceleration = _walk_acceleration
27 | run_acceleration = _run_acceleration
28 | sprint_acceleration = _sprint_acceleration
29 |
30 | idle_rotation_rate = _idle_rotation_rate
31 | walk_rotation_rate = _walk_rotation_rate
32 | run_rotation_rate = _run_rotation_rate
33 | sprint_rotation_rate = _sprint_rotation_rate
34 |
--------------------------------------------------------------------------------
/addons/AMSG/Global.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 |
3 | #------------------ Player Enums ------------------#
4 | enum gait {walking , running , sprinting}
5 | enum movement_state {none , grounded , in_air , mantling, ragdoll}
6 | enum movement_action {none ,low_mantle , high_mantle , rolling , getting_up}
7 | enum overlay_state {default , rifle , pistol}
8 | enum rotation_mode {velocity_direction , looking_direction , aiming}
9 | enum stance {standing , crouching}
10 | enum view_mode {third_person , first_person}
11 | enum view_angle {right_shoulder , left_shoulder , head}
12 | enum mantle_type {high_mantle , low_mantle, falling_catch}
13 | enum movement_direction {forward , right, left, backward}
14 |
15 |
16 | func map_range_clamped(value,InputMin,InputMax,OutputMin,OutputMax):
17 | value = clamp(value,InputMin,InputMax)
18 | return ((value - InputMin) / (InputMax - InputMin) * (OutputMax - OutputMin) + OutputMin)
19 |
--------------------------------------------------------------------------------
/addons/AMSG/Interactable/Interactable.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | class_name Interactable
3 |
4 | func get_interaction_text():
5 | return "Interact"
6 |
7 |
8 | func interact():
9 | print("Interacted with %s" % name)
10 |
11 |
--------------------------------------------------------------------------------
/addons/AMSG/Interactable/Light/InteractableLight.gd:
--------------------------------------------------------------------------------
1 | extends Interactable
2 |
3 | @export var light : NodePath
4 | @onready var light_node = get_node(light)
5 | @export var on : bool :
6 | get: return on
7 | set(state):
8 | on = state
9 | if light_node != null:
10 | set_light_energy()
11 | @export var energy_when_on = 1
12 | @export var energy_when_off = 0
13 |
14 | func _ready():
15 | on = on #just initialize
16 |
17 | func interact():
18 | on = !on
19 |
20 | func get_interaction_text():
21 | return "Switch Light Off" if on else "Switch Light On"
22 |
23 | func set_light_energy():
24 | light_node.set_param(Light3D.PARAM_ENERGY,energy_when_on if on else energy_when_off)
25 |
--------------------------------------------------------------------------------
/addons/AMSG/plugin.cfg:
--------------------------------------------------------------------------------
1 | [plugin]
2 |
3 | name="AMSG"
4 | description=""
5 | author="ywmaa"
6 | version="0.9"
7 | script="AMSG.gd"
8 |
--------------------------------------------------------------------------------
/addons/PoseWarping/MotionWarping.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 | class_name MotionWarping
3 |
4 | var position_objects_array : Array = []
5 | var rotation_objects_array : Array = []
6 | var positions_array : Array = []
7 | var rotations_array : Array = []
8 | var names_array : Array = []
9 |
10 | #We should add the position before starting the animation,
11 | #for example the position of the door that we are interacting with.
12 | #we give it a name to use the same name in the AnimationPlayer
13 | func add_sync_position(position:Vector3, rotation:Vector3, sync_name:String, position_object,rotation_object):
14 | positions_array.append(position)
15 | rotations_array.append(rotation)
16 | position_objects_array.append(position_object)
17 | rotation_objects_array.append(rotation_object)
18 | names_array.append(sync_name)
19 |
20 |
21 | #remove the position after it is done
22 | func remove_sync_position(sync_name:String):
23 | var sync_index = names_array.find(sync_name)
24 | positions_array.remove_at(sync_index)
25 | rotations_array.remove_at(sync_index)
26 | position_objects_array.remove_at(sync_index)
27 | rotation_objects_array.remove_at(sync_index)
28 | names_array.remove_at(sync_index)
29 |
30 | ## this should be called as a method in the animation player, and set the name
31 | ## using the name we assigned to the sync position that we will tween it,
32 | ## also in the animation player we should specify the time to tween to this required position
33 | func motion_warping(sync_name:String, sync_time:float):
34 |
35 | var sync_index = names_array.find(sync_name)
36 | var position = positions_array[sync_index]
37 | var rotation = rotations_array[sync_index]
38 | var position_object = position_objects_array[sync_index]
39 | var rotation_object = rotation_objects_array[sync_index]
40 | var tween := create_tween()
41 | var rotation_tween := create_tween()
42 | tween.tween_property(position_object, "transform:origin", position, sync_time)
43 | rotation_tween.tween_property(rotation_object, "rotation", rotation, sync_time)
44 | tween.tween_callback(remove_sync_position.bind(sync_name))
45 |
--------------------------------------------------------------------------------
/addons/PoseWarping/MotionWarping.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=3 uid="uid://bfkejs88xm680"]
2 |
3 | [ext_resource type="Script" path="res://addons/PoseWarping/MotionWarping.gd" id="1_if8ak"]
4 |
5 | [node name="MotionWarping" type="Node"]
6 | script = ExtResource("1_if8ak")
7 |
--------------------------------------------------------------------------------
/addons/PoseWarping/PoseWarping.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends SkeletonModifier3D
3 | class_name PoseWarping
4 | ## a Node that Handles Pose Warping for character for enhanced animations
5 | ## Must be a child of Skeleton3D
6 |
7 | @export var debug : bool = false
8 |
9 | ## Character Node, either CharacterBody3D or RigidBody3D
10 | @export var character_node : PhysicsBody3D
11 | ## The Character Skeleton that is going to be modified
12 | @onready var character_skeleton : Skeleton3D = get_skeleton()
13 | ## SkeletonIK3D Node that adjusts the left leg IK
14 | @export var LeftLegIK : SkeletonIK3D
15 | ## SkeletonIK3D Node that adjusts the right leg IK
16 | @export var RightLegIK : SkeletonIK3D
17 | ## Hips bone name, Please Write the correct hips bone name according to your skeleton.
18 | @export_enum(" ") var hips_bone_name : String = "Hips"
19 | @export_enum(" ") var left_knee_bone_name : String = "LeftLeg"
20 | @export_enum(" ") var right_knee_bone_name : String = "RightLeg"
21 | #@export_enum(" ") var left_leg_root_bone_name : String = "LeftUpLeg"
22 | #@export_enum(" ") var left_leg_tip_bone_name : String = "LeftFoot"
23 | #@export_enum(" ") var right_leg_root_bone_name : String = "RightUpLeg"
24 | #@export_enum(" ") var right_leg_tip_bone_name : String = "RightFoot"
25 | ## Character Info
26 | var character_velocity : Vector3
27 | var character_prev_velocity : Vector3
28 | var character_acceleration : Vector3
29 | var character_prev_acceleration : Vector3
30 | var character_position : Vector3
31 | var character_prev_position : Vector3
32 |
33 |
34 | @onready var LeftLegIKTarget : Marker3D = $LeftTargetRotation/LeftIKTarget
35 | @onready var RightLegIKTarget : Marker3D = $RightTargetRotation/RightIKTarget
36 |
37 | @export_subgroup("Orientation Warping", "orientation_warping_")
38 | ## Orientation Warping is a system that adjusts the character's Legs and Hips (Lower body)
39 | ## To adapt to character movement direction.
40 | @export var orientation_warping_enable : bool
41 | ## This is the object that contains the camera horizontal rotation
42 | ## it could be the camera object itself.
43 | @export var orientation_warping_camera_h_object : Node3D
44 | ## Spine Bones Names, Please Write the correct bone names for all of the spine bones according to your skeleton.
45 | @export_enum(" ") var orientation_warping_spine_bones_names : Array[String] = ["Spine","Spine1","Spine2"]
46 | ## An offset added to the Spine Bones rotation relative to camera forward
47 | @export var orientation_warping_offset := 0.0
48 | ##
49 | @export var orientation_warping_turn_rate :float= 1.5
50 |
51 |
52 | @export_subgroup("Stride - Speed Warping", "stride_warping_")
53 | ## Stride Warping is a system that adjusts the character's Leg using the SkeletonIK3D node
54 | ## To adapt to the character movement speed, to achieve more realistic look and less foot sliding.
55 | @export var stride_warping_enable : bool = true
56 |
57 | @export_subgroup("Slope Warping - Leg on ground IK", "slope_warping_")
58 | ## Slope Warping is a system that adjusts the character's Leg using the SkeletonIK3D node
59 | ## To adapt to the ground shape, like hills, and uneven ground, etc.
60 | @export var slope_warping_enable : bool = true
61 | ## Locks the foot to the ground to prevent feet sliding.
62 | @export var slope_warping_feet_locking_enable : bool = true
63 | ## Foot Raycast Length (The Raycast responsible to detect if foot on ground and should be locked or not)
64 | @export var slope_warping_foot_ground_touch_raycast_length : float = 0.14
65 | @onready var slope_warping_raycast_left_touch_detection : RayCast3D = $LeftFootAttachment/LeftLegTouchRayCast
66 | @onready var slope_warping_raycast_left : RayCast3D = $LeftLegTargetRayCast
67 | @onready var slope_warping_bone_attachment_left_foot : BoneAttachment3D = $LeftFootAttachment
68 | @onready var slope_warping_raycast_right_touch_detection : RayCast3D = $RightFootAttachment/RightLegTouchRayCast
69 | @onready var slope_warping_raycast_right : RayCast3D = $RightLegTargetRayCast
70 | @onready var slope_warping_bone_attachment_right_foot : BoneAttachment3D = $RightFootAttachment
71 | @export var slope_warping_foot_height_offset : float = 0.015
72 |
73 |
74 | @onready var left_target_rotation = $LeftTargetRotation
75 | @onready var right_target_rotation = $RightTargetRotation
76 | @onready var left_leg_ground_normal_ray_cast = $LeftFootAttachment/LeftLegGroundNormalRayCast
77 | @onready var right_leg_ground_normal_ray_cast = $RightFootAttachment/RightLegGroundNormalRayCast
78 | @onready var on_floor_ray_cast: RayCast3D = $OnFloorRayCast
79 | var is_on_floor: bool = false
80 |
81 | func _validate_property(property: Dictionary) -> void:
82 | if property.name == "hips_bone_name" or property.name == "orientation_warping_spine_bones_names"\
83 | or property.name == "right_knee_bone_name" or property.name == "left_knee_bone_name"\
84 | or property.name == "left_leg_root_bone_name" or property.name == "left_leg_tip_bone_name"\
85 | or property.name == "right_leg_root_bone_name" or property.name == "right_leg_tip_bone_name":
86 | if character_skeleton:
87 | property.hint = PROPERTY_HINT_ENUM
88 | property.hint_string = character_skeleton.get_concatenated_bone_names()
89 |
90 | func _ready():
91 | if !LeftLegIK:
92 | assert(false, "Left Leg IK Must be SkeletonIK3D.")
93 | if !RightLegIK:
94 | assert(false, "Right Leg IK Must be SkeletonIK3D.")
95 | if not get_parent() is Skeleton3D:
96 | assert(false, "Parent Must be Skeleton3D.")
97 | update_configuration_warnings()
98 | if not character_node is CharacterBody3D and not character_node is RigidBody3D:
99 | assert(false, "Character Node Must be either CharacterBody3D or RigidBody3D, please choose the right node from the inspector.")
100 | #slope_warping_bone_attachment_left_foot.set_external_skeleton(character_skeleton.get_path())
101 | slope_warping_bone_attachment_left_foot.bone_name = String(LeftLegIK.tip_bone)
102 | #slope_warping_bone_attachment_right_foot.set_external_skeleton(character_skeleton.get_path())
103 | slope_warping_bone_attachment_right_foot.bone_name = String(RightLegIK.tip_bone)
104 |
105 | slope_warping_raycast_left_touch_detection.target_position.y = slope_warping_foot_ground_touch_raycast_length
106 | slope_warping_raycast_right_touch_detection.target_position.y = slope_warping_foot_ground_touch_raycast_length
107 |
108 | slope_warping_raycast_left.add_exception(character_node)
109 | slope_warping_raycast_right.add_exception(character_node)
110 | slope_warping_raycast_left_touch_detection.add_exception(character_node)
111 | slope_warping_raycast_right_touch_detection.add_exception(character_node)
112 | on_floor_ray_cast.add_exception(character_node)
113 |
114 | LeftLegIK.target_node = LeftLegIKTarget.get_path()
115 | RightLegIK.target_node = RightLegIKTarget.get_path()
116 |
117 |
118 | @onready var result_debug = $LeftTargetRotation/LeftIKTarget/ResultDebug
119 | @onready var result_debug2 = $RightTargetRotation/RightIKTarget/ResultDebug
120 |
121 | func calculate_character_info():
122 | character_prev_position = character_position
123 | character_prev_velocity = character_velocity
124 | character_prev_acceleration = character_acceleration
125 |
126 |
127 | character_position = character_skeleton.global_position
128 | # Distance/Time = Velocity
129 | character_velocity = (character_position - character_prev_position) / get_physics_process_delta_time()
130 | # Delta Velocity / Delta Time = Acceleration
131 | character_acceleration = (character_velocity - character_prev_velocity) / get_physics_process_delta_time()
132 |
133 | if debug:
134 | DebugDraw3D.draw_arrow(character_position, character_position+character_velocity, Color.ORANGE, 0.1, false, 0)
135 |
136 | func _physics_process(delta: float) -> void:
137 | if !LeftLegIK or !RightLegIK:
138 | return
139 | calculate_character_info()
140 | is_on_floor = on_floor_ray_cast.is_colliding()
141 |
142 | func _process_modification():
143 | if !LeftLegIK or !RightLegIK:
144 | return
145 | #DebugDraw3D.draw_sphere(slope_warping_bone_attachment_left_foot.global_position, 0.1, Color.RED, 0.0)
146 | #DebugDraw3D.draw_sphere(slope_warping_bone_attachment_right_foot.global_position, 0.1, Color.RED, 0.0)
147 | #if Engine.is_editor_hint():
148 | #return
149 | #global_transform.basis = foot_look_at_y(Vector3.ZERO, character_skeleton.global_transform.basis.z, left_leg_ground_normal_ray_cast.get_collision_normal())
150 |
151 | #RightLegIK.magnet = right_magnet.position.rotated(Vector3.UP, orientation_direction)
152 | #LeftLegIK.magnet = left_magnet.position.rotated(Vector3.UP, orientation_direction)
153 | if (stride_warping_enable or slope_warping_enable) and is_on_floor:
154 | var bone_transform_left = character_skeleton.get_bone_global_pose_no_override(character_skeleton.find_bone(String(LeftLegIK.tip_bone)))
155 | var bone_transform_right = character_skeleton.get_bone_global_pose_no_override(character_skeleton.find_bone(String(RightLegIK.tip_bone)))
156 | slope_warping_bone_attachment_left_foot.transform = bone_transform_left
157 | slope_warping_bone_attachment_right_foot.transform = bone_transform_right
158 | LeftLegIKTarget.transform.origin = lerp(LeftLegIKTarget.transform.origin, bone_transform_left.origin, get_physics_process_delta_time()*2)
159 | LeftLegIKTarget.transform.basis = lerp(LeftLegIKTarget.transform.basis, bone_transform_left.basis, get_physics_process_delta_time()*2)
160 | RightLegIKTarget.transform.origin = lerp(RightLegIKTarget.transform.origin, bone_transform_right.origin, get_physics_process_delta_time()*2)
161 | RightLegIKTarget.transform.basis = lerp(RightLegIKTarget.transform.basis, bone_transform_right.basis, get_physics_process_delta_time()*2)
162 | if !LeftLegIK.is_running():
163 | LeftLegIK.start()
164 | if !RightLegIK.is_running():
165 | RightLegIK.start()
166 | else:
167 | if LeftLegIK.is_running():
168 | LeftLegIK.stop()
169 | if RightLegIK.is_running():
170 | RightLegIK.stop()
171 |
172 | var left_foot_position : Vector3 = (character_skeleton.global_transform * character_skeleton.get_bone_global_pose_no_override(character_skeleton.find_bone(String(LeftLegIK.tip_bone)))).origin
173 | var right_foot_position : Vector3 = (character_skeleton.global_transform * character_skeleton.get_bone_global_pose_no_override(character_skeleton.find_bone(String(RightLegIK.tip_bone)))).origin
174 | if debug:
175 | DebugDraw3D.draw_sphere(left_foot_position, 0.1, Color.RED, 0.0)
176 | DebugDraw3D.draw_sphere(right_foot_position, 0.1, Color.RED, 0.0)
177 | if stride_warping_enable and is_on_floor:
178 | if debug:
179 | DebugDraw3D.draw_sphere((character_skeleton.global_transform * character_skeleton.get_bone_global_pose_override(character_skeleton.find_bone(String(LeftLegIK.tip_bone)))).origin, 0.075, Color.GREEN, 0.0)
180 | DebugDraw3D.draw_sphere((character_skeleton.global_transform * character_skeleton.get_bone_global_pose_override(character_skeleton.find_bone(String(RightLegIK.tip_bone)))).origin, 0.075, Color.GREEN, 0.0)
181 | stride_warping(LeftLegIKTarget, character_skeleton, hips_bone_name, String(LeftLegIK.tip_bone), String(LeftLegIK.root_bone), left_leg_ground_normal_ray_cast.get_collision_normal() if left_leg_ground_normal_ray_cast.is_colliding() else Vector3.UP)
182 | stride_warping(RightLegIKTarget, character_skeleton, hips_bone_name, String(RightLegIK.tip_bone), String(RightLegIK.root_bone), right_leg_ground_normal_ray_cast.get_collision_normal() if right_leg_ground_normal_ray_cast.is_colliding() else Vector3.UP)
183 | else:
184 | if debug:
185 | DebugDraw3D.draw_sphere(left_foot_position, 0.075, Color.GREEN, 0.0)
186 | DebugDraw3D.draw_sphere(right_foot_position, 0.075, Color.GREEN, 0.0)
187 |
188 | if slope_warping_enable and is_on_floor:
189 | slope_warping(LeftLegIKTarget, left_target_rotation, left_leg_ground_normal_ray_cast, slope_warping_raycast_left, slope_warping_raycast_left_touch_detection, slope_warping_bone_attachment_left_foot, 0)
190 | slope_warping(RightLegIKTarget, right_target_rotation, right_leg_ground_normal_ray_cast, slope_warping_raycast_right, slope_warping_raycast_right_touch_detection, slope_warping_bone_attachment_right_foot, 1)
191 |
192 |
193 | set_orientation_warping_direction(orientation_warping_enable, orientation_warping_camera_h_object, character_velocity, orientation_warping_turn_rate, get_physics_process_delta_time())
194 | orientation_warping(orientation_warping_enable, character_skeleton, hips_bone_name, orientation_warping_spine_bones_names, orientation_warping_offset)
195 |
196 | # Adjust ground touch raycast length for slopes
197 | if left_leg_ground_normal_ray_cast.get_collision_normal() != Vector3.UP:
198 | slope_warping_raycast_left_touch_detection.target_position.y = slope_warping_foot_ground_touch_raycast_length + abs(left_target_rotation.rotation.x)/10.0
199 | else:
200 | slope_warping_raycast_left_touch_detection.target_position.y = slope_warping_foot_ground_touch_raycast_length
201 |
202 | if right_leg_ground_normal_ray_cast.get_collision_normal() != Vector3.UP:
203 | slope_warping_raycast_right_touch_detection.target_position.y = slope_warping_foot_ground_touch_raycast_length + abs(right_target_rotation.rotation.x)/10.0
204 | else:
205 | slope_warping_raycast_right_touch_detection.target_position.y = slope_warping_foot_ground_touch_raycast_length
206 |
207 |
208 | ## For Predicting Stop Location
209 | ## v is velocity. t is time. a is acceleration
210 | func CalculateStopLocation(deacceleration:float) -> Vector3:
211 | var time : float = CalculateStopTime(deacceleration)
212 | ## it uses a linear equation : d = v*t + 0.5 * a * t^2
213 | var predictied_distance_before_stop : Vector3 = (character_velocity * time + 0.5*(-deacceleration*character_velocity.normalized())*pow(time,2))
214 | var stop_position : Vector3 = character_position + predictied_distance_before_stop
215 | if debug:
216 | DebugDraw3D.draw_sphere(stop_position+Vector3(0, 0.75, 0), 0.3, Color.RED, 3.0)
217 | return stop_position
218 |
219 | func CalculateStopTime(deacceleration:float) -> float:
220 | var time : float = character_velocity.length() / deacceleration
221 | return time
222 |
223 |
224 | var previous_direction : float
225 | var orientation_direction : float
226 | var cleared_override : bool = true
227 |
228 | #just sets the orientation warping direction, this isn't a specific algorithm,
229 | #just my way of how the character should walk.
230 | func set_orientation_warping_direction(enabled:bool, CameraObject, Velocity : Vector3, turn_rate : float, delta:float):
231 | if is_equal_approx(character_velocity.length(),0.0) or !orientation_warping_enable:
232 | orientation_direction = 0
233 | rotation.y = 0
234 | return
235 | var CameraAngle :Quaternion = Quaternion(Vector3(0,1,0),atan2(-CameraObject.transform.basis.z.z, -CameraObject.transform.basis.z.x))
236 | var VelocityAngle :Quaternion = Quaternion(Vector3(0,1,0),atan2(Velocity.z, Velocity.x))
237 | var IsMovingBackwardRelativeToCamera :bool = false if -Velocity.rotated(Vector3.UP,-CameraObject.transform.basis.get_euler().y).z >= -0.1 else true
238 | var IsMovingLeftRelativeToCamera :bool = false if -Velocity.rotated(Vector3.UP,-CameraObject.transform.basis.get_euler().y).x >= -0.1 else true
239 | var rotation_difference_camera_velocity :float = CameraAngle.angle_to(VelocityAngle)
240 | previous_direction = orientation_direction
241 | orientation_direction = rotation_difference_camera_velocity
242 | if IsMovingBackwardRelativeToCamera:
243 | # Make the legs face forward just like the forward walking
244 | orientation_direction *= -1
245 | orientation_direction = orientation_direction + PI
246 | # Set Left or Right
247 | if IsMovingLeftRelativeToCamera:
248 | orientation_direction *= -1
249 | if IsMovingBackwardRelativeToCamera:
250 | # since we rotated the legs to face forward, then the right and left will be reversed
251 | # so we need to reverse it back again after getting the right and left values
252 | orientation_direction *= -1
253 |
254 | orientation_direction = clampf(lerp_angle(previous_direction,orientation_direction,delta*turn_rate),-PI/2, PI/2)
255 | rotation.y = orientation_direction
256 |
257 | func orientation_warping(enabled:bool, character_skeleton:Skeleton3D, Hip :String= "Hips", Spines :Array[String]= ["Spine","Spine1","Spine2"], Offset := 0.0):
258 |
259 | if !enabled and !cleared_override:
260 | set_bone_y_rotation(character_skeleton,Hip,0)
261 | for bone in Spines:
262 | set_bone_y_rotation(character_skeleton,bone,0)
263 | cleared_override = true
264 | if !enabled:
265 | return
266 | cleared_override = false
267 | #Orient bones to face the forward direction
268 | set_bone_y_rotation(character_skeleton,Hip,orientation_direction)
269 | for bone in Spines:
270 | set_bone_y_rotation(character_skeleton,bone,-(orientation_direction/(Spines.size()))+Offset)
271 |
272 |
273 | func set_bone_y_rotation(skeleton:Skeleton3D,bone_name:String, y_rot:float):
274 | var bone = skeleton.find_bone(bone_name)
275 | var bone_transform : Transform3D = skeleton.get_bone_global_pose(bone)
276 | bone_transform = bone_transform.rotated(Vector3(0,1,0), y_rot)
277 |
278 | skeleton.set_bone_global_pose(bone, bone_transform)
279 |
280 |
281 | func stride_warping(target:Node3D, skeleton_ref:Skeleton3D, hips_name:String, Foot:String, Thigh:String, floor_normal:Vector3 = Vector3.UP):
282 | #add_sibling(test_sphere)
283 | #add_sibling(test_sphere1)
284 |
285 | #skeleton_ref.clear_bones_local_pose_override()
286 | var distance_in_each_frame = (character_velocity*Vector3(1,0,1)).rotated(Vector3.UP,skeleton_ref.global_transform.basis.get_euler().y).length()
287 | var hips = skeleton_ref.find_bone(hips_name)
288 | var hips_transform = skeleton_ref.get_bone_pose(hips)
289 |
290 | var hips_distance_to_ground
291 | var stride_scale : float = 1.0
292 | #Get Bones
293 | var bone = skeleton_ref.find_bone(Foot)
294 | var bone_transform = skeleton_ref.get_bone_global_pose(bone)
295 | var thigh_bone = skeleton_ref.find_bone(Thigh)
296 | var thigh_transform = skeleton_ref.get_bone_global_pose(thigh_bone)
297 | var thigh_angle = thigh_transform.basis.get_euler().x
298 |
299 | #Calculate
300 | var stride_direction : Vector3 = Vector3.FORWARD # important to use in orientation warping
301 | var stride_warping_plane_origin = Plane(floor_normal, bone_transform.origin).intersects_ray(thigh_transform.origin,Vector3.DOWN)
302 | # print(stride_warping_plane_origin)
303 | if stride_warping_plane_origin == null:
304 | return #Failed to get a plane origin/ we are probably in air
305 |
306 | var scale_origin = Plane(stride_direction,stride_warping_plane_origin).project(bone_transform.origin)
307 | var anim_speed = pow(hips_transform.origin.distance_to(bone_transform.origin),2) - pow(hips_transform.origin.y,2)
308 | anim_speed = sqrt(abs(anim_speed))
309 | stride_scale = clampf(distance_in_each_frame/4/anim_speed,0.0,2.0)
310 | var foot_warped_location : Vector3 = scale_origin + (bone_transform.origin - scale_origin) * stride_scale
311 | # Apply
312 | if stride_scale > 0.1:
313 | target.position = lerp(target.position, foot_warped_location, 1)
314 |
315 | var updated_raycast_pos : Array[bool]
316 | func foot_look_at_y(from:Vector3, to:Vector3, up_ref:Vector3 = Vector3.UP) -> Basis:
317 | var forward = (to - from).normalized()
318 | var right = up_ref.normalized().cross(forward).normalized()
319 | forward = right.cross(up_ref).normalized()
320 | return Basis(right, up_ref, forward)
321 | func slope_warping(target:Node3D, target_rotation:Node3D, leg_ground_normal_ray_cast:RayCast3D, raycast:RayCast3D, touch_raycast:RayCast3D, no_raycast_pos, leg_number:int):
322 | if updated_raycast_pos.size() < leg_number+1:
323 | updated_raycast_pos.resize(leg_number+1)
324 |
325 | if slope_warping_feet_locking_enable:
326 | if touch_raycast.is_colliding() and character_velocity.length() > 0.5:
327 | if updated_raycast_pos[leg_number] == false:
328 | raycast.global_position = no_raycast_pos.global_position + Vector3(0.0,0.25,0.0) # Set the lock position
329 | updated_raycast_pos[leg_number] = true
330 | else:
331 | updated_raycast_pos[leg_number] = false
332 | # Update position to not let the leg yeet towards the old far location
333 | raycast.global_position = lerp(raycast.global_position, no_raycast_pos.global_position + Vector3(0.0,0.25,0.0), get_process_delta_time()*20) #smoothly lerp out of lock
334 | else:
335 | raycast.global_position = no_raycast_pos.global_position + Vector3(0.0,0.25,0.0)
336 | #character_skeleton.get_bone_global_pose(no_raycast_pos.bone_idx)
337 | if raycast.is_colliding() and (touch_raycast.is_colliding() or character_velocity.length()<1.0): #if raycast is on ground
338 | var hit_point = raycast.get_collision_point() + Vector3.UP*slope_warping_foot_height_offset #gets Y position of where the ground is.
339 | if character_velocity.length() > 0.5 and slope_warping_feet_locking_enable:
340 | target.global_transform.origin = lerp(target.global_transform.origin, hit_point, 1) #sets the target to the position of the hitpoint which helps locking too
341 | else:
342 | target.global_transform.origin.y = hit_point.y #sets the target to the y position of the hitpoint
343 | var up_ref = raycast.get_collision_normal()
344 | target_rotation.global_transform.basis = foot_look_at_y(Vector3.ZERO, character_skeleton.global_transform.basis.z.rotated(Vector3.UP, orientation_direction), leg_ground_normal_ray_cast.get_collision_normal())
345 |
--------------------------------------------------------------------------------
/addons/PoseWarping/PoseWarping.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=3 uid="uid://ccqctdss4s6u5"]
2 |
3 | [ext_resource type="Script" path="res://addons/PoseWarping/PoseWarping.gd" id="1_lecgu"]
4 |
5 | [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_8kjlp"]
6 | albedo_color = Color(1, 0.337255, 0, 1)
7 |
8 | [sub_resource type="SphereMesh" id="SphereMesh_kea8p"]
9 | material = SubResource("StandardMaterial3D_8kjlp")
10 | radius = 0.1
11 | height = 0.2
12 |
13 | [node name="PoseWarping" type="SkeletonModifier3D"]
14 | _import_path = NodePath("")
15 | unique_name_in_owner = false
16 | process_mode = 0
17 | process_priority = 0
18 | process_physics_priority = 0
19 | process_thread_group = 0
20 | physics_interpolation_mode = 0
21 | auto_translate_mode = 0
22 | editor_description = ""
23 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
24 | rotation_edit_mode = 0
25 | rotation_order = 2
26 | top_level = false
27 | visible = true
28 | visibility_parent = NodePath("")
29 | active = true
30 | influence = 1.0
31 | script = ExtResource("1_lecgu")
32 |
33 | [node name="LeftTargetRotation" type="Node3D" parent="."]
34 |
35 | [node name="LeftIKTarget" type="Marker3D" parent="LeftTargetRotation"]
36 | transform = Transform3D(-1, 8.74228e-08, 0, -5.61943e-08, -0.642788, 0.766044, 6.69697e-08, 0.766044, 0.642788, 0, 0, 0)
37 |
38 | [node name="ResultDebug" type="MeshInstance3D" parent="LeftTargetRotation/LeftIKTarget"]
39 | transform = Transform3D(-1, -6.18173e-08, 6.18173e-08, 8.74228e-08, -0.707107, 0.707107, 0, 0.707107, 0.707107, 0, 0, 0)
40 | visible = false
41 | mesh = SubResource("SphereMesh_kea8p")
42 | skeleton = NodePath("../../..")
43 |
44 | [node name="RightTargetRotation" type="Node3D" parent="."]
45 |
46 | [node name="RightIKTarget" type="Marker3D" parent="RightTargetRotation"]
47 | transform = Transform3D(-1, -8.74228e-08, 0, 5.61943e-08, -0.642788, 0.766044, -6.69697e-08, 0.766044, 0.642788, 0, 0, 0)
48 |
49 | [node name="ResultDebug" type="MeshInstance3D" parent="RightTargetRotation/RightIKTarget"]
50 | transform = Transform3D(-1, -6.18173e-08, 6.18173e-08, 8.74228e-08, -0.707107, 0.707107, 0, 0.707107, 0.707107, 0, 0, 0)
51 | visible = false
52 | mesh = SubResource("SphereMesh_kea8p")
53 | skeleton = NodePath("../../..")
54 |
55 | [node name="LeftFootAttachment" type="BoneAttachment3D" parent="."]
56 | bone_name = "LeftFoot"
57 | bone_idx = 64
58 | use_external_skeleton = true
59 | external_skeleton = NodePath("")
60 |
61 | [node name="LeftLegGroundNormalRayCast" type="RayCast3D" parent="LeftFootAttachment"]
62 | transform = Transform3D(1, 0, 0, 0, 0.70711, 0.707111, 0, -0.70711, 0.707111, 0, 0, 0)
63 | target_position = Vector3(0, 1, 0)
64 | debug_shape_custom_color = Color(0.662745, 0, 0, 1)
65 | debug_shape_thickness = 5
66 |
67 | [node name="LeftLegTouchRayCast" type="RayCast3D" parent="LeftFootAttachment"]
68 | transform = Transform3D(1, 0, 0, 0, 0.70711, 0.707111, 0, -0.70711, 0.707111, 0, 0, 0)
69 | target_position = Vector3(0, 0.14, 0)
70 | debug_shape_custom_color = Color(0.662745, 0.647059, 0, 1)
71 | debug_shape_thickness = 5
72 |
73 | [node name="RightFootAttachment" type="BoneAttachment3D" parent="."]
74 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0396977, 0.103349, 0.111844)
75 | bone_name = "RightFoot"
76 | bone_idx = 59
77 | use_external_skeleton = true
78 | external_skeleton = NodePath("")
79 |
80 | [node name="RightLegGroundNormalRayCast" type="RayCast3D" parent="RightFootAttachment"]
81 | transform = Transform3D(1, 0, 0, 0, 0.70711, 0.707112, 0, -0.70711, 0.707112, 0, 0, 0)
82 | target_position = Vector3(0, 1, 0)
83 | debug_shape_custom_color = Color(0.662745, 0, 0, 1)
84 | debug_shape_thickness = 5
85 |
86 | [node name="RightLegTouchRayCast" type="RayCast3D" parent="RightFootAttachment"]
87 | transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 0, 0)
88 | target_position = Vector3(0, 0.14, 0)
89 | debug_shape_custom_color = Color(0.662745, 0.647059, 0, 1)
90 | debug_shape_thickness = 5
91 |
92 | [node name="LeftLegTargetRayCast" type="RayCast3D" parent="."]
93 | top_level = true
94 | debug_shape_thickness = 5
95 |
96 | [node name="RightLegTargetRayCast" type="RayCast3D" parent="."]
97 | top_level = true
98 | debug_shape_thickness = 5
99 |
100 | [node name="OnFloorRayCast" type="RayCast3D" parent="."]
101 | target_position = Vector3(0, -0.4, 0)
102 |
--------------------------------------------------------------------------------
/addons/PoseWarping/PoseWarpingPlugin.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends EditorPlugin
3 |
4 | func _enter_tree():
5 | # Initialization of the plugin goes here.
6 | pass
7 |
8 | func _exit_tree():
9 | # Clean-up of the plugin goes here.
10 | pass
11 |
--------------------------------------------------------------------------------
/addons/PoseWarping/plugin.cfg:
--------------------------------------------------------------------------------
1 | [plugin]
2 |
3 | name="Pose Warping"
4 | description="An addon that has most of distance matching functions to be used in creating advanced 3D movement for games."
5 | author="ywmaa"
6 | version="0.8"
7 | script="PoseWarpingPlugin.gd"
8 |
--------------------------------------------------------------------------------
/addons/debug_draw_3d/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 DmitriySalnikov
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the Software), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, andor sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/addons/debug_draw_3d/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | # Debug drawing utility for Godot
4 |
5 | This is an add-on for debug drawing in 3D and for some 2D overlays, which is written in `C++` and can be used with `GDScript` or `C#`.
6 |
7 | Based on my previous addon, which was developed [only for C#](https://github.com/DmitriySalnikov/godot_debug_draw_cs), and which was inspired by [Zylann's GDScript addon](https://github.com/Zylann/godot_debug_draw)
8 |
9 | ## [Documentation](https://dd3d.dmitriysalnikov.ru/docs/)
10 |
11 | ## [Godot 3 version](https://github.com/DmitriySalnikov/godot_debug_draw_3d/tree/godot_3)
12 |
13 | ## Support me
14 |
15 | Your support adds motivation to develop my public projects.
16 |
17 |
18 |
19 |
20 |
21 | USDT-TRC20 TEw934PrsffHsAn5M63SoHYRuZo984EF6v
22 |
23 | ## Features
24 |
25 | 3D:
26 |
27 | * Arrow
28 | * Billboard opaque square
29 | * Box
30 | * Camera Frustum
31 | * Cylinder
32 | * Gizmo
33 | * Grid
34 | * Line
35 | * Line Path
36 | * Line with Arrow
37 | * Plane
38 | * Points
39 | * Position 3D (3 crossing axes)
40 | * Sphere
41 |
42 | 2D:
43 |
44 | * **[Work in progress]**
45 |
46 | Overlay:
47 |
48 | * Text (with grouping and coloring)
49 | * FPS Graph
50 | * Custom Graphs
51 |
52 | Precompiled for:
53 |
54 | * Windows
55 | * Linux (built on Ubuntu 20.04)
56 | * macOS (10.14+)
57 | * Android (5.0+)
58 | * iOS
59 | * Web (Firefox not supported)
60 |
61 | This addon also supports working with several World3D and different Viewports.
62 |
63 | ## [Interactive Web Demo](https://dd3d.dmitriysalnikov.ru/demo/)
64 |
65 | [](https://dd3d.dmitriysalnikov.ru/demo/)
66 |
67 | > [!WARNING]
68 | >
69 | > * Firefox most likely can't run this demo
70 |
71 | ## Download
72 |
73 | To download, use the [Godot Asset Library](https://godotengine.org/asset-library/asset/1766) or download the archive by clicking the button at the top of the main repository page: `Code -> Download ZIP`, then unzip it to your project folder. Or use one of the stable versions from the [GitHub Releases](https://github.com/DmitriySalnikov/godot_debug_draw_3d/releases) page (just download one of the `Source Codes` in assets).
74 |
75 | ### Installation
76 |
77 | * Close editor
78 | * Copy `addons/debug_draw_3d` to your `addons` folder, create it if the folder doesn't exist
79 | * Launch editor
80 |
81 | ## Examples
82 |
83 | More examples can be found in the `examples_dd3d/` folder.
84 |
85 | Simple test:
86 |
87 | ```gdscript
88 | func _process(delta: float) -> void:
89 | var _time = Time.get_ticks_msec() / 1000.0
90 | var box_pos = Vector3(0, sin(_time * 4), 0)
91 | var line_begin = Vector3(-1, sin(_time * 4), 0)
92 | var line_end = Vector3(1, cos(_time * 4), 0)
93 |
94 | DebugDraw3D.draw_box(box_pos, Vector3(1, 2, 1), Color(0, 1, 0))
95 | DebugDraw3D.draw_line(line_begin, line_end, Color(1, 1, 0))
96 | DebugDraw2D.set_text("Time", _time)
97 | DebugDraw2D.set_text("Frames drawn", Engine.get_frames_drawn())
98 | DebugDraw2D.set_text("FPS", Engine.get_frames_per_second())
99 | DebugDraw2D.set_text("delta", delta)
100 | ```
101 |
102 | 
103 |
104 | ## API
105 |
106 | This project has a separate [documentation](https://dd3d.dmitriysalnikov.ru/docs/) page.
107 |
108 | Also, a list of all functions is available in the documentation inside the editor (see `DebugDraw3D` and `DebugDraw2D`).
109 |
110 | 
111 |
112 | ## Known issues and limitations
113 |
114 | Enabling occlusion culing can lower fps instead of increasing it. At the moment I do not know how to speed up the calculation of the visibility of objects.
115 |
116 | The text in the keys and values of a text group cannot contain multi-line strings.
117 |
118 | The entire text overlay can only be placed in one corner, unlike `DataGraphs`.
119 |
120 | [Frustum of Camera3D does not take into account the window size from ProjectSettings](https://github.com/godotengine/godot/issues/70362).
121 |
122 | **The version for Godot 4.0 requires explicitly specifying the exact data types, otherwise errors may occur.**
123 |
124 | ## More screenshots
125 |
126 | `DebugDrawDemoScene.tscn` in editor
127 | 
128 |
129 | `DebugDrawDemoScene.tscn` in play mode
130 | 
131 |
--------------------------------------------------------------------------------
/addons/debug_draw_3d/debug_draw_3d.gdextension:
--------------------------------------------------------------------------------
1 | [configuration]
2 |
3 | entry_symbol = "debug_draw_3d_library_init"
4 | compatibility_minimum = "4.1.3"
5 | reloadable = false
6 |
7 | [dependencies]
8 |
9 | ; example.x86_64 = { "relative or absolute path to the dependency" : "the path relative to the exported project", }
10 | ; -------------------------------------
11 | ; debug
12 |
13 | macos = { }
14 | windows.x86_64 = { }
15 | linux.x86_64 = { }
16 |
17 | web.wasm32 = {}
18 |
19 | android.arm32 = { }
20 | android.arm64 = { }
21 | android.x86_32 = { }
22 | android.x86_64 = { }
23 | ios = {}
24 |
25 | ; -------------------------------------
26 | ; release no debug draw
27 |
28 | macos.template_release = { }
29 | windows.template_release.x86_64 = { }
30 | linux.template_release.x86_64 = { }
31 |
32 | web.template_release.wasm32 = { }
33 |
34 | android.template_release.arm32 = { }
35 | android.template_release.arm64 = { }
36 | android.template_release.x86_32 = { }
37 | android.template_release.x86_64 = { }
38 | ios.template_release = {}
39 |
40 | ; -------------------------------------
41 | ; release forced debug draw
42 |
43 | macos.template_release.forced_dd3d = { }
44 | windows.template_release.x86_64.forced_dd3d = { }
45 | linux.template_release.x86_64.forced_dd3d = { }
46 |
47 | web.template_release.wasm32.forced_dd3d = { }
48 | ios.template_release.forced_dd3d = {}
49 |
50 | [libraries]
51 |
52 | ; -------------------------------------
53 | ; debug
54 |
55 | macos = "libs/libdd3d.macos.editor.universal.framework"
56 | windows.x86_64 = "libs/libdd3d.windows.editor.x86_64.dll"
57 | linux.x86_64 = "libs/libdd3d.linux.editor.x86_64.so"
58 |
59 | web.wasm32 = "libs/libdd3d.web.template_debug.wasm32.wasm"
60 |
61 | android.arm32 = "libs/libdd3d.android.template_debug.arm32.so"
62 | android.arm64 = "libs/libdd3d.android.template_debug.arm64.so"
63 | android.x86_32 = "libs/libdd3d.android.template_debug.x86_32.so"
64 | android.x86_64 = "libs/libdd3d.android.template_debug.x86_64.so"
65 | ios = "libs/libdd3d.ios.template_debug.universal.dylib"
66 |
67 | ; -------------------------------------
68 | ; release no debug draw
69 |
70 | macos.template_release = "libs/libdd3d.macos.template_release.universal.framework"
71 | windows.template_release.x86_64 = "libs/libdd3d.windows.template_release.x86_64.dll"
72 | linux.template_release.x86_64 = "libs/libdd3d.linux.template_release.x86_64.so"
73 |
74 | web.template_release.wasm32 = "libs/libdd3d.web.template_release.wasm32.wasm"
75 |
76 | android.template_release.arm32 = "libs/libdd3d.android.template_release.arm32.so"
77 | android.template_release.arm64 = "libs/libdd3d.android.template_release.arm64.so"
78 | android.template_release.x86_32 = "libs/libdd3d.android.template_release.x86_32.so"
79 | android.template_release.x86_64 = "libs/libdd3d.android.template_release.x86_64.so"
80 | ios.template_release = "libs/libdd3d.ios.template_release.universal.dylib"
81 |
82 | ; -------------------------------------
83 | ; release forced debug draw
84 |
85 | macos.template_release.forced_dd3d = "libs/libdd3d.macos.template_release.universal.enabled.framework"
86 | windows.template_release.x86_64.forced_dd3d = "libs/libdd3d.windows.template_release.x86_64.enabled.dll"
87 | linux.template_release.x86_64.forced_dd3d = "libs/libdd3d.linux.template_release.x86_64.enabled.so"
88 |
89 | web.template_release.wasm32.forced_dd3d = "libs/libdd3d.web.template_release.wasm32.enabled.wasm"
90 | ios.template_release.forced_dd3d = "libs/libdd3d.ios.template_release.universal.enabled.dylib"
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/.gdignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/.gdignore
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.android.template_debug.arm32.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.android.template_debug.arm32.so
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.android.template_debug.arm64.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.android.template_debug.arm64.so
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.android.template_debug.x86_32.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.android.template_debug.x86_32.so
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.android.template_debug.x86_64.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.android.template_debug.x86_64.so
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.android.template_release.arm32.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.android.template_release.arm32.so
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.android.template_release.arm64.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.android.template_release.arm64.so
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.android.template_release.x86_32.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.android.template_release.x86_32.so
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.android.template_release.x86_64.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.android.template_release.x86_64.so
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.ios.template_debug.universal.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.ios.template_debug.universal.dylib
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.ios.template_release.universal.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.ios.template_release.universal.dylib
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.ios.template_release.universal.enabled.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.ios.template_release.universal.enabled.dylib
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.linux.editor.x86_64.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.linux.editor.x86_64.so
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.linux.template_release.x86_64.enabled.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.linux.template_release.x86_64.enabled.so
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.linux.template_release.x86_64.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.linux.template_release.x86_64.so
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.macos.editor.universal.framework/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleInfoDictionaryVersion
6 | 6.0
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | libdd3d.macos.editor.universal
11 | CFBundleName
12 | Debug Draw 3D
13 | CFBundleDisplayName
14 | Debug Draw 3D
15 | CFBundleIdentifier
16 | ru.dmitriysalnikov.dd3d
17 | NSHumanReadableCopyright
18 | Copyright (c) Dmitriy Salnikov.
19 | CFBundleVersion
20 | 1.4.0
21 | CFBundleShortVersionString
22 | 1.4.0
23 | CFBundlePackageType
24 | FMWK
25 | CSResourcesFileMapped
26 |
27 | DTPlatformName
28 | macosx
29 | LSMinimumSystemVersion
30 | 10.14
31 |
32 |
33 |
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.macos.editor.universal.framework/libdd3d.macos.editor.universal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.macos.editor.universal.framework/libdd3d.macos.editor.universal
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.macos.template_release.universal.enabled.framework/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleInfoDictionaryVersion
6 | 6.0
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | libdd3d.macos.template_release.universal.enabled
11 | CFBundleName
12 | Debug Draw 3D
13 | CFBundleDisplayName
14 | Debug Draw 3D
15 | CFBundleIdentifier
16 | ru.dmitriysalnikov.dd3d
17 | NSHumanReadableCopyright
18 | Copyright (c) Dmitriy Salnikov.
19 | CFBundleVersion
20 | 1.4.0
21 | CFBundleShortVersionString
22 | 1.4.0
23 | CFBundlePackageType
24 | FMWK
25 | CSResourcesFileMapped
26 |
27 | DTPlatformName
28 | macosx
29 | LSMinimumSystemVersion
30 | 10.14
31 |
32 |
33 |
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.macos.template_release.universal.enabled.framework/libdd3d.macos.template_release.universal.enabled:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.macos.template_release.universal.enabled.framework/libdd3d.macos.template_release.universal.enabled
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.macos.template_release.universal.framework/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleInfoDictionaryVersion
6 | 6.0
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | libdd3d.macos.template_release.universal
11 | CFBundleName
12 | Debug Draw 3D
13 | CFBundleDisplayName
14 | Debug Draw 3D
15 | CFBundleIdentifier
16 | ru.dmitriysalnikov.dd3d
17 | NSHumanReadableCopyright
18 | Copyright (c) Dmitriy Salnikov.
19 | CFBundleVersion
20 | 1.4.0
21 | CFBundleShortVersionString
22 | 1.4.0
23 | CFBundlePackageType
24 | FMWK
25 | CSResourcesFileMapped
26 |
27 | DTPlatformName
28 | macosx
29 | LSMinimumSystemVersion
30 | 10.14
31 |
32 |
33 |
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.macos.template_release.universal.framework/libdd3d.macos.template_release.universal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.macos.template_release.universal.framework/libdd3d.macos.template_release.universal
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.web.template_debug.wasm32.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.web.template_debug.wasm32.wasm
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.web.template_release.wasm32.enabled.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.web.template_release.wasm32.enabled.wasm
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.web.template_release.wasm32.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.web.template_release.wasm32.wasm
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.windows.editor.x86_64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.windows.editor.x86_64.dll
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.windows.template_release.x86_64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.windows.template_release.x86_64.dll
--------------------------------------------------------------------------------
/addons/debug_draw_3d/libs/libdd3d.windows.template_release.x86_64.enabled.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/addons/debug_draw_3d/libs/libdd3d.windows.template_release.x86_64.enabled.dll
--------------------------------------------------------------------------------
/default_bus_layout.tres:
--------------------------------------------------------------------------------
1 | [gd_resource type="AudioBusLayout" format=3 uid="uid://bemotwr4e8kf1"]
2 |
3 | [resource]
4 |
--------------------------------------------------------------------------------
/examples_dd3d/DebugDrawDemoSceneCS.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=3 format=3 uid="uid://sxtw8fme7g63"]
2 |
3 | [ext_resource type="PackedScene" uid="uid://c3sccy6x0ht5j" path="res://examples_dd3d/DebugDrawDemoScene.tscn" id="2"]
4 | [ext_resource type="Script" path="res://examples_dd3d/DebugDrawDemoSceneCS.cs" id="2_ipqea"]
5 |
6 | [node name="DebugDrawDemoSceneCS" instance=ExtResource("2")]
7 | script = ExtResource("2_ipqea")
8 |
9 | [node name="Settings" parent="." index="21"]
10 | switch_to_scene = "res://examples_dd3d/DebugDrawDemoScene.tscn"
11 |
12 | [node name="Label" parent="Settings/HBox/VBoxContainer" index="1"]
13 | text = "C# example"
14 |
15 | [node name="SwitchLang" parent="Settings/HBox/PanelContainer/VBox" index="12"]
16 | text = "Switch to GDScript"
17 |
--------------------------------------------------------------------------------
/examples_dd3d/Roboto-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ywmaa/Advanced-Movement-System-Godot/bc16f8f621d8c5465bda81bef48235fc08bde35e/examples_dd3d/Roboto-Bold.ttf
--------------------------------------------------------------------------------
/examples_dd3d/Roboto-Bold.ttf.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="font_data_dynamic"
4 | type="FontFile"
5 | uid="uid://erdgllynwqkw"
6 | path="res://.godot/imported/Roboto-Bold.ttf-3674de3d9ad3ee757cd4b4a89f1e126d.fontdata"
7 |
8 | [deps]
9 |
10 | source_file="res://examples_dd3d/Roboto-Bold.ttf"
11 | dest_files=["res://.godot/imported/Roboto-Bold.ttf-3674de3d9ad3ee757cd4b4a89f1e126d.fontdata"]
12 |
13 | [params]
14 |
15 | Rendering=null
16 | antialiasing=1
17 | generate_mipmaps=false
18 | multichannel_signed_distance_field=false
19 | msdf_pixel_range=8
20 | msdf_size=48
21 | allow_system_fallback=true
22 | force_autohinter=false
23 | hinting=1
24 | subpixel_positioning=1
25 | oversampling=0.0
26 | Fallbacks=null
27 | fallbacks=[]
28 | Compress=null
29 | compress=true
30 | preload=[{
31 | "chars": [],
32 | "glyphs": [],
33 | "name": "New Configuration"
34 | }]
35 | language_support={}
36 | script_support={}
37 | opentype_features={}
38 |
--------------------------------------------------------------------------------
/examples_dd3d/VisualizerAudioBus.tres:
--------------------------------------------------------------------------------
1 | [gd_resource type="AudioBusLayout" load_steps=2 format=3 uid="uid://7sy4h4ibftrk"]
2 |
3 | [sub_resource type="AudioEffectSpectrumAnalyzer" id="AudioEffectSpectrumAnalyzer_odciy"]
4 | resource_name = "SpectrumAnalyzer"
5 | fft_size = 3
6 |
7 | [resource]
8 | bus/0/mute = true
9 | bus/0/volume_db = -20.0
10 | bus/1/name = &"MusicAnalyzer"
11 | bus/1/solo = false
12 | bus/1/mute = false
13 | bus/1/bypass_fx = false
14 | bus/1/volume_db = 0.0
15 | bus/1/send = &"Master"
16 | bus/1/effect/0/effect = SubResource("AudioEffectSpectrumAnalyzer_odciy")
17 | bus/1/effect/0/enabled = true
18 |
--------------------------------------------------------------------------------
/examples_dd3d/addon_icon.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Node3D
3 |
4 | func _process(delta: float) -> void:
5 | var a = DebugDraw3D.new_scoped_config().set_thickness(0.015)
6 | DebugDraw3D.draw_box_xf($box.global_transform, Color.GREEN)
7 | DebugDraw3D.draw_gizmo($gizmo.global_transform)
8 | DebugDraw3D.draw_grid_xf($gizmo/grid.global_transform, Vector2i(2,2), DebugDraw3D.empty_color, false)
9 | DebugDraw3D.draw_sphere_xf($sphere.global_transform, Color.RED)
10 | DebugDraw3D.draw_cylinder($cylinder.global_transform, Color.BLUE)
11 | DebugDraw3D.draw_line_hit_offset($"line/1".global_transform.origin, $"line/2".global_transform.origin, true, 0.3, 0.1)
12 |
--------------------------------------------------------------------------------
/examples_dd3d/addon_icon.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=3 format=3 uid="uid://1lhiwf8tgleh"]
2 |
3 | [ext_resource type="Script" path="res://examples_dd3d/addon_icon.gd" id="1_bq18y"]
4 |
5 | [sub_resource type="Environment" id="1"]
6 | background_mode = 1
7 |
8 | [node name="icon" type="Node3D"]
9 | script = ExtResource("1_bq18y")
10 |
11 | [node name="Camera" type="Camera3D" parent="."]
12 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 5.39732)
13 | environment = SubResource("1")
14 | current = true
15 |
16 | [node name="box" type="Node3D" parent="."]
17 | transform = Transform3D(0.316305, 0.0204714, -0.293415, -0.239575, 0.267896, -0.239575, 0.170631, 0.338191, 0.207538, -0.410294, 0.312541, 0.243199)
18 |
19 | [node name="gizmo" type="Node3D" parent="."]
20 | transform = Transform3D(0.707107, 0, -0.707107, -0.294265, 0.909294, -0.294265, 0.642968, 0.416154, 0.642968, 0, 0, 0)
21 |
22 | [node name="grid" type="Node3D" parent="gizmo"]
23 | transform = Transform3D(1, -2.98023e-08, 1.19209e-07, 0, 1, 0, 1.19209e-07, -2.98023e-08, 1, -0.0263093, -0.0170284, -0.0263093)
24 |
25 | [node name="sphere" type="Node3D" parent="."]
26 | transform = Transform3D(0.401341, 0.207831, -0.437109, -0.449118, 0.371584, -0.235691, 0.180418, 0.46267, 0.385639, 0.466197, 0.322665, 0.200436)
27 |
28 | [node name="cylinder" type="Node3D" parent="."]
29 | transform = Transform3D(0.155034, 0.231693, -0.112783, -0.160003, 0.264761, -0.0839674, 0.0232275, 0.277352, 0.174372, -0.0566943, -0.290515, 0.905274)
30 |
31 | [node name="line" type="Node3D" parent="."]
32 |
33 | [node name="1" type="Node3D" parent="line"]
34 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.568458, -0.615948, 0.653444)
35 |
36 | [node name="2" type="Node3D" parent="line"]
37 | transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0051975, 0.373791, 0.0974927)
38 |
--------------------------------------------------------------------------------
/examples_dd3d/demo_camera_movement.gd:
--------------------------------------------------------------------------------
1 | extends Camera3D
2 |
3 | @export var mouse_sensitivity := 0.25
4 | @export var camera_speed := 10.0
5 | @export var camera_speed_fast := 30.0
6 |
7 | var btn_clicked := false
8 | const hPI := PI/2
9 | var rot_x := 0.0
10 | var rot_y := 0.0
11 |
12 |
13 | func _ready():
14 | reset_input_rotation()
15 |
16 |
17 | func _unhandled_input(event) -> void:
18 | if event is InputEventMouseButton:
19 | btn_clicked = event.pressed
20 |
21 |
22 | func reset_input_rotation():
23 | rot_x = rotation.y
24 | rot_y = rotation.x
25 |
26 |
27 | func _input(event) -> void:
28 | if btn_clicked:
29 | if event is InputEventMouseMotion:
30 | if event.button_mask == MOUSE_BUTTON_LEFT:
31 | rot_x += -deg_to_rad(event.relative.x * mouse_sensitivity)
32 | rot_y += -deg_to_rad(event.relative.y * mouse_sensitivity)
33 | rot_y = clamp(rot_y, -hPI, hPI)
34 |
35 | transform.basis = Basis()
36 | rotate_object_local(Vector3.UP, rot_x)
37 | rotate_object_local(Vector3.RIGHT, rot_y)
38 |
39 |
40 | func get_axis(neg : Array[Key], pos : Array[Key]) -> float:
41 | var pressed = func (arr: Array[Key]):
42 | var p: float = 0
43 | for k in arr:
44 | if Input.is_physical_key_pressed(k):
45 | p = 1
46 | break
47 | return p
48 |
49 | return pressed.call(pos) - pressed.call(neg)
50 |
51 |
52 | func _process(delta) -> void:
53 | var motion := Vector2(get_axis([KEY_S], [KEY_W]), get_axis([KEY_A], [KEY_D]))
54 | var lift := get_axis([KEY_Q, KEY_CTRL], [KEY_E, KEY_SPACE])
55 | var speed := camera_speed_fast if Input.is_physical_key_pressed(KEY_SHIFT) else camera_speed
56 | motion = motion.limit_length()
57 |
58 | var b := global_transform.basis
59 | var v := (-b.z * motion.x) + (b.x * motion.y) + (b.y * lift)
60 | global_position += v.limit_length() * speed * delta
61 |
--------------------------------------------------------------------------------
/examples_dd3d/demo_music_visualizer.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends VBoxContainer
3 |
4 | @export_range(1, 128) var bars_count := 32
5 | var transform: Transform3D:
6 | get:
7 | return %AudioVisualizer.global_transform
8 | @export_exp_easing("inout") var motion_smoothing := 0.025
9 | @export_range(0, 0.5) var bar_thickness := 0.065
10 | @export_range(0, 10) var bars_separation := 0.325
11 | @export_exp_easing("inout") var color_offset_speed := 0.4
12 | @export var colors: Gradient = null
13 |
14 | var MusicAnalyzerBus := &"MusicAnalyzer"
15 | var MasterBus := &"Master"
16 | var MAX_HZ := 16000.0
17 | var MIN_HZ := 20.0
18 | var MIN_DB := 60.0
19 | var spectrum: AudioEffectSpectrumAnalyzerInstance = null
20 |
21 | var smoothed_energy: Array[float] = []
22 | var color_offset := 0.0
23 |
24 | var _on_data_loaded_callback = null
25 |
26 | # TODO remove after moving to 4.2
27 | var is_4_2_and_higher = Engine.get_version_info()["major"] >= 4 && Engine.get_version_info()["minor"] >= 2
28 |
29 |
30 | func _ready():
31 | var bus = AudioServer.get_bus_index(MusicAnalyzerBus)
32 | if bus == -1:
33 | print("'MusicVisualizer' audio bus not found.\nSet 'VisualizerAudioBus.tres' as the default bus to use the audio visualizer.")
34 |
35 | spectrum = AudioServer.get_bus_effect_instance(bus, 0)
36 | %MuteMaster.button_pressed = AudioServer.is_bus_mute(AudioServer.get_bus_index(MasterBus))
37 | %VolumeSlider.value = db_to_linear(AudioServer.get_bus_volume_db(AudioServer.get_bus_index(MasterBus)))
38 |
39 | if OS.has_feature('web'):
40 | motion_smoothing = motion_smoothing * 1.5
41 |
42 | _on_data_loaded_callback = JavaScriptBridge.create_callback(_on_data_loaded)
43 | # Retrieve the 'gd_callbacks' object
44 | var gdcallbacks: JavaScriptObject = JavaScriptBridge.get_interface("gd_callbacks")
45 | # Assign the callbacks
46 | gdcallbacks.dataLoaded = _on_data_loaded_callback
47 |
48 |
49 | func _process(_delta):
50 | if %MusicPlayer.playing:
51 | draw_spectrum()
52 |
53 |
54 | func _pressed():
55 | var open_file = func(filepath: String):
56 | print("Opening '%s'" % filepath)
57 | var file = FileAccess.open(filepath, FileAccess.READ)
58 | var data = file.get_buffer(file.get_length())
59 | open_stream(filepath.get_extension(), data)
60 |
61 | if is_4_2_and_higher and DisplayServer.has_feature(DisplayServer.FEATURE_NATIVE_DIALOG):
62 | # TODO remove call() and get() after moving to 4.2
63 | DisplayServer.call("file_dialog_show", "Select audio file", "", "", true, DisplayServer.get("FILE_DIALOG_MODE_OPEN_FILE"), ["*.mp3"],
64 | func (status: bool, selected: PackedStringArray, _fileter: int):
65 | if status and selected.size():
66 | open_file.call(selected[0])
67 | )
68 | elif OS.has_feature('web'):
69 | JavaScriptBridge.eval("loadData()")
70 | else:
71 | var fd := FileDialog.new()
72 | add_child(fd)
73 |
74 | fd.title = "Select audio file"
75 | fd.access = FileDialog.ACCESS_FILESYSTEM
76 | fd.file_mode = FileDialog.FILE_MODE_OPEN_FILE
77 | fd.current_dir = OS.get_system_dir(OS.SYSTEM_DIR_DOWNLOADS)
78 | fd.add_filter("*.mp3")
79 | fd.popup_centered_ratio(0.8)
80 |
81 | fd.file_selected.connect(func(path: String):
82 | open_file.call(path)
83 | )
84 |
85 | fd.visibility_changed.connect(func():
86 | if not fd.visible:
87 | fd.queue_free()
88 | )
89 |
90 |
91 | func _on_data_loaded(data: Array) -> void:
92 | # Make sure there is something
93 | if (data.size() == 0):
94 | return
95 |
96 | var file_name: String = data[0]
97 | print("Opening '%s'" % file_name)
98 |
99 | var arr: PackedByteArray = JavaScriptBridge.eval("gd_callbacks.dataLoadedResult;")
100 | open_stream(file_name.get_extension(), arr)
101 |
102 |
103 | func open_stream(file_ext: String, data: PackedByteArray):
104 | var stream: AudioStream = null
105 | if file_ext == "mp3":
106 | stream = AudioStreamMP3.new()
107 | stream.data = data
108 |
109 | if not stream.data:
110 | print("Failed to load MP3!")
111 | return
112 |
113 | if not stream:
114 | print("Failed to load music!")
115 | return
116 |
117 | %MusicPlayer.stream = stream
118 | %MusicPlayer.bus = MusicAnalyzerBus
119 | %MusicPlayer.play()
120 |
121 | # Debugging frequencies
122 | for ih in range(1, bars_count + 1):
123 | var _hz: float = log_freq(ih / float(bars_count), MIN_HZ, MAX_HZ)
124 | #print("%.0f hz %.2f" % [_hz, ih / float(bars_count)])
125 |
126 |
127 | func draw_spectrum():
128 | var _s1 = DebugDraw3D.scoped_config().set_thickness(bar_thickness).set_center_brightness(0.9)
129 | var prev_hz = MIN_HZ
130 | smoothed_energy.resize(bars_count)
131 |
132 | var xf := transform
133 | var y := xf.basis.y
134 | var h := y.length()
135 | var x := xf.basis.x
136 | var z := xf.basis.z
137 | var origin := xf.origin - (x * bars_count + (x * bars_separation) * (bars_count - 1)) * 0.5
138 | var sum := 0.0
139 |
140 | for ih in range(1, bars_count + 1):
141 | var i := ih - 1
142 | var hz: float = log_freq(ih / float(bars_count), MIN_HZ, MAX_HZ)
143 | var magnitude: float = spectrum.get_magnitude_for_frequency_range(prev_hz, hz, AudioEffectSpectrumAnalyzerInstance.MAGNITUDE_AVERAGE).length()
144 | var energy: float = clampf((MIN_DB + linear_to_db(magnitude)) / MIN_DB, 0, 1)
145 | var e: float = lerp(smoothed_energy[i], energy, clampf(get_process_delta_time() / motion_smoothing if motion_smoothing else 1.0, 0, 1))
146 | smoothed_energy[i] = e
147 | var height: float = e * h
148 | sum += e
149 |
150 | var s := x * bars_separation
151 |
152 | var a := origin + x * i + s * i + (z * 0.5)
153 | var b := origin + x * (i + 1) + s * i + (z * -0.5) + xf.basis.y.normalized() * clampf(height, 0.001, h)
154 | var c := Color.HOT_PINK
155 | if colors:
156 | c = colors.sample(wrapf(float(ih) / bars_count + color_offset, 0, 1))
157 | c.s = clamp(c.s - smoothed_energy[i] * 0.3, 0, 1.0)
158 |
159 | DebugDraw3D.draw_box_ab(a, b, y, c)
160 |
161 | prev_hz = hz
162 |
163 | color_offset = wrapf(color_offset + sum / smoothed_energy.size() * clampf(get_process_delta_time() / color_offset_speed if color_offset_speed else 1.0, 0, 1), 0, 1)
164 |
165 |
166 | func log10(val: float) -> float:
167 | return log(val) / 2.302585
168 |
169 |
170 | func log_freq(pos: float, min_hz: float, max_hz: float) -> float:
171 | return pow(10, log10(min_hz) + (log10(max_hz) - log10(min_hz)) * pos)
172 |
173 |
174 | func _on_volume_slider_value_changed(value):
175 | AudioServer.set_bus_volume_db(AudioServer.get_bus_index(MasterBus), linear_to_db(value))
176 |
177 |
178 | func _on_mute_master_toggled(toggled_on):
179 | AudioServer.set_bus_mute(AudioServer.get_bus_index(MasterBus), toggled_on)
180 |
--------------------------------------------------------------------------------
/examples_dd3d/demo_settings_panel.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | extends Control
3 |
4 | @export var switch_to_scene = ""
5 | var is_ready := false
6 |
7 | func _ready():
8 | if Engine.is_editor_hint():
9 | return
10 |
11 | if ProjectSettings.has_setting("application/config/no_csharp_support"):
12 | %SwitchLang.visible = false
13 |
14 | %SwitchLang.disabled = true
15 |
16 | var test := DebugDraw2D.get_graph(&"FPS")
17 | if test:
18 | %FPSEnabled.button_pressed = test.enabled
19 | %FPSMS.button_pressed = test.frame_time_mode
20 | %WidthSlider.value = test.size.x
21 | %BufferSlider.value = test.buffer_size
22 |
23 | %ThicknessSlider.value = get_parent().debug_thickness
24 | %FrustumScaleSlider.value = get_parent().camera_frustum_scale
25 | %UpdateInPhysics.text = "Update in physics (%d Ticks) *" % ProjectSettings.get_setting("physics/common/physics_ticks_per_second")
26 | %UpdateInPhysics.button_pressed = get_parent().update_in_physics
27 |
28 | %ShowStats.button_pressed = get_parent().text_groups_show_stats
29 | %DrawBoxes.button_pressed = get_parent().draw_array_of_boxes
30 | %Draw1MBoxes.button_pressed = get_parent().draw_1m_boxes
31 |
32 | if get_tree():
33 | await get_tree().create_timer(0.2).timeout
34 |
35 | %SwitchLang.disabled = false
36 | is_ready = true
37 |
38 |
39 | func _on_CheckBox_toggled(button_pressed: bool) -> void:
40 | if not is_ready: return
41 |
42 | var cfg = DebugDraw2D.get_graph(&"FPS")
43 | if cfg:
44 | cfg.enabled = button_pressed
45 |
46 |
47 | func _on_FPSMS_toggled(button_pressed: bool) -> void:
48 | if not is_ready: return
49 |
50 | var cfg = DebugDraw2D.get_graph(&"FPS")
51 | if cfg:
52 | cfg.frame_time_mode = button_pressed
53 |
54 |
55 | func _on_Button_pressed() -> void:
56 | get_tree().call_deferred("change_scene_to_file", switch_to_scene)
57 |
58 |
59 | func _on_hide_show_panel_pressed():
60 | if %SettingsPanel.visible:
61 | %SettingsPanel.hide()
62 | %HideShowPanelButton.text = "Show panel"
63 | else:
64 | %SettingsPanel.show()
65 | %HideShowPanelButton.text = "Hide panel"
66 |
67 |
68 | func _on_width_slider_value_changed(value):
69 | if not is_ready: return
70 |
71 | get_parent().graph_size = Vector2i(int(value), get_parent().graph_size.y)
72 |
73 |
74 | func _on_buffer_slider_value_changed(value):
75 | if not is_ready: return
76 |
77 | get_parent().graph_buffer_size = int(value)
78 |
79 |
80 | func _on_thickness_slider_value_changed(value):
81 | if not is_ready: return
82 |
83 | get_parent().debug_thickness = value
84 |
85 |
86 | func _on_frustum_scale_slider_value_changed(value):
87 | if not is_ready: return
88 |
89 | get_parent().camera_frustum_scale = value
90 |
91 |
92 | func _on_update_in_physics_toggled(toggled_on):
93 | get_parent().update_in_physics = toggled_on
94 |
95 |
96 | func _on_show_stats_toggled(toggled_on):
97 | get_parent().text_groups_show_stats = toggled_on
98 |
99 |
100 | func _on_draw_boxes_toggled(toggled_on):
101 | get_parent().draw_array_of_boxes = toggled_on
102 |
103 | DebugDraw3D.clear_all()
104 | get_parent().timer_cubes = 0
105 |
106 |
107 | func _on_draw_1m_boxes_toggled(toggled_on):
108 | get_parent().draw_1m_boxes = toggled_on
109 |
110 | if get_parent().draw_array_of_boxes:
111 | DebugDraw3D.clear_all()
112 | get_parent().timer_cubes = 0
113 |
--------------------------------------------------------------------------------
/examples_dd3d/demo_web_docs_version_select.gd:
--------------------------------------------------------------------------------
1 | extends HBoxContainer
2 |
3 | var _on_versions_loaded_callback = null
4 | @onready var btn: OptionButton = $OptionButton
5 |
6 | func _enter_tree():
7 | hide()
8 |
9 |
10 | func _ready():
11 | if OS.has_feature('web'):
12 | _on_versions_loaded_callback = JavaScriptBridge.create_callback(_on_versions_loaded)
13 | var versions_callbacks: JavaScriptObject = JavaScriptBridge.get_interface("versions_callbacks")
14 | versions_callbacks.loaded = _on_versions_loaded_callback
15 |
16 | JavaScriptBridge.eval("loadVersions()")
17 |
18 |
19 | func _on_versions_loaded(args: Array) -> void:
20 | if (args.size() == 0):
21 | return
22 |
23 | var current_version: String = args[0]
24 |
25 | var versions_str: String = JavaScriptBridge.eval("versions_callbacks.versions;")
26 | var version_urls_str: String = JavaScriptBridge.eval("versions_callbacks.version_urls;")
27 | var versions: PackedStringArray = versions_str.split(";", false)
28 | var version_urls: PackedStringArray = version_urls_str.split(";", false)
29 |
30 | if versions:
31 | show()
32 | btn.clear()
33 | btn.item_selected.connect(func(idx):
34 | # move to another version
35 | JavaScriptBridge.eval("window.location.href = \"%s\"" % version_urls[idx])
36 | )
37 |
38 | for i in range(versions.size()):
39 | btn.add_item(versions[i], i)
40 |
41 | if versions[i] == current_version:
42 | btn.select(i)
43 |
--------------------------------------------------------------------------------
/export_presets.cfg:
--------------------------------------------------------------------------------
1 | [preset.0]
2 |
3 | name="Windows Desktop"
4 | platform="Windows Desktop"
5 | runnable=true
6 | dedicated_server=false
7 | custom_features=""
8 | export_filter="all_resources"
9 | include_filter=""
10 | exclude_filter=""
11 | export_path="./AMSG.exe"
12 | encryption_include_filters=""
13 | encryption_exclude_filters=""
14 | encrypt_pck=false
15 | encrypt_directory=false
16 |
17 | [preset.0.options]
18 |
19 | custom_template/debug=""
20 | custom_template/release=""
21 | debug/export_console_wrapper=0
22 | binary_format/embed_pck=true
23 | texture_format/bptc=false
24 | texture_format/s3tc=true
25 | texture_format/etc=false
26 | texture_format/etc2=false
27 | binary_format/architecture="x86_64"
28 | codesign/enable=false
29 | codesign/timestamp=true
30 | codesign/timestamp_server_url=""
31 | codesign/digest_algorithm=1
32 | codesign/description=""
33 | codesign/custom_options=PackedStringArray()
34 | application/modify_resources=false
35 | application/icon=""
36 | application/console_wrapper_icon=""
37 | application/icon_interpolation=4
38 | application/file_version=""
39 | application/product_version=""
40 | application/company_name=""
41 | application/product_name=""
42 | application/file_description=""
43 | application/copyright=""
44 | application/trademarks=""
45 | application/export_angle=0
46 | ssh_remote_deploy/enabled=false
47 | ssh_remote_deploy/host="user@host_ip"
48 | ssh_remote_deploy/port="22"
49 | ssh_remote_deploy/extra_args_ssh=""
50 | ssh_remote_deploy/extra_args_scp=""
51 | ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
52 | $action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
53 | $trigger = New-ScheduledTaskTrigger -Once -At 00:00
54 | $settings = New-ScheduledTaskSettingsSet
55 | $task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
56 | Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
57 | Start-ScheduledTask -TaskName godot_remote_debug
58 | while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
59 | Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
60 | ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
61 | Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
62 | Remove-Item -Recurse -Force '{temp_dir}'"
63 | debug/export_console_script=1
64 |
65 | [preset.1]
66 |
67 | name="Linux/X11"
68 | platform="Linux/X11"
69 | runnable=true
70 | dedicated_server=false
71 | custom_features=""
72 | export_filter="all_resources"
73 | include_filter=""
74 | exclude_filter=""
75 | export_path="./AMSG.x86_64"
76 | encryption_include_filters=""
77 | encryption_exclude_filters=""
78 | encrypt_pck=false
79 | encrypt_directory=false
80 |
81 | [preset.1.options]
82 |
83 | custom_template/debug=""
84 | custom_template/release=""
85 | debug/export_console_wrapper=1
86 | binary_format/embed_pck=true
87 | texture_format/bptc=false
88 | texture_format/s3tc=true
89 | texture_format/etc=false
90 | texture_format/etc2=false
91 | binary_format/architecture="x86_64"
92 | ssh_remote_deploy/enabled=false
93 | ssh_remote_deploy/host="user@host_ip"
94 | ssh_remote_deploy/port="22"
95 | ssh_remote_deploy/extra_args_ssh=""
96 | ssh_remote_deploy/extra_args_scp=""
97 | ssh_remote_deploy/run_script="#!/usr/bin/env bash
98 | export DISPLAY=:0
99 | unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
100 | \"{temp_dir}/{exe_name}\" {cmd_args}"
101 | ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
102 | kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
103 | rm -rf \"{temp_dir}\""
104 | debug/export_console_script=1
105 |
106 | [preset.2]
107 |
108 | name="macOS"
109 | platform="macOS"
110 | runnable=true
111 | dedicated_server=false
112 | custom_features=""
113 | export_filter="all_resources"
114 | include_filter=""
115 | exclude_filter=""
116 | export_path="./AMSG.app"
117 | encryption_include_filters=""
118 | encryption_exclude_filters=""
119 | encrypt_pck=false
120 | encrypt_directory=false
121 |
122 | [preset.2.options]
123 |
124 | export/distribution_type=1
125 | binary_format/architecture="universal"
126 | custom_template/debug=""
127 | custom_template/release=""
128 | debug/export_console_wrapper=1
129 | application/icon=""
130 | application/icon_interpolation=4
131 | application/bundle_identifier=""
132 | application/signature=""
133 | application/app_category="Games"
134 | application/short_version="1.0"
135 | application/version="1.0"
136 | application/copyright=""
137 | application/copyright_localized={}
138 | application/min_macos_version="10.12"
139 | application/export_angle=0
140 | display/high_res=true
141 | xcode/platform_build="14C18"
142 | xcode/sdk_version="13.1"
143 | xcode/sdk_build="22C55"
144 | xcode/sdk_name="macosx13.1"
145 | xcode/xcode_version="1420"
146 | xcode/xcode_build="14C18"
147 | codesign/codesign=1
148 | codesign/installer_identity=""
149 | codesign/apple_team_id=""
150 | codesign/identity=""
151 | codesign/entitlements/custom_file=""
152 | codesign/entitlements/allow_jit_code_execution=false
153 | codesign/entitlements/allow_unsigned_executable_memory=false
154 | codesign/entitlements/allow_dyld_environment_variables=false
155 | codesign/entitlements/disable_library_validation=false
156 | codesign/entitlements/audio_input=false
157 | codesign/entitlements/camera=false
158 | codesign/entitlements/location=false
159 | codesign/entitlements/address_book=false
160 | codesign/entitlements/calendars=false
161 | codesign/entitlements/photos_library=false
162 | codesign/entitlements/apple_events=false
163 | codesign/entitlements/debugging=false
164 | codesign/entitlements/app_sandbox/enabled=false
165 | codesign/entitlements/app_sandbox/network_server=false
166 | codesign/entitlements/app_sandbox/network_client=false
167 | codesign/entitlements/app_sandbox/device_usb=false
168 | codesign/entitlements/app_sandbox/device_bluetooth=false
169 | codesign/entitlements/app_sandbox/files_downloads=0
170 | codesign/entitlements/app_sandbox/files_pictures=0
171 | codesign/entitlements/app_sandbox/files_music=0
172 | codesign/entitlements/app_sandbox/files_movies=0
173 | codesign/entitlements/app_sandbox/files_user_selected=0
174 | codesign/entitlements/app_sandbox/helper_executables=[]
175 | codesign/custom_options=PackedStringArray()
176 | notarization/notarization=0
177 | privacy/microphone_usage_description=""
178 | privacy/microphone_usage_description_localized={}
179 | privacy/camera_usage_description=""
180 | privacy/camera_usage_description_localized={}
181 | privacy/location_usage_description=""
182 | privacy/location_usage_description_localized={}
183 | privacy/address_book_usage_description=""
184 | privacy/address_book_usage_description_localized={}
185 | privacy/calendar_usage_description=""
186 | privacy/calendar_usage_description_localized={}
187 | privacy/photos_library_usage_description=""
188 | privacy/photos_library_usage_description_localized={}
189 | privacy/desktop_folder_usage_description=""
190 | privacy/desktop_folder_usage_description_localized={}
191 | privacy/documents_folder_usage_description=""
192 | privacy/documents_folder_usage_description_localized={}
193 | privacy/downloads_folder_usage_description=""
194 | privacy/downloads_folder_usage_description_localized={}
195 | privacy/network_volumes_usage_description=""
196 | privacy/network_volumes_usage_description_localized={}
197 | privacy/removable_volumes_usage_description=""
198 | privacy/removable_volumes_usage_description_localized={}
199 | ssh_remote_deploy/enabled=false
200 | ssh_remote_deploy/host="user@host_ip"
201 | ssh_remote_deploy/port="22"
202 | ssh_remote_deploy/extra_args_ssh=""
203 | ssh_remote_deploy/extra_args_scp=""
204 | ssh_remote_deploy/run_script="#!/usr/bin/env bash
205 | unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
206 | open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}"
207 | ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
208 | kill $(pgrep -x -f \"{temp_dir}/{exe_name}.app/Contents/MacOS/{exe_name} {cmd_args}\")
209 | rm -rf \"{temp_dir}\""
210 | debug/export_console_script=1
211 | notarization/apple_team_id=""
212 |
--------------------------------------------------------------------------------
/project.godot:
--------------------------------------------------------------------------------
1 | ; Engine configuration file.
2 | ; It's best edited using the editor UI and not directly,
3 | ; since the parameters that go here are not all obvious.
4 | ;
5 | ; Format:
6 | ; [section] ; section goes between []
7 | ; param=value ; assign values to parameters
8 |
9 | config_version=5
10 |
11 | [application]
12 |
13 | config/name="AMSG"
14 | run/main_scene="res://AMSG_Examples/Maps/MovementTestMap.tscn"
15 | config/features=PackedStringArray("4.3")
16 | config/icon="res://AMSG_Examples/icon.png"
17 |
18 | [autoload]
19 |
20 | Global="*res://addons/AMSG/Global.gd"
21 |
22 | [display]
23 |
24 | window/size/viewport_width=1920
25 | window/size/viewport_height=1080
26 | window/vsync/vsync_mode=0
27 | window/size/width=1920
28 | window/size/height=1080
29 |
30 | [dotnet]
31 |
32 | project/assembly_name="AMSG"
33 |
34 | [editor_plugins]
35 |
36 | enabled=PackedStringArray("res://addons/AMSG/plugin.cfg", "res://addons/PoseWarping/plugin.cfg")
37 |
38 | [filesystem]
39 |
40 | import/blender/enabled=false
41 | import/fbx/enabled=false
42 |
43 | [gdnative]
44 |
45 | singletons=[]
46 | singletons_disabled=[]
47 |
48 | [input]
49 |
50 | forward={
51 | "deadzone": 0.5,
52 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":87,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
53 | ]
54 | }
55 | back={
56 | "deadzone": 0.5,
57 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":83,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
58 | ]
59 | }
60 | left={
61 | "deadzone": 0.5,
62 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
63 | ]
64 | }
65 | right={
66 | "deadzone": 0.5,
67 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":68,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
68 | ]
69 | }
70 | jump={
71 | "deadzone": 0.5,
72 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
73 | ]
74 | }
75 | sprint={
76 | "deadzone": 0.5,
77 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
78 | ]
79 | }
80 | aim={
81 | "deadzone": 0.5,
82 | "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":2,"canceled":false,"pressed":false,"double_click":false,"script":null)
83 | ]
84 | }
85 | crouch={
86 | "deadzone": 0.5,
87 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194326,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
88 | ]
89 | }
90 | interaction={
91 | "deadzone": 0.5,
92 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":70,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
93 | ]
94 | }
95 | switch_camera_view={
96 | "deadzone": 0.5,
97 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":67,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
98 | ]
99 | }
100 | ragdoll={
101 | "deadzone": 0.5,
102 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":88,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
103 | ]
104 | }
105 | flashlight={
106 | "deadzone": 0.5,
107 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":76,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
108 | ]
109 | }
110 | EnableSDFGI={
111 | "deadzone": 0.5,
112 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":71,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
113 | ]
114 | }
115 | fire={
116 | "deadzone": 0.5,
117 | "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null)
118 | ]
119 | }
120 | exit={
121 | "deadzone": 0.5,
122 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
123 | ]
124 | }
125 | pause={
126 | "deadzone": 0.5,
127 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":80,"physical_keycode":0,"key_label":0,"unicode":112,"location":0,"echo":false,"script":null)
128 | ]
129 | }
130 | show_panel={
131 | "deadzone": 0.5,
132 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":78,"key_label":0,"unicode":110,"location":0,"echo":false,"script":null)
133 | ]
134 | }
135 | show_debug={
136 | "deadzone": 0.5,
137 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":73,"key_label":0,"unicode":105,"location":0,"echo":false,"script":null)
138 | ]
139 | }
140 | switch_distance_matching={
141 | "deadzone": 0.5,
142 | "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":75,"key_label":0,"unicode":107,"location":0,"echo":false,"script":null)
143 | ]
144 | }
145 |
146 | [rendering]
147 |
148 | scaling_3d/mode=1
149 | scaling_3d/fsr_sharpness=2.0
150 | anti_aliasing/quality/use_taa=true
151 | occlusion_culling/use_occlusion_culling=true
152 |
--------------------------------------------------------------------------------