diff --git a/autoloads/game.tscn b/autoloads/game.tscn index 572d21984..75042891d 100644 --- a/autoloads/game.tscn +++ b/autoloads/game.tscn @@ -2,6 +2,7 @@ [ext_resource type="Script" uid="uid://c8lsyb801m532" path="res://autoloads/game.gd" id="1_fmbhi"] [ext_resource type="Script" uid="uid://bnqpng0o60r43" path="res://scripts/player_data_resource.gd" id="2_xaonh"] +[ext_resource type="PackedScene" uid="uid://cft5q85xb0epd" path="res://test/test_scene.tscn" id="3_du0e2"] [sub_resource type="Resource" id="Resource_nviqh"] script = ExtResource("2_xaonh") @@ -13,15 +14,12 @@ script = ExtResource("2_xaonh") name = "client" role = 2 -[sub_resource type="Resource" id="Resource_a7hko"] -script = ExtResource("2_xaonh") -name = "client 2" -role = 3 - [node name="Game" type="Node" unique_id=369504755] script = ExtResource("1_fmbhi") +multiplayer_test = true all_roles = false -test_players = Array[ExtResource("2_xaonh")]([SubResource("Resource_nviqh"), SubResource("Resource_ckjww"), SubResource("Resource_a7hko")]) +test_players = Array[ExtResource("2_xaonh")]([SubResource("Resource_nviqh"), SubResource("Resource_ckjww")]) +main_scene = ExtResource("3_du0e2") [node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1737081465] layer = 127 diff --git a/models/UAL1_Standard_RM.glb b/models/UAL1_Standard_RM.glb new file mode 100644 index 000000000..b30639bfe Binary files /dev/null and b/models/UAL1_Standard_RM.glb differ diff --git a/models/UAL1_Standard_RM.glb.import b/models/UAL1_Standard_RM.glb.import new file mode 100644 index 000000000..bec391cf8 --- /dev/null +++ b/models/UAL1_Standard_RM.glb.import @@ -0,0 +1,45 @@ +[remap] + +importer="animation_library" +importer_version=1 +type="AnimationLibrary" +uid="uid://dv6ihghkpl00x" +path="res://.godot/imported/UAL1_Standard_RM.glb-6002962127812556a639b31dd396cccd.res" + +[deps] + +source_file="res://models/UAL1_Standard_RM.glb" +dest_files=["res://.godot/imported/UAL1_Standard_RM.glb-6002962127812556a639b31dd396cccd.res"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/root_script=null +mesh_library/use_node_names_as_mesh_names=false +array_mesh/deduplicate_surfaces=true +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_name_suffixes=true +nodes/use_node_type_suffixes=true +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +materials/extract=0 +materials/extract_format=0 +materials/extract_path="" +_subresources={} +gltf/naming_version=2 +gltf/embedded_image_handling=1 +gltf/texture_map_mode=1 diff --git a/models/UAL2_Standard.glb b/models/UAL2_Standard.glb new file mode 100644 index 000000000..9a30163d9 Binary files /dev/null and b/models/UAL2_Standard.glb differ diff --git a/models/UAL2_Standard.glb.import b/models/UAL2_Standard.glb.import new file mode 100644 index 000000000..b1e0f5143 --- /dev/null +++ b/models/UAL2_Standard.glb.import @@ -0,0 +1,45 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://d2ei87j7hxl13" +path="res://.godot/imported/UAL2_Standard.glb-7a1ba7d724c90db7966583df6bdf1a4f.scn" + +[deps] + +source_file="res://models/UAL2_Standard.glb" +dest_files=["res://.godot/imported/UAL2_Standard.glb-7a1ba7d724c90db7966583df6bdf1a4f.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/root_script=null +mesh_library/use_node_names_as_mesh_names=false +array_mesh/deduplicate_surfaces=true +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_name_suffixes=true +nodes/use_node_type_suffixes=true +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +materials/extract=0 +materials/extract_format=0 +materials/extract_path="" +_subresources={} +gltf/naming_version=2 +gltf/embedded_image_handling=1 +gltf/texture_map_mode=1 diff --git a/models/ucursitos2.glb b/models/ucursitos2.glb new file mode 100644 index 000000000..16bf032ed Binary files /dev/null and b/models/ucursitos2.glb differ diff --git a/models/ucursitos2.glb.import b/models/ucursitos2.glb.import new file mode 100644 index 000000000..1d8e20f95 --- /dev/null +++ b/models/ucursitos2.glb.import @@ -0,0 +1,45 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://db2nfpnpattpy" +path="res://.godot/imported/ucursitos2.glb-22f429e02a6317d65e475fb7b4e041ca.scn" + +[deps] + +source_file="res://models/ucursitos2.glb" +dest_files=["res://.godot/imported/ucursitos2.glb-22f429e02a6317d65e475fb7b4e041ca.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/root_script=null +mesh_library/use_node_names_as_mesh_names=false +array_mesh/deduplicate_surfaces=true +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_name_suffixes=true +nodes/use_node_type_suffixes=true +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +materials/extract=0 +materials/extract_format=0 +materials/extract_path="" +_subresources={} +gltf/naming_version=2 +gltf/embedded_image_handling=1 +gltf/texture_map_mode=1 diff --git a/models/ucursitos2_ucursitos_atlas.png b/models/ucursitos2_ucursitos_atlas.png new file mode 100644 index 000000000..d1e0f8a8c Binary files /dev/null and b/models/ucursitos2_ucursitos_atlas.png differ diff --git a/models/ucursitos2_ucursitos_atlas.png.import b/models/ucursitos2_ucursitos_atlas.png.import new file mode 100644 index 000000000..375fc0399 --- /dev/null +++ b/models/ucursitos2_ucursitos_atlas.png.import @@ -0,0 +1,44 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cs8464c0qb6bg" +path.s3tc="res://.godot/imported/ucursitos2_ucursitos_atlas.png-f9e02343cd8dc0503194f76e1219a02c.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "029e8d13ba62c057a132ee4e91ecb991" +} + +[deps] + +source_file="res://models/ucursitos2_ucursitos_atlas.png" +dest_files=["res://.godot/imported/ucursitos2_ucursitos_atlas.png-f9e02343cd8dc0503194f76e1219a02c.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/player/player.gd b/player/player.gd new file mode 100644 index 000000000..8365084fb --- /dev/null +++ b/player/player.gd @@ -0,0 +1,524 @@ +class_name Player +extends CharacterBody3D + + +# ============================================================ +# Movement +# ============================================================ + +@export var move_speed: float = 14.0 +@export var jump_speed: float = 15.0 +@export var acceleration: float = 300.0 + +@export var gravity_multiplier: float = 3.0 +@export var fall_gravity_multiplier: float = 4.5 + + +# ============================================================ +# Camera +# ============================================================ + +@export var mouse_sensitivity: float = 0.003 + +@export var min_pitch: float = -80.0 +@export var max_pitch: float = 80.0 + +# Higher = camera recenters faster after releasing Alt. +@export var free_look_recenter_speed: float = 8.0 + + +# ============================================================ +# Nodes +# ============================================================ + +@onready var camera_pivot: Node3D = $CameraPivot + +@onready var camera_3d: Camera3D = \ + $CameraPivot/SpringArm3D/Camera3D + +@onready var label_3d: Label3D = $Label3D + +@onready var anim_player: AnimationPlayer = \ + $UAL2_Standard/AnimationPlayer2 + + +# ============================================================ +# Animations +# ============================================================ + +const ANIM_IDLE: StringName = \ + &"UAL1_Standard_RM/Idle" + +const ANIM_SPRINT: StringName = \ + &"UAL1_Standard_RM/Sprint" + +const ANIM_JUMP_START: StringName = \ + &"UAL1_Standard_RM/Jump_Start" + +const ANIM_JUMP_LOOP: StringName = \ + &"UAL1_Standard_RM/Jump_Loop" + +const ANIM_JUMP_LAND: StringName = \ + &"UAL1_Standard_RM/Jump_Land" + + +const LAND_ANIMATION_SPEED: float = 2.0 + + +# ============================================================ +# Camera state +# ============================================================ + +# Normal third-person vertical camera angle. +var base_camera_pitch: float = 0.0 + +# Temporary offsets produced while Alt is held. +var free_look_yaw: float = 0.0 +var free_look_pitch: float = 0.0 + +# Preserve whatever rotation CameraPivot already has +# in the editor. +var camera_center_yaw: float = 0.0 +var camera_center_roll: float = 0.0 + + +# ============================================================ +# Initialization +# ============================================================ + +func _ready() -> void: + base_camera_pitch = camera_pivot.rotation.x + camera_center_yaw = camera_pivot.rotation.y + camera_center_roll = camera_pivot.rotation.z + + _apply_camera_rotation() + + +func setup(player_data: Statics.PlayerData) -> void: + label_3d.text = player_data.name + + set_multiplayer_authority(player_data.id) + + camera_3d.current = is_multiplayer_authority() + + if is_multiplayer_authority(): + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + + +# ============================================================ +# Input +# ============================================================ + +func _input(event: InputEvent) -> void: + if not is_multiplayer_authority(): + return + + if event.is_action_pressed("test"): + test.rpc() + + + # -------------------------------------------------------- + # Mouse movement + # -------------------------------------------------------- + + if event is InputEventMouseMotion: + var mouse_yaw: float = ( + -event.relative.x + * mouse_sensitivity + ) + + var mouse_pitch: float = ( + -event.relative.y + * mouse_sensitivity + ) + + + # No Input Map action required. + var free_look_active: bool = \ + Input.is_key_pressed(KEY_ALT) + + + if free_look_active: + + # ================================================= + # ALT HELD + # + # Orbit camera around character. + # Character does not rotate. + # ================================================= + + free_look_yaw += mouse_yaw + + free_look_yaw = wrapf( + free_look_yaw, + -PI, + PI + ) + + + var desired_pitch: float = ( + base_camera_pitch + + free_look_pitch + + mouse_pitch + ) + + desired_pitch = clamp( + desired_pitch, + deg_to_rad(min_pitch), + deg_to_rad(max_pitch) + ) + + free_look_pitch = ( + desired_pitch + - base_camera_pitch + ) + + + else: + + # ================================================= + # NORMAL THIRD-PERSON CAMERA + # + # Horizontal mouse turns character. + # Vertical mouse changes camera pitch. + # ================================================= + + rotate_y(mouse_yaw) + + base_camera_pitch += mouse_pitch + + base_camera_pitch = clamp( + base_camera_pitch, + deg_to_rad(min_pitch), + deg_to_rad(max_pitch) + ) + + + _apply_camera_rotation() + + +# ============================================================ +# Camera recenter +# ============================================================ + +func _process(delta: float) -> void: + if not is_multiplayer_authority(): + return + + + # While Alt is held, do not recenter anything. + if Input.is_key_pressed(KEY_ALT): + return + + + # Frame-rate-independent smoothing. + var weight: float = ( + 1.0 + - exp( + -free_look_recenter_speed + * delta + ) + ) + + + # -------------------------------------------------------- + # Horizontal recenter + # -------------------------------------------------------- + + free_look_yaw = lerp_angle( + free_look_yaw, + 0.0, + weight + ) + + + # -------------------------------------------------------- + # Vertical recenter + # -------------------------------------------------------- + + free_look_pitch = lerp( + free_look_pitch, + 0.0, + weight + ) + + + # Remove tiny floating-point leftovers. + + if abs(free_look_yaw) < 0.0001: + free_look_yaw = 0.0 + + if abs(free_look_pitch) < 0.0001: + free_look_pitch = 0.0 + + + _apply_camera_rotation() + + +func _apply_camera_rotation() -> void: + camera_pivot.rotation = Vector3( + base_camera_pitch + free_look_pitch, + camera_center_yaw + free_look_yaw, + camera_center_roll + ) + + +# ============================================================ +# Physics +# ============================================================ + +func _physics_process(delta: float) -> void: + if not is_multiplayer_authority(): + return + + + var was_on_floor: bool = is_on_floor() + var just_jumped: bool = false + + + # -------------------------------------------------------- + # Gravity + # -------------------------------------------------------- + + if not is_on_floor(): + + if velocity.y < 0.0: + velocity += ( + get_gravity() + * fall_gravity_multiplier + * delta + ) + + else: + velocity += ( + get_gravity() + * gravity_multiplier + * delta + ) + + + # -------------------------------------------------------- + # Jump + # -------------------------------------------------------- + + if ( + is_on_floor() + and Input.is_action_just_pressed("jump") + ): + velocity.y = jump_speed + just_jumped = true + + + # -------------------------------------------------------- + # Movement + # -------------------------------------------------------- + + var move_input: Vector2 = Input.get_vector( + "move_left", + "move_right", + "move_forward", + "move_backward" + ) + + + # Important: + # movement follows CHARACTER orientation even while + # Alt free-look is active. + # + # This means you can look behind yourself while continuing + # to run forward. + var direction: Vector3 = ( + transform.basis + * Vector3( + move_input.x, + 0.0, + move_input.y + ) + ) + + + var target: Vector2 = Vector2( + direction.x, + direction.z + ) * move_speed + + + var current: Vector2 = Vector2( + velocity.x, + velocity.z + ) + + + var result: Vector2 = current.move_toward( + target, + acceleration * delta + ) + + + velocity.x = result.x + velocity.z = result.y + + + # -------------------------------------------------------- + # Move + # -------------------------------------------------------- + + move_and_slide() + + + # -------------------------------------------------------- + # Landing detection + # -------------------------------------------------------- + + var just_landed: bool = ( + not was_on_floor + and is_on_floor() + ) + + + # -------------------------------------------------------- + # Animation + # -------------------------------------------------------- + + _update_animation( + move_input, + just_jumped, + just_landed + ) + + + # -------------------------------------------------------- + # Multiplayer + # -------------------------------------------------------- + + send_data.rpc( + global_position, + global_rotation + ) + + +# ============================================================ +# Animation state +# ============================================================ + +func _update_animation( + move_input: Vector2, + just_jumped: bool, + just_landed: bool +) -> void: + + var moving: bool = ( + move_input.length_squared() > 0.01 + ) + + + # -------------------------------------------------------- + # Landing + # -------------------------------------------------------- + + if just_landed: + + # Movement immediately cancels the landing animation. + if moving: + play_anim(ANIM_SPRINT) + + else: + play_anim( + ANIM_JUMP_LAND, + LAND_ANIMATION_SPEED + ) + + return + + + # -------------------------------------------------------- + # Jump start + # -------------------------------------------------------- + + if just_jumped: + play_anim(ANIM_JUMP_START) + return + + + # -------------------------------------------------------- + # Airborne + # -------------------------------------------------------- + + if not is_on_floor(): + + # Allow Jump_Start to finish first. + if ( + anim_player.current_animation + == ANIM_JUMP_START + and anim_player.is_playing() + ): + return + + play_anim(ANIM_JUMP_LOOP) + return + + + # -------------------------------------------------------- + # Ground movement + # -------------------------------------------------------- + + if moving: + play_anim(ANIM_SPRINT) + return + + + # -------------------------------------------------------- + # Finish landing only while stationary + # -------------------------------------------------------- + + if ( + anim_player.current_animation + == ANIM_JUMP_LAND + and anim_player.is_playing() + ): + return + + + # -------------------------------------------------------- + # Idle + # -------------------------------------------------------- + + play_anim(ANIM_IDLE) + + +func play_anim( + animation: StringName, + speed: float = 1.0 +) -> void: + + if anim_player.current_animation == animation: + return + + anim_player.play( + animation, + -1.0, + speed + ) + + +# ============================================================ +# RPCs +# ============================================================ + +@rpc("any_peer") +func test() -> void: + Debug.log(name, 10) + + +@rpc( + "authority", + "call_remote", + "unreliable_ordered" +) +func send_data( + pos: Vector3, + rot: Vector3 +) -> void: + + global_position = pos + global_rotation = rot diff --git a/player/player.gd.uid b/player/player.gd.uid new file mode 100644 index 000000000..6ce6371c7 --- /dev/null +++ b/player/player.gd.uid @@ -0,0 +1 @@ +uid://cylsxg1c16hsk diff --git a/project.godot b/project.godot index df69d35fd..94e38f3f2 100644 --- a/project.godot +++ b/project.godot @@ -45,6 +45,36 @@ test={ "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":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null) ] } +move_left={ +"deadzone": 0.2, +"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":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) +] +} +move_right={ +"deadzone": 0.2, +"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":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null) +] +} +move_forward={ +"deadzone": 0.2, +"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":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) +] +} +move_backward={ +"deadzone": 0.2, +"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":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null) +] +} +jump={ +"deadzone": 0.2, +"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":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null) +] +} +free_look={ +"deadzone": 0.2, +"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":4194328,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +] +} [rendering] diff --git a/scripts/statics.gd b/scripts/statics.gd index 265be3f52..6b19b6a31 100644 --- a/scripts/statics.gd +++ b/scripts/statics.gd @@ -8,9 +8,9 @@ const PORT: int = 5409 # Number between 1024 and 65535. enum Role { NONE, - ROLE_A, - ROLE_B, - ROLE_C, + gancho, + rapido, + doble_vida, } @@ -18,12 +18,12 @@ static func get_role_name(role: Role) -> String: match role: Role.NONE: return "None" - Role.ROLE_A: - return "Role A" - Role.ROLE_B: - return "Role B" - Role.ROLE_C: - return "Role C" + Role.gancho: + return "gancho" + Role.rapido: + return "rapido" + Role.doble_vida: + return "doble vida" return "Unknown" diff --git a/test/main.gd b/test/main.gd new file mode 100644 index 000000000..412e9716a --- /dev/null +++ b/test/main.gd @@ -0,0 +1,16 @@ +extends Node3D + +@export var player_scene: PackedScene +@onready var spawn_points: Node3D = $SpawnPoints +@onready var players: Node3D = $Players + + +func _ready() -> void: + for i: int in Game.instance.players.size(): + var player_data: Statics.PlayerData = Game.instance.players[i] + var player_inst: Player = player_scene.instantiate() + player_inst.name = str(player_data.id) + players.add_child(player_inst) + player_inst.setup(player_data) + var spawn_point: Node3D = spawn_points.get_child(i) + player_inst.global_position = spawn_point.global_position diff --git a/test/main.gd.uid b/test/main.gd.uid new file mode 100644 index 000000000..a85b3a35f --- /dev/null +++ b/test/main.gd.uid @@ -0,0 +1 @@ +uid://begp0osvkrkj6 diff --git a/test/player.tscn b/test/player.tscn new file mode 100644 index 000000000..3ca16b7b4 --- /dev/null +++ b/test/player.tscn @@ -0,0 +1,97 @@ +[gd_scene format=3 uid="uid://dmxaoy1chryah"] + +[ext_resource type="Script" uid="uid://cylsxg1c16hsk" path="res://player/player.gd" id="1_s3mhm"] +[ext_resource type="PackedScene" uid="uid://db2nfpnpattpy" path="res://models/ucursitos2.glb" id="2_qqgw4"] +[ext_resource type="AnimationLibrary" uid="uid://dv6ihghkpl00x" path="res://models/UAL1_Standard_RM.glb" id="3_jp3oe"] +[ext_resource type="PackedScene" uid="uid://d2ei87j7hxl13" path="res://models/UAL2_Standard.glb" id="3_wvbbu"] + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_hldr7"] + +[node name="Player" type="CharacterBody3D" unique_id=1817994250] +script = ExtResource("1_s3mhm") + +[node name="CameraPivot" type="Node3D" parent="." unique_id=165174125] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6179214, 0) + +[node name="SpringArm3D" type="SpringArm3D" parent="CameraPivot" unique_id=1192432023] +spring_length = 4.0 + +[node name="Camera3D" type="Camera3D" parent="CameraPivot/SpringArm3D" unique_id=817527026] +transform = Transform3D(1, 0, 0, 0, 0.97037435, 0.2416063, 0, -0.2416063, 0.97037435, 0, 0.2677858, 3.3990493) + +[node name="UAL2_Standard" parent="." unique_id=190529878 instance=ExtResource("2_qqgw4")] +transform = Transform3D(-0.9978922, 0, -0.06489456, 0, 1, 0, 0.06489456, 0, -0.9978922, 0, 0, 0) + +[node name="Skeleton3D" parent="UAL2_Standard/Armature" parent_id_path=PackedInt32Array(190529878, 85218198) index="0" unique_id=2121876374] +bones/1/position = Vector3(1.71485e-09, 0.7504685, -0.05010005) +bones/1/rotation = Quaternion(0.06062676, 1.617594e-08, 3.0576535e-09, 0.99816054) +bones/3/rotation = Quaternion(-0.05546876, -9.439549e-08, -9.996726e-09, 0.9984604) +bones/4/rotation = Quaternion(-0.0002686717, 6.430246e-10, -2.3181006e-11, 1) +bones/5/rotation = Quaternion(0.11098603, -2.1001588e-08, 7.306832e-09, 0.993822) +bones/6/rotation = Quaternion(-0.090109654, 1.0923648e-08, -5.0165774e-09, 0.9959319) +bones/7/rotation = Quaternion(-0.5229935, -0.46414614, -0.4913467, 0.519254) +bones/8/rotation = Quaternion(0.03291896, 0.70969653, -0.009971094, 0.70366734) +bones/9/rotation = Quaternion(0.021421907, -2.0525958e-05, 6.2292145e-07, 0.9997705) +bones/10/rotation = Quaternion(-0.008619731, 4.3777774e-08, 4.5637015e-07, 0.99996287) +bones/11/rotation = Quaternion(2.9802317e-07, 0.7071092, -1.4901156e-07, 0.7071043) +bones/12/rotation = Quaternion(9.97789e-13, -1.7193783e-07, -1.5153549e-07, 1) +bones/13/rotation = Quaternion(-1.6051569e-12, -1.2551448e-13, 2.4752723e-07, 1) +bones/15/rotation = Quaternion(-0.016702179, 0.7069121, -0.016702773, 0.7069069) +bones/16/rotation = Quaternion(-1.10481135e-08, -1.7211713e-07, 0.0015136003, 0.99999887) +bones/17/rotation = Quaternion(8.171493e-09, -1.5795608e-11, -0.001129669, 0.9999994) +bones/19/rotation = Quaternion(-0.023705836, 0.7067118, -0.023706501, 0.70670676) +bones/20/rotation = Quaternion(6.2063537e-09, -1.7213546e-07, -0.00083428103, 0.99999964) +bones/21/rotation = Quaternion(-4.408987e-09, 9.673996e-12, 0.00060956756, 0.9999998) +bones/23/rotation = Quaternion(-0.01258851, 0.7069973, -0.012589078, 0.70699215) +bones/24/rotation = Quaternion(-6.10521e-10, -1.7230948e-07, 1.2231059e-05, 1) +bones/25/rotation = Quaternion(7.972916e-09, -2.0744321e-11, -0.0010670644, 0.99999946) +bones/27/rotation = Quaternion(0.17118928, 0.82175857, 0.5142369, 0.17597589) +bones/28/rotation = Quaternion(-6.980263e-05, -0.000115725226, 4.8615035e-05, 1) +bones/29/rotation = Quaternion(3.7026617e-05, 0.0004296155, -0.000446737, 0.9999998) +bones/31/rotation = Quaternion(-0.52299356, 0.46414614, 0.49134666, 0.519254) +bones/32/rotation = Quaternion(0.03291894, -0.7096966, 0.009971096, 0.7036673) +bones/33/rotation = Quaternion(0.021421846, 2.0562991e-05, -6.807027e-07, 0.9997705) +bones/34/rotation = Quaternion(-0.008619734, -1.6298623e-07, -4.563699e-07, 0.99996287) +bones/35/rotation = Quaternion(3.2782563e-07, -0.7071092, 1.7881392e-07, 0.70710444) +bones/36/rotation = Quaternion(9.784942e-13, 1.9799847e-07, 1.5246684e-07, 1) +bones/37/rotation = Quaternion(-1.6174098e-12, -1.12507714e-13, -2.475272e-07, 1) +bones/38/rotation = Quaternion(-2.4752717e-07, 1, 7.902353e-13, -3.5325675e-06) +bones/39/rotation = Quaternion(-0.016702179, -0.70691204, 0.0167028, 0.706907) +bones/40/rotation = Quaternion(-1.10288285e-08, 1.9805947e-07, -0.0015135938, 0.99999887) +bones/41/rotation = Quaternion(8.142783e-09, 1.1905401e-11, 0.0011296737, 0.9999994) +bones/42/rotation = Quaternion(4.1909512e-08, 1, -1.1476882e-13, -3.6517758e-06) +bones/43/rotation = Quaternion(-0.023705805, -0.7067118, 0.023706501, 0.70670676) +bones/44/rotation = Quaternion(6.1961725e-09, 1.9745274e-07, 0.0008342289, 0.99999964) +bones/45/rotation = Quaternion(-4.3941064e-09, -2.848529e-12, -0.0006095098, 0.9999998) +bones/46/rotation = Quaternion(-2.7755576e-15, 1, -1.5847929e-14, -3.5325666e-06) +bones/47/rotation = Quaternion(-0.012588451, -0.7069973, 0.012589137, 0.70699215) +bones/48/rotation = Quaternion(-6.1035393e-10, 1.97688e-07, -1.2221746e-05, 1) +bones/49/rotation = Quaternion(7.946803e-09, 5.210411e-12, 0.0010670653, 0.99999946) +bones/50/rotation = Quaternion(1.8626436e-09, 1, -2.0563416e-13, -3.6517765e-06) +bones/51/rotation = Quaternion(-0.17118931, 0.82175857, 0.5142371, -0.17597595) +bones/52/rotation = Quaternion(-6.983336e-05, 0.000115826726, -4.863552e-05, 1) +bones/53/rotation = Quaternion(3.700704e-05, -0.0004296006, 0.0004467407, 0.9999998) +bones/55/rotation = Quaternion(0.9985262, 3.0990337e-09, 5.7021158e-08, 0.05427208) +bones/56/rotation = Quaternion(0.065685086, -0.00013100135, -8.611721e-06, 0.9978404) +bones/57/rotation = Quaternion(-0.5559502, -0.00032138012, 0.00036089803, 0.83121544) +bones/58/rotation = Quaternion(-0.00013714898, 0.9643046, -0.26479492, -0.00049954106) +bones/60/rotation = Quaternion(0.9985262, 9.78844e-09, 8.623702e-09, 0.054272056) +bones/61/rotation = Quaternion(0.065685056, 0.00013100122, 8.627176e-06, 0.9978404) +bones/62/rotation = Quaternion(-0.55595016, 0.00032138242, -0.00036089472, 0.8312155) +bones/63/rotation = Quaternion(0.00013705369, 0.9643046, -0.26479498, 0.00049955543) + +[node name="AnimationPlayer2" type="AnimationPlayer" parent="UAL2_Standard" unique_id=68426989] +libraries/UAL1_Standard_RM = ExtResource("3_jp3oe") + +[node name="xddx" parent="." unique_id=484221154 instance=ExtResource("3_wvbbu")] +transform = Transform3D(-0.9978922, 0, -0.06489456, 0, 1, 0, 0.06489456, 0, -0.9978922, 0, 0, 0) +visible = false + +[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=1103991492] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) +shape = SubResource("CapsuleShape3D_hldr7") + +[node name="Label3D" type="Label3D" parent="." unique_id=1565482282] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.552639, 0) + +[editable path="UAL2_Standard"] diff --git a/test/test_scene.tscn b/test/test_scene.tscn new file mode 100644 index 000000000..23a89f448 --- /dev/null +++ b/test/test_scene.tscn @@ -0,0 +1,57 @@ +[gd_scene format=3 uid="uid://cft5q85xb0epd"] + +[ext_resource type="Script" uid="uid://begp0osvkrkj6" path="res://test/main.gd" id="1_lr5j1"] +[ext_resource type="PackedScene" uid="uid://dmxaoy1chryah" path="res://test/player.tscn" id="2_lr5j1"] + +[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_lr5j1"] +sky_horizon_color = Color(0.66224277, 0.6717428, 0.6867428, 1) +ground_horizon_color = Color(0.66224277, 0.6717428, 0.6867428, 1) + +[sub_resource type="Sky" id="Sky_56kpk"] +sky_material = SubResource("ProceduralSkyMaterial_lr5j1") + +[sub_resource type="Environment" id="Environment_gaudv"] +background_mode = 2 +sky = SubResource("Sky_56kpk") +glow_enabled = true + +[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_56kpk"] + +[sub_resource type="PlaneMesh" id="PlaneMesh_56kpk"] + +[node name="TestScene" type="Node3D" unique_id=73546698] +script = ExtResource("1_lr5j1") +player_scene = ExtResource("2_lr5j1") + +[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1508807601] +environment = SubResource("Environment_gaudv") + +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=937068642] +transform = Transform3D(-0.8660254, -0.43301278, 0.25, 0, 0.49999997, 0.86602545, -0.50000006, 0.75, -0.43301266, 0, 0, 0) +shadow_enabled = true + +[node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=757091454] +transform = Transform3D(1, 0, 0, 0, 0.97037435, 0.2416063, 0, -0.2416063, 0.97037435, 0, 4.0665565, 2.561579) + +[node name="plane" type="StaticBody3D" parent="." unique_id=1911727017] +transform = Transform3D(10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0) + +[node name="CollisionShape3D" type="CollisionShape3D" parent="plane" unique_id=927282215] +shape = SubResource("WorldBoundaryShape3D_56kpk") + +[node name="MeshInstance3D" type="MeshInstance3D" parent="plane" unique_id=1419802935] +mesh = SubResource("PlaneMesh_56kpk") +skeleton = NodePath("../..") + +[node name="SpawnPoints" type="Node3D" parent="." unique_id=1581154285] + +[node name="Marker3D2" type="Marker3D" parent="SpawnPoints" unique_id=1706759127] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.400938, -0.043175697, 5.162633) + +[node name="Marker3D" type="Marker3D" parent="SpawnPoints" unique_id=658280778] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.626563, -0.021587849, 2.5813165) + +[node name="Marker3D3" type="Marker3D" parent="SpawnPoints" unique_id=1533618772] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.101407, -0.064763546, -43.108097) + +[node name="Players" type="Node3D" parent="." unique_id=1268151670]