Preliminary multiplayer capability (origin stuff disabled for now)

This commit is contained in:
Patrick Marsee 2025-09-24 18:08:12 -04:00
parent 73baafbd6c
commit f0c4263675
18 changed files with 704 additions and 99 deletions

View file

@ -1,14 +1,8 @@
[gd_scene load_steps=20 format=3 uid="uid://d20jwlre5rc5m"]
[gd_scene load_steps=9 format=3 uid="uid://d20jwlre5rc5m"]
[ext_resource type="Script" uid="uid://cdk7y1rat3juk" path="res://demo/demo.gd" id="1_oeqrt"]
[ext_resource type="Texture2D" uid="uid://bruwqvb6qrsfn" path="res://demo/textures/untexture.png" id="1_ytiva"]
[ext_resource type="Script" uid="uid://bddnsq0h2tpf" path="res://scripts/aircraft/nodes/fixed_wing_aircraft.gd" id="2_dar0o"]
[ext_resource type="Resource" uid="uid://dpk3bgq54ajul" path="res://demo/airfoils/symmetric.tres" id="3_u10mr"]
[ext_resource type="Script" uid="uid://qjdma7j2qrns" path="res://scripts/aircraft/resources/fixed_wing_aircraft_performance.gd" id="4_onu7k"]
[ext_resource type="Resource" uid="uid://p2i7a806s6gs" path="res://demo/propulsion/electric_motor.tres" id="4_s1s6j"]
[ext_resource type="Script" uid="uid://pc3j1c6e1ra7" path="res://scripts/aircraft/nodes/flight_sim_controller.gd" id="5_s1s6j"]
[ext_resource type="Script" uid="uid://tgj0rvn5wj8t" path="res://demo/hud.gd" id="6_onu7k"]
[ext_resource type="Script" uid="uid://ddh4omp23xc58" path="res://scripts/origin/region_transform.gd" id="7_onvmd"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_j5lb4"]
albedo_texture = ExtResource("1_ytiva")
@ -16,52 +10,7 @@ uv1_scale = Vector3(100, 100, 100)
[sub_resource type="PlaneMesh" id="PlaneMesh_5hjng"]
material = SubResource("StandardMaterial3D_j5lb4")
size = Vector2(1000, 1000)
center_offset = Vector3(500, 0, 500)
[sub_resource type="Curve" id="Curve_s1s6j"]
_limits = [0.0, 0.5, 0.0, 20.0]
_data = [Vector2(0, 0.5), 0.0, 0.0, 0, 0, Vector2(20, 0), -0.082397, 0.0, 0, 0]
point_count = 2
[sub_resource type="Curve" id="Curve_onvmd"]
_limits = [0.0, 2.0, 0.0, 30.0]
_data = [Vector2(0, 2), 0.0, 0.0, 0, 0, Vector2(30, 0), -0.199316, 0.0, 0, 0]
point_count = 2
[sub_resource type="Curve" id="Curve_oeqrt"]
_limits = [0.0, 0.202247, 0.0, 10.0]
_data = [Vector2(0, 0.202247), 0.0, 0.0, 0, 0, Vector2(10, 0), -0.0393259, 0.0, 0, 0]
point_count = 2
[sub_resource type="Resource" id="Resource_onu7k"]
script = ExtResource("4_onu7k")
horizontal_surface = ExtResource("3_u10mr")
horizontal_area = 21.8
horizontal_aspect_ratio = 5.83
horizontal_sweep = 0.0
vertical_surface = ExtResource("3_u10mr")
vertical_area = 5.0
vertical_aspect_ratio = 5.0
vertical_sweep = 0.0
propultion = ExtResource("4_s1s6j")
base_thrust = 100000.0
base_drag = 0.0
empty_mass = 3463.0
yaw_axis = Vector3(0, -1, 0)
roll_axis = Vector3(0, 0.1, -1)
pitch_stability = 0.0
yaw_stability = 0.0
roll_stability = 0.0
reference_ias_mps = 100.0
braking_power = 0.0
pitch_power = SubResource("Curve_s1s6j")
yaw_power = SubResource("Curve_oeqrt")
roll_power = SubResource("Curve_onvmd")
metadata/_custom_type_script = "uid://qjdma7j2qrns"
[sub_resource type="SphereShape3D" id="SphereShape3D_u10mr"]
radius = 8.0
size = Vector2(2000, 2000)
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_onu7k"]
@ -80,34 +29,9 @@ script = ExtResource("1_oeqrt")
[node name="Ground" type="MeshInstance3D" parent="."]
mesh = SubResource("PlaneMesh_5hjng")
[node name="FixedWingAircraft" type="CharacterBody3D" parent="." node_paths=PackedStringArray("controller")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 0)
script = ExtResource("2_dar0o")
performance = SubResource("Resource_onu7k")
controller = NodePath("FlightSimController")
initial_speed = 100.0
metadata/_custom_type_script = "uid://bddnsq0h2tpf"
[node name="CollisionShape3D" type="CollisionShape3D" parent="FixedWingAircraft"]
shape = SubResource("SphereShape3D_u10mr")
[node name="FlightSimController" type="Node" parent="FixedWingAircraft"]
script = ExtResource("5_s1s6j")
pitch_speed = 4.0
yaw_speed = 4.0
roll_speed = 3.0
metadata/_custom_type_script = "uid://pc3j1c6e1ra7"
[node name="Camera3D" type="Camera3D" parent="FixedWingAircraft"]
[node name="RegionTransform" type="Node" parent="FixedWingAircraft" node_paths=PackedStringArray("target")]
script = ExtResource("7_onvmd")
target = NodePath("..")
metadata/_custom_type_script = "uid://ddh4omp23xc58"
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="HUD" type="Control" parent="CanvasLayer" node_paths=PackedStringArray("source")]
[node name="HUD" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
@ -115,7 +39,6 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("6_onu7k")
source = NodePath("../../FixedWingAircraft")
[node name="TAS_Label" type="Label" parent="CanvasLayer/HUD"]
layout_mode = 0
@ -145,3 +68,13 @@ environment = SubResource("Environment_onvmd")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-4.37114e-08, -0.984808, 0.173648, 0, 0.173648, 0.984808, -1, 4.30473e-08, -7.5904e-09, 0, 0, 0)
[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."]
_spawnable_scenes = PackedStringArray("uid://dcnk85lpgfq3t")
spawn_path = NodePath("../Players")
[node name="Players" type="Node3D" parent="."]
[node name="Camera3D" type="Camera3D" parent="."]
[connection signal="spawned" from="MultiplayerSpawner" to="." method="_on_multiplayer_spawner_spawned"]