diff --git a/asset_dev/props/debug/parallel.blend b/asset_dev/props/debug/parallel.blend new file mode 100644 index 0000000..d08c344 Binary files /dev/null and b/asset_dev/props/debug/parallel.blend differ diff --git a/asset_dev/props/debug/parallel.blend1 b/asset_dev/props/debug/parallel.blend1 new file mode 100644 index 0000000..34d8115 Binary files /dev/null and b/asset_dev/props/debug/parallel.blend1 differ diff --git a/assets/props/parallel/parallel.mtl b/assets/props/parallel/parallel.mtl new file mode 100644 index 0000000..6a977de --- /dev/null +++ b/assets/props/parallel/parallel.mtl @@ -0,0 +1,2 @@ +# Blender 4.3.2 MTL File: 'parallel.blend' +# www.blender.org diff --git a/assets/props/parallel/parallel.obj b/assets/props/parallel/parallel.obj new file mode 100644 index 0000000..df47e0c --- /dev/null +++ b/assets/props/parallel/parallel.obj @@ -0,0 +1,93 @@ +# Blender 4.3.2 +# www.blender.org +mtllib parallel.mtl +o Cube +v -1.000000 -1.000000 0.100000 +v -1.000000 1.000000 0.100000 +v -1.000000 1.000000 -0.100000 +v 1.000000 -1.000000 0.100000 +v 1.000000 1.000000 0.100000 +v 1.000000 1.000000 -0.100000 +v -1.000000 -0.800000 0.100000 +v -1.000000 -0.800000 -0.100000 +v 1.000000 -0.800000 -0.100000 +v 1.000000 -0.800000 0.100000 +v -1.000000 -0.800000 -2.100000 +v 1.000000 -0.800000 -2.100000 +v -1.000000 -0.800000 -2.300000 +v -1.000000 -1.000000 -2.300000 +v 1.000000 -1.000000 -2.300000 +v 1.000000 -0.800000 -2.300000 +v -1.000000 1.000000 -2.100000 +v 1.000000 1.000000 -2.100000 +v -1.000000 1.000000 -2.300000 +v 1.000000 1.000000 -2.300000 +vn -1.0000 -0.0000 -0.0000 +vn -0.0000 -0.0000 -1.0000 +vn 1.0000 -0.0000 -0.0000 +vn -0.0000 -0.0000 1.0000 +vn -0.0000 -1.0000 -0.0000 +vn -0.0000 1.0000 -0.0000 +vt 0.558824 0.705883 +vt 0.294118 0.705883 +vt 0.294118 0.676471 +vt 0.558824 0.676471 +vt 0.000000 0.264706 +vt 0.000000 0.000000 +vt 0.294118 0.000000 +vt 0.294118 0.264706 +vt 0.558824 0.029412 +vt 0.294118 0.029412 +vt 0.294118 0.000000 +vt 0.558824 0.000000 +vt 0.882353 0.705882 +vt 0.882353 0.970588 +vt 0.588235 0.970588 +vt 0.588235 0.705882 +vt 0.588235 0.352941 +vt 0.588235 0.000000 +vt 0.882353 -0.000000 +vt 0.882353 0.352941 +vt 0.882353 1.000000 +vt 0.588235 1.000000 +vt 0.882353 0.676471 +vt 0.588235 0.676471 +vt 0.588235 0.000000 +vt 0.588235 0.352941 +vt 0.558823 0.352941 +vt 0.558823 0.323530 +vt 0.294118 0.558823 +vt 0.000000 0.558823 +vt 0.558824 0.382353 +vt 0.558824 0.352941 +vt 0.588235 0.352941 +vt 0.588235 0.705883 +vt 0.588235 0.647059 +vt 0.882353 0.647059 +vt 0.294118 0.352941 +vt 0.294118 0.323530 +vt 0.588235 0.352941 +vt 0.882353 0.352941 +vt 0.882353 0.382353 +vt 0.588235 0.382353 +vt 0.294118 0.823529 +vt 0.000000 0.823529 +vt 0.294118 0.382353 +vt 0.294118 0.352941 +s 0 +f 7/1/1 2/2/1 3/3/1 8/4/1 +f 8/5/2 3/6/2 6/7/2 9/8/2 +f 9/9/3 6/10/3 5/11/3 10/12/3 +f 10/13/4 5/14/4 2/15/4 7/16/4 +f 1/17/5 14/18/5 15/19/5 4/20/5 +f 6/21/6 3/22/6 2/15/6 5/14/6 +f 4/23/4 10/13/4 7/16/4 1/24/4 +f 4/25/3 15/26/3 16/27/3 12/28/3 9/9/3 10/12/3 +f 8/5/6 9/8/6 12/29/6 11/30/6 +f 8/4/1 11/31/1 13/32/1 14/33/1 1/34/1 7/1/1 +f 14/24/2 13/35/2 16/36/2 15/23/2 +f 12/28/3 16/27/3 20/37/3 18/38/3 +f 17/39/6 18/40/6 20/41/6 19/42/6 +f 16/36/2 13/35/2 19/42/2 20/41/2 +f 11/30/4 12/29/4 18/43/4 17/44/4 +f 13/32/1 11/31/1 17/45/1 19/46/1 diff --git a/assets/props/parallel/parallel.obj.import b/assets/props/parallel/parallel.obj.import new file mode 100644 index 0000000..fee90fe --- /dev/null +++ b/assets/props/parallel/parallel.obj.import @@ -0,0 +1,25 @@ +[remap] + +importer="wavefront_obj" +importer_version=1 +type="Mesh" +uid="uid://ckkba8tby7cyi" +path="res://.godot/imported/parallel.obj-d3d9792b2ea8dd2e5a7908fc945bf809.mesh" + +[deps] + +files=["res://.godot/imported/parallel.obj-d3d9792b2ea8dd2e5a7908fc945bf809.mesh"] + +source_file="res://assets/props/parallel/parallel.obj" +dest_files=["res://.godot/imported/parallel.obj-d3d9792b2ea8dd2e5a7908fc945bf809.mesh", "res://.godot/imported/parallel.obj-d3d9792b2ea8dd2e5a7908fc945bf809.mesh"] + +[params] + +generate_tangents=true +generate_lods=true +generate_shadow_mesh=true +generate_lightmap_uv2=false +generate_lightmap_uv2_texel_size=0.2 +scale_mesh=Vector3(1, 1, 1) +offset_mesh=Vector3(0, 0, 0) +force_disable_mesh_compression=false diff --git a/levels/mechanic_test/mechanic_test.gd b/levels/mechanic_test/mechanic_test.gd index 17b00a5..0e74a53 100644 --- a/levels/mechanic_test/mechanic_test.gd +++ b/levels/mechanic_test/mechanic_test.gd @@ -9,9 +9,11 @@ extends Node3D @onready var nodule_spawn_point: Marker3D = %NoduleSpawnPoint @onready var alarm_spawn_point: Marker3D = %AlarmSpawnPoint +@onready var signal_test_spawn_point: Marker3D = %SignalTestSpawnPoint static var nodule_scene: PackedScene = load("res://src/world/gunk_node/grunk_nodule.tscn") static var alarm_scene: PackedScene = load("res://src/world/mechanics/alarm/gunk_alarm.tscn") +static var signal_test_scene: PackedScene = load("res://levels/mechanic_test/signal_test.tscn") func reset() -> void: @@ -20,6 +22,7 @@ func reset() -> void: Callable(bulkhead, "close").call() Callable(open_switch, "enable").call() Callable(close_switch, "disable").call() + _do_spawn(signal_test_spawn_point, signal_test_scene) func _do_spawn(spawn_point: Node3D, scene: PackedScene) -> void: @@ -38,6 +41,6 @@ func spawn_alarm() -> void: func trigger_spawned_alarm() -> void: - var alarm: GunkAlarm = alarm_spawn_point.get_child(0) + var alarm := alarm_spawn_point.get_child(0) if alarm: - alarm.trigger() + Callable(alarm, "trigger").call() diff --git a/levels/mechanic_test/mechanic_test.tscn b/levels/mechanic_test/mechanic_test.tscn index 99f1761..b965c96 100644 --- a/levels/mechanic_test/mechanic_test.tscn +++ b/levels/mechanic_test/mechanic_test.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=42 format=4 uid="uid://b8rv6dg4tgaeb"] +[gd_scene load_steps=37 format=4 uid="uid://b8rv6dg4tgaeb"] [ext_resource type="Script" uid="uid://bvua1l2hb3an6" path="res://levels/mechanic_test/mechanic_test.gd" id="1_bg05n"] [ext_resource type="PackedScene" uid="uid://bwe2jdmvinhqd" path="res://src/player/player.tscn" id="1_goufh"] @@ -8,12 +8,7 @@ [ext_resource type="Texture2D" uid="uid://8cm835h4gxwe" path="res://assets/debug_mask.png" id="5_x2vho"] [ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="6_x2vho"] [ext_resource type="PackedScene" uid="uid://dvma1hufsl6mc" path="res://src/props/bulkhead/bulkhead.tscn" id="8_0j1ke"] -[ext_resource type="Texture2D" uid="uid://m2qxenym1otw" path="res://assets/level/wall/wall_2_C.png" id="9_cgmn0"] -[ext_resource type="Texture2D" uid="uid://begn6qloo0m1q" path="res://assets/level/wall/wall_2_M.png" id="10_aix42"] -[ext_resource type="PackedScene" uid="uid://bttust5ohud8e" path="res://src/world/mechanics/relay/gunk_relay.tscn" id="10_iyuyb"] -[ext_resource type="Texture2D" uid="uid://cpdrvdu3qt62t" path="res://assets/level/wall/wall_2_N.png" id="11_6frcc"] -[ext_resource type="PackedScene" uid="uid://dgeg3kkogm71m" path="res://src/world/mechanics/alarm/gunk_alarm.tscn" id="11_qjnj2"] -[ext_resource type="Texture2D" uid="uid://ba5vvrx730go8" path="res://assets/level/wall/wall_2_R.png" id="12_7cbja"] +[ext_resource type="PackedScene" uid="uid://b5jubpjj3d277" path="res://levels/mechanic_test/signal_test.tscn" id="9_x2vho"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_goufh"] @@ -132,9 +127,17 @@ shadow_mesh = SubResource("ArrayMesh_0j1ke") [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_qjnj2"] data = PackedVector3Array(-1.5, 0, -6, -1.5, 0, 6, -1.5, 3, -6, -1.5, 3, -6, -1.5, 0, 6, -1.5, 3, 6, 1.5, 0, 6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, 6, 1.5, 0, -6, 1.5, 3, -6, -1.5, 0, 6, -1.5, 0, -6, 1.5, 0, 6, 1.5, 0, 6, -1.5, 0, -6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, -6, -1.5, 3, 6, -1.5, 3, 6, 1.5, 3, -6, -1.5, 3, -6) -[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_f342o"] +[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_x2vho"] load_path = "res://.godot/imported/debug_mask.png-fd2bc783338ed9439fe81a4eef9d86da.s3tc.ctex" +[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_f342o"] +width = 256 +height = 256 +depth = 32 +seamless = true +seamless_blend_skirt = 0.5 +noise = ExtResource("6_x2vho") + [sub_resource type="NoiseTexture3D" id="NoiseTexture3D_iyuyb"] width = 256 height = 256 @@ -143,15 +146,7 @@ seamless = true seamless_blend_skirt = 0.5 noise = ExtResource("6_x2vho") -[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_qjnj2"] -width = 256 -height = 256 -depth = 32 -seamless = true -seamless_blend_skirt = 0.5 -noise = ExtResource("6_x2vho") - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_awnx0"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_qjnj2"] resource_local_to_scene = true render_priority = 0 shader = ExtResource("5_0j1ke") @@ -166,58 +161,50 @@ shader_parameter/emission_strength = 0.02 shader_parameter/uv_scale = Vector2(4, 4) shader_parameter/time_scale = 0.2 shader_parameter/edge_bleed = 0.25 -shader_parameter/gunk_mask = SubResource("CompressedTexture2D_f342o") -shader_parameter/gunk_noise = SubResource("NoiseTexture3D_iyuyb") -shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_qjnj2") +shader_parameter/gunk_mask = SubResource("CompressedTexture2D_x2vho") +shader_parameter/gunk_noise = SubResource("NoiseTexture3D_f342o") +shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_iyuyb") shader_parameter/jitter_magnitude = 0.0 shader_parameter/jitter_time_scale = 0.1 shader_parameter/vertex_inflation = 0.0 shader_parameter/inflation_pixellation = 10.0 -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cgmn0"] -resource_local_to_scene = true -cull_mode = 2 -albedo_texture = ExtResource("9_cgmn0") -metallic = 1.0 -metallic_texture = ExtResource("10_aix42") -roughness_texture = ExtResource("12_7cbja") -normal_enabled = true -normal_texture = ExtResource("11_6frcc") -texture_filter = 4 +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_awnx0"] +albedo_color = Color(1, 0.403922, 1, 1) -[sub_resource type="ArrayMesh" id="ArrayMesh_ix0jw"] +[sub_resource type="ArrayMesh" id="ArrayMesh_cgmn0"] _surfaces = [{ -"aabb": AABB(-1.5, 0, -1.5, 3, 1e-05, 3), +"aabb": AABB(-1, -1, -2.3, 2, 2, 2.4), "format": 34896613377, -"index_count": 6, -"index_data": PackedByteArray("AAABAAIAAgABAAMA"), -"name": "Plane", +"index_count": 108, +"index_data": PackedByteArray("AAABAAIAAgADAAAAAAADAAQAAgAFAAMAAgABAAUAAwAGAAQAAwAFAAYABAAHAAAAAAAHAAEABAAGAAcABwAIAAEABgAIAAcACQAFAAEAAQAIAAkACgAIAAYABgAFAAoACwAJAAgACwAIAAwADAAIAAoADQAJAAsADQAFAAkADAANAAsADgAFAA0ADgANAAwACgAFAA8ADwAFAA4ACgAPABAADgAMABEADAAKABIAEgAKABAAEQAMABIAEAAPABMADwAOABMAEAATABIAEwAOABEAEgATABEA"), +"name": "Cube", "primitive": 3, "uv_scale": Vector4(0, 0, 0, 0), -"vertex_count": 4, -"vertex_data": PackedByteArray("//8AAP//AAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAA=") +"vertex_count": 20, +"vertex_data": PackedByteArray("AAD/////AAAAAJkZ//8AAAAA//+p6gAA/////6nqAAD///////8AAAAAmRmp6gAA//+ZGanqAAD//5kZ//8AAP//AAD//wAAAAAAAP//AAD//5kZVRUAAP//AAAAAAAA//+ZGQAAAAAAAAAAAAAAAAAAmRkAAAAAAACZGVUVAAD/////VRUAAAAA//8AAAAA/////wAAAAAAAP//VRUAAA==") }] blend_shape_mode = 0 -[sub_resource type="ArrayMesh" id="ArrayMesh_xrfi2"] +[sub_resource type="ArrayMesh" id="ArrayMesh_aix42"] _surfaces = [{ -"aabb": AABB(-1.5, 0, -1.5, 3, 1e-05, 3), -"attribute_data": PackedByteArray("/////wAA/////wAAAAAAAA=="), +"aabb": AABB(-1, -1, -2.3, 2, 2, 2.4), +"attribute_data": PackedByteArray("S0tKSw6PSktLS9JSDo/SUpWWSkuVlqWlDo+lpQ6PHZ5LSx2eS0ulpQAA//8AADu8S0v//0tLO7xLS3f4Do93+EtL//8Oj///lZb//w6PLK0Oj6WllZalpUtLpaVLSyyt4eGHB+HhS0uVlocHlZZLS+Hh0lKVltJSlZb//5WWpaXh4f//4eGlpZWWAADh4QAAlZaHB+HhhwdLSzu8AAA7vEtL8HAAAPBwlZZZWpWW0lLh4Vla4eHSUpWWHZ7h4R2e4eGlpZWWpaXh4R2elZYdnktL8HAAAPBwS0stLQAALS0="), "format": 34896613399, -"index_count": 6, -"index_data": PackedByteArray("AAABAAIAAgABAAMA"), -"material": SubResource("StandardMaterial3D_cgmn0"), -"name": "Plane", +"index_count": 108, +"index_data": PackedByteArray("AAABAAIAAgABAAMABAADAAEABQADAAQABgADAAUABwADAAYABwAGAAgACAAGAAkACgALAAwADAALAA0ADgAPABAAEAAPABEADwASABEAEwASAA8AFAASABMAFQASABQAFAATABYAFgATABcAGAAZABoAGgAZABsAGQAcABsAGwAcAB0AHgAfACAAIAAfACEAIgAjACQAJAAjACUAJgAnACgAKAAnACkAKgArACwALAArAC0AKgAsAC4ALgAsAC8AMAAxADIAMgAxADMANAA1ADYANgA1ADcA"), +"material": SubResource("StandardMaterial3D_awnx0"), +"name": "Cube", "primitive": 3, "uv_scale": Vector4(0, 0, 0, 0), -"vertex_count": 4, -"vertex_data": PackedByteArray("//8AAP///78AAAAA////v///AAAAAP+/AAAAAAAA/7////9/////f////3////9/") +"vertex_count": 56, +"vertex_data": PackedByteArray("AAD/////VNUAAJkZ//9U1QAA//+p6lTVAACZGanqVNUAAAAA//9U1QAAAAAAAFTVAACZGQAAVNUAAJkZVRVU1QAA//9VFVTVAAD//wAAVNUAAP//qer//wAAmRmp6v///////6nq/////5kZqer///////+p6lTV//+ZGanqVNX///////9U1f//mRn//1TV//8AAP//VNX//5kZVRVT1f//mRkAAFTV//8AAAAAVNX/////AABU1f////9VFVTV////////AID//5kZ//8AgAAA/////wCAAACZGf//AID//wAA//8AgAAAAAD//wCAAAAAAAAA/78AAAAA////v///AAAAAP+///8AAP///78AAP//qer/v/////+p6v+/AAD//////7//////////v///mRmp6v+/AACZGanq/7///5kZVRX/vwAAmRlVFf+/AACZGQAA//8AAAAAAAD/////mRkAAP////8AAAAA//8AAP//AAD///////8AAP///////1UV/78AAP//VRX/v/////8AAP+/AAD//wAA/7///5kZVRUAgAAAmRlVFQCA/////1UVAIAAAP//VRUAgFRVqqpUVaqqVFWqqlRVqapUVamqVFWpqlRVqqpUVaqqVFWqqlRVqqr///9/////f////3////9/qqpUVamqVFWqqlRVqqpUVamqVFWpqlNVqapUVaqqVFWqqlRVqqpUVf9/////f////3////9/////f////3///wAA/38AAP9/AAD/fwAA/3////9/////f////3////9/////f////3////9/////f////3////9/////f////3////9/////f////3////9/////f////3//f////3////9/////f///") }] blend_shape_mode = 0 -shadow_mesh = SubResource("ArrayMesh_ix0jw") +shadow_mesh = SubResource("ArrayMesh_cgmn0") [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_x2vho"] -data = PackedVector3Array(1.5, 0, 1.5, -1.5, 0, 1.5, 1.5, 0, -1.5, 1.5, 0, -1.5, -1.5, 0, 1.5, -1.5, 0, -1.5) +data = PackedVector3Array(-1, 1, 0.1, -1, -0.8, 0.1, -1, 1, -0.1, -1, 1, -0.1, -1, -0.8, 0.1, -1, -0.8, -0.1, -1, -1, 0.1, -1, -0.8, -0.1, -1, -0.8, 0.1, -1, -1, -2.3, -1, -0.8, -0.1, -1, -1, 0.1, -1, -0.8, -2.3, -1, -0.8, -0.1, -1, -1, -2.3, -1, -0.8, -2.1, -1, -0.8, -0.1, -1, -0.8, -2.3, -1, -0.8, -2.1, -1, -0.8, -2.3, -1, 1, -2.1, -1, 1, -2.1, -1, -0.8, -2.3, -1, 1, -2.3, -1, 1, -0.1, -1, -0.8, -0.1, 1, 1, -0.1, 1, 1, -0.1, -1, -0.8, -0.1, 1, -0.8, -0.1, 1, 1, -0.1, 1, -0.8, -0.1, 1, 1, 0.1, 1, 1, 0.1, 1, -0.8, -0.1, 1, -0.8, 0.1, 1, -0.8, -0.1, 1, -1, 0.1, 1, -0.8, 0.1, 1, -0.8, -2.1, 1, -1, 0.1, 1, -0.8, -0.1, 1, -0.8, -2.3, 1, -1, 0.1, 1, -0.8, -2.1, 1, -1, -2.3, 1, -1, 0.1, 1, -0.8, -2.3, 1, -0.8, -2.3, 1, -0.8, -2.1, 1, 1, -2.3, 1, 1, -2.3, 1, -0.8, -2.1, 1, 1, -2.1, 1, 1, 0.1, 1, -0.8, 0.1, -1, 1, 0.1, -1, 1, 0.1, 1, -0.8, 0.1, -1, -0.8, 0.1, 1, -0.8, 0.1, 1, -1, 0.1, -1, -0.8, 0.1, -1, -0.8, 0.1, 1, -1, 0.1, -1, -1, 0.1, -1, -1, -2.3, -1, -1, 0.1, 1, -1, -2.3, 1, -1, -2.3, -1, -1, 0.1, 1, -1, 0.1, -1, 1, -0.1, 1, 1, -0.1, -1, 1, 0.1, -1, 1, 0.1, 1, 1, -0.1, 1, 1, 0.1, 1, -0.8, -0.1, -1, -0.8, -0.1, 1, -0.8, -2.1, 1, -0.8, -2.1, -1, -0.8, -0.1, -1, -0.8, -2.1, -1, -0.8, -2.3, -1, -1, -2.3, 1, -0.8, -2.3, 1, -0.8, -2.3, -1, -1, -2.3, 1, -1, -2.3, -1, -0.8, -2.3, 1, -0.8, -2.3, -1, 1, -2.3, -1, 1, -2.3, 1, -0.8, -2.3, 1, 1, -2.3, 1, 1, -2.1, -1, 1, -2.1, 1, 1, -2.3, 1, 1, -2.3, -1, 1, -2.1, -1, 1, -2.3, 1, -0.8, -2.1, -1, -0.8, -2.1, 1, 1, -2.1, 1, 1, -2.1, -1, -0.8, -2.1, -1, 1, -2.1) [node name="MechanicTest" type="Node3D"] script = ExtResource("1_bg05n") @@ -369,37 +356,28 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.4, 0.35) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0.3) text = "Close" -[node name="SignalTest" type="Node3D" parent="."] +[node name="SignalTestSpawnPoint" type="Marker3D" parent="."] +unique_name_in_owner = true transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, -6) -[node name="Wall" parent="SignalTest" instance=ExtResource("4_2uiim")] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1.5, 0) -source_gunk_material = SubResource("ShaderMaterial_awnx0") +[node name="SignalTest" parent="SignalTestSpawnPoint" instance=ExtResource("9_x2vho")] -[node name="MeshInstance3D" type="MeshInstance3D" parent="SignalTest/Wall"] -mesh = SubResource("ArrayMesh_xrfi2") +[node name="PropTestSpawnPoint" type="Marker3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.5, 0, 4.5) -[node name="CollisionShape3D" type="CollisionShape3D" parent="SignalTest/Wall"] +[node name="PropTest" type="Node3D" parent="PropTestSpawnPoint"] + +[node name="Parallel" parent="PropTestSpawnPoint/PropTest" instance=ExtResource("4_2uiim")] +transform = Transform3D(-4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 0, 1, 1.5) +mask_dim = 128 +source_gunk_material = SubResource("ShaderMaterial_qjnj2") + +[node name="MeshInstance3D" type="MeshInstance3D" parent="PropTestSpawnPoint/PropTest/Parallel"] +mesh = SubResource("ArrayMesh_aix42") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="PropTestSpawnPoint/PropTest/Parallel"] shape = SubResource("ConcavePolygonShape3D_x2vho") -[node name="WallSwitch" parent="SignalTest" instance=ExtResource("2_pka60")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.15, 1.45, 0.0999999) - -[node name="GunkRelay" parent="SignalTest" instance=ExtResource("10_iyuyb")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.45, 2.1, 0) - -[node name="GunkRelay2" parent="SignalTest" instance=ExtResource("10_iyuyb")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.15, 1.75, 0) - -[node name="GunkRelay3" parent="SignalTest" instance=ExtResource("10_iyuyb")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, 1.95, 0) - -[node name="GunkRelay4" parent="SignalTest" instance=ExtResource("10_iyuyb")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, 1.45, 0) - -[node name="GunkAlarm" parent="SignalTest" instance=ExtResource("11_qjnj2")] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0.9, 1.75, 0) - [connection signal="activated" from="ResetPodium/ResetSwitch" to="." method="reset"] [connection signal="activated" from="NoduleSpawner/WallSwitch" to="." method="spawn_nodule"] [connection signal="activated" from="AlarmSpawner/WallSwitch" to="." method="spawn_alarm"] @@ -410,9 +388,3 @@ transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0.9, 1 [connection signal="activated" from="Bulkhead/Podium2/CloseSwitch" to="Bulkhead" method="close"] [connection signal="activated" from="Bulkhead/Podium2/CloseSwitch" to="Bulkhead/Podium/OpenSwitch" method="enable"] [connection signal="activated" from="Bulkhead/Podium2/CloseSwitch" to="Bulkhead/Podium2/CloseSwitch" method="disable"] -[connection signal="activated" from="SignalTest/WallSwitch" to="SignalTest/GunkRelay" method="trigger"] -[connection signal="triggered" from="SignalTest/GunkRelay" to="SignalTest/GunkRelay2" method="trigger"] -[connection signal="triggered" from="SignalTest/GunkRelay2" to="SignalTest/GunkRelay3" method="trigger"] -[connection signal="triggered" from="SignalTest/GunkRelay2" to="SignalTest/GunkRelay4" method="trigger"] -[connection signal="triggered" from="SignalTest/GunkRelay3" to="SignalTest/GunkAlarm" method="trigger"] -[connection signal="triggered" from="SignalTest/GunkRelay4" to="SignalTest/GunkAlarm" method="trigger"] diff --git a/levels/mechanic_test/signal_test.tscn b/levels/mechanic_test/signal_test.tscn new file mode 100644 index 0000000..33f5af0 --- /dev/null +++ b/levels/mechanic_test/signal_test.tscn @@ -0,0 +1,137 @@ +[gd_scene load_steps=19 format=3 uid="uid://b5jubpjj3d277"] + +[ext_resource type="PackedScene" uid="uid://c2omlx4ptrc01" path="res://src/world/gunk_body/gunk_body.tscn" id="1_3u410"] +[ext_resource type="Shader" uid="uid://ckxc0ngd37rtk" path="res://src/shaders/gunk.gdshader" id="2_tfbib"] +[ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="3_e8utx"] +[ext_resource type="Texture2D" uid="uid://m2qxenym1otw" path="res://assets/level/wall/wall_2_C.png" id="4_r07l4"] +[ext_resource type="Texture2D" uid="uid://begn6qloo0m1q" path="res://assets/level/wall/wall_2_M.png" id="5_67o2j"] +[ext_resource type="Texture2D" uid="uid://cpdrvdu3qt62t" path="res://assets/level/wall/wall_2_N.png" id="6_4yjoq"] +[ext_resource type="Texture2D" uid="uid://ba5vvrx730go8" path="res://assets/level/wall/wall_2_R.png" id="7_c27im"] +[ext_resource type="PackedScene" uid="uid://dgqx1h4dtkwma" path="res://src/world/mechanics/trigger/gunk_trigger.tscn" id="8_gx82l"] +[ext_resource type="PackedScene" uid="uid://bttust5ohud8e" path="res://src/world/mechanics/relay/gunk_relay.tscn" id="9_d4a3d"] +[ext_resource type="PackedScene" uid="uid://dgeg3kkogm71m" path="res://src/world/mechanics/alarm/gunk_alarm.tscn" id="10_l8xa5"] + +[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_f342o"] +load_path = "res://.godot/imported/debug_mask.png-fd2bc783338ed9439fe81a4eef9d86da.s3tc.ctex" + +[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_iyuyb"] +width = 256 +height = 256 +depth = 32 +seamless = true +seamless_blend_skirt = 0.5 +noise = ExtResource("3_e8utx") + +[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_qjnj2"] +width = 256 +height = 256 +depth = 32 +seamless = true +seamless_blend_skirt = 0.5 +noise = ExtResource("3_e8utx") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_awnx0"] +resource_local_to_scene = true +render_priority = 0 +shader = ExtResource("2_tfbib") +shader_parameter/color_1 = Color(0, 0.03, 0.1, 1) +shader_parameter/color_2 = Color(0, 0.1, 0.3, 1) +shader_parameter/emission_color = Color(0.25, 0.88, 1, 1) +shader_parameter/pixellation = 128.0 +shader_parameter/time_pixellation = 30.0 +shader_parameter/roughness = 0.15 +shader_parameter/specular_contribution = 0.8 +shader_parameter/emission_strength = 0.02 +shader_parameter/uv_scale = Vector2(4, 4) +shader_parameter/time_scale = 0.2 +shader_parameter/edge_bleed = 0.25 +shader_parameter/gunk_mask = SubResource("CompressedTexture2D_f342o") +shader_parameter/gunk_noise = SubResource("NoiseTexture3D_iyuyb") +shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_qjnj2") +shader_parameter/jitter_magnitude = 0.0 +shader_parameter/jitter_time_scale = 0.1 +shader_parameter/vertex_inflation = 0.0 +shader_parameter/inflation_pixellation = 10.0 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cgmn0"] +resource_local_to_scene = true +cull_mode = 2 +albedo_texture = ExtResource("4_r07l4") +metallic = 1.0 +metallic_texture = ExtResource("5_67o2j") +roughness_texture = ExtResource("7_c27im") +normal_enabled = true +normal_texture = ExtResource("6_4yjoq") +texture_filter = 4 + +[sub_resource type="ArrayMesh" id="ArrayMesh_ix0jw"] +_surfaces = [{ +"aabb": AABB(-1.5, 0, -1.5, 3, 1e-05, 3), +"format": 34896613377, +"index_count": 6, +"index_data": PackedByteArray(0, 0, 1, 0, 2, 0, 2, 0, 1, 0, 3, 0), +"name": "Plane", +"primitive": 3, +"uv_scale": Vector4(0, 0, 0, 0), +"vertex_count": 4, +"vertex_data": PackedByteArray(255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) +}] +blend_shape_mode = 0 + +[sub_resource type="ArrayMesh" id="ArrayMesh_xrfi2"] +_surfaces = [{ +"aabb": AABB(-1.5, 0, -1.5, 3, 1e-05, 3), +"attribute_data": PackedByteArray(255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0), +"format": 34896613399, +"index_count": 6, +"index_data": PackedByteArray(0, 0, 1, 0, 2, 0, 2, 0, 1, 0, 3, 0), +"material": SubResource("StandardMaterial3D_cgmn0"), +"name": "Plane", +"primitive": 3, +"uv_scale": Vector4(0, 0, 0, 0), +"vertex_count": 4, +"vertex_data": PackedByteArray(255, 255, 0, 0, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 255, 255, 0, 0, 0, 0, 255, 191, 0, 0, 0, 0, 0, 0, 255, 191, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127) +}] +blend_shape_mode = 0 +shadow_mesh = SubResource("ArrayMesh_ix0jw") + +[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_x2vho"] +data = PackedVector3Array(1.5, 0, 1.5, -1.5, 0, 1.5, 1.5, 0, -1.5, 1.5, 0, -1.5, -1.5, 0, 1.5, -1.5, 0, -1.5) + +[node name="SignalTest" type="Node3D"] + +[node name="Wall" parent="." instance=ExtResource("1_3u410")] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1.5, 0) +mask_dim = 64 +source_gunk_material = SubResource("ShaderMaterial_awnx0") + +[node name="MeshInstance3D" type="MeshInstance3D" parent="Wall"] +mesh = SubResource("ArrayMesh_xrfi2") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Wall"] +shape = SubResource("ConcavePolygonShape3D_x2vho") + +[node name="GunkTrigger" parent="." instance=ExtResource("8_gx82l")] +transform = Transform3D(1, 0, 0, 0, 0.707107, -0.707107, 0, 0.707107, 0.707107, -1, 1.5, 0) + +[node name="GunkRelay" parent="." instance=ExtResource("9_d4a3d")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.45, 2.1, 0) + +[node name="GunkRelay2" parent="." instance=ExtResource("9_d4a3d")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.15, 1.75, 0) + +[node name="GunkRelay3" parent="." instance=ExtResource("9_d4a3d")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, 1.95, 0) + +[node name="GunkRelay4" parent="." instance=ExtResource("9_d4a3d")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, 1.45, 0) + +[node name="GunkAlarm" parent="." instance=ExtResource("10_l8xa5")] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0.9, 1.75, 0) + +[connection signal="destroyed" from="GunkTrigger" to="GunkRelay" method="trigger"] +[connection signal="triggered" from="GunkRelay" to="GunkRelay2" method="trigger"] +[connection signal="triggered" from="GunkRelay2" to="GunkRelay3" method="trigger"] +[connection signal="triggered" from="GunkRelay2" to="GunkRelay4" method="trigger"] +[connection signal="triggered" from="GunkRelay3" to="GunkAlarm" method="trigger"] +[connection signal="triggered" from="GunkRelay4" to="GunkAlarm" method="trigger"] diff --git a/levels/sandbox/debug_gunk_mat.tres b/levels/sandbox/debug_gunk_mat.tres index c2295c4..e265f03 100644 --- a/levels/sandbox/debug_gunk_mat.tres +++ b/levels/sandbox/debug_gunk_mat.tres @@ -40,6 +40,10 @@ shader_parameter/edge_bleed = 0.25 shader_parameter/gunk_mask = SubResource("CompressedTexture2D_ow0bp") shader_parameter/gunk_noise = SubResource("NoiseTexture3D_d70or") shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_0ksu8") +shader_parameter/jitter_magnitude = 0.0 +shader_parameter/jitter_time_scale = 0.1 +shader_parameter/vertex_inflation = 0.0 +shader_parameter/inflation_pixellation = 10.0 [resource] next_pass = SubResource("ShaderMaterial_4xnwj") diff --git a/src/world/gunk_body/gunk_body.gd b/src/world/gunk_body/gunk_body.gd index 5da46e2..933b524 100644 --- a/src/world/gunk_body/gunk_body.gd +++ b/src/world/gunk_body/gunk_body.gd @@ -149,19 +149,21 @@ func get_clear_total() -> float: ## Returns -1 if the given point+normal does not lie on a mesh face within tolerance. func _get_face(point: Vector3, normal: Vector3) -> int: var min_i := -1 - var min_sdist := INF + var min_planar_dist := INF for i in range(meshtool.get_face_count()): var sdist := meshtool.get_face_normal(i).distance_squared_to(normal) - if sdist > FACE_EPSILON or sdist > min_sdist: + if sdist > FACE_EPSILON: continue # Normals match, so check if the point is on this face var v1 := meshtool.get_vertex(meshtool.get_face_vertex(i, 0)) var v2 := meshtool.get_vertex(meshtool.get_face_vertex(i, 1)) var v3 := meshtool.get_vertex(meshtool.get_face_vertex(i, 2)) if GeometryTools.is_in_triangle(point, v1, v2, v3): - min_i = i - min_sdist = sdist + var planar_dist := absf(Plane(v1, v2, v3).distance_to(point)) + if planar_dist < min_planar_dist: + min_i = i + min_planar_dist = planar_dist return min_i diff --git a/src/world/gunk_body/gunk_body.tscn b/src/world/gunk_body/gunk_body.tscn index 95a1920..38608d1 100644 --- a/src/world/gunk_body/gunk_body.tscn +++ b/src/world/gunk_body/gunk_body.tscn @@ -13,6 +13,7 @@ source_gunk_material = ExtResource("2_hrldx") [node name="MaskViewport" type="SubViewport" parent="."] unique_name_in_owner = true +transparent_bg = true handle_input_locally = false size = Vector2i(1024, 1024) render_target_clear_mode = 1 diff --git a/src/world/gunk_node/grunk_nodule.gd b/src/world/gunk_node/grunk_nodule.gd index 137dedd..49cd5f3 100644 --- a/src/world/gunk_node/grunk_nodule.gd +++ b/src/world/gunk_node/grunk_nodule.gd @@ -11,7 +11,7 @@ extends GunkNode func _process(delta: float) -> void: super._process(delta) var shader: ShaderMaterial = mesh_instance.mesh.surface_get_material(0) - var value := _sustained_damage / durability + var value := pct_damage() shader.set_shader_parameter("jitter_time_scale", pow(value * jitter_scale_factor, 1.2)) shader.set_shader_parameter("vertex_inflation", pow(value * jitter_inflation_factor, 3)) diff --git a/src/world/gunk_node/gunk_node.gd b/src/world/gunk_node/gunk_node.gd index 4c03eeb..228a494 100644 --- a/src/world/gunk_node/gunk_node.gd +++ b/src/world/gunk_node/gunk_node.gd @@ -26,6 +26,11 @@ func hit(damage: float = 0.05) -> void: _hit() +## Return this node's current damage as a proportion of it's total durability. +func pct_damage() -> float: + return _sustained_damage / durability + + func _hit() -> void: pass # Implemented in derived type diff --git a/src/world/mechanics/alarm/gunk_alarm.gd b/src/world/mechanics/alarm/gunk_alarm.gd index db1214e..ffd9df8 100644 --- a/src/world/mechanics/alarm/gunk_alarm.gd +++ b/src/world/mechanics/alarm/gunk_alarm.gd @@ -1,4 +1,4 @@ -class_name GunkAlarm extends GunkNode +extends GunkNode ## Raises the grunk alert when triggered. const ALERT_DELTA := 1 @@ -23,7 +23,7 @@ func _process(delta: float) -> void: super._process(delta) # TODO actual model & animation var material: StandardMaterial3D = mesh_instance_3d.mesh.surface_get_material(0) - var value := 1.0 - _sustained_damage / durability + var value := 1.0 - pct_damage() material.albedo_color = Color(value, value, value) diff --git a/src/world/mechanics/relay/gunk_relay.gd b/src/world/mechanics/relay/gunk_relay.gd index abee019..3b838e9 100644 --- a/src/world/mechanics/relay/gunk_relay.gd +++ b/src/world/mechanics/relay/gunk_relay.gd @@ -1,4 +1,4 @@ -extends GunkNode +class_name GunkRelay extends GunkNode ## Gunk node that rebroadcasts triggers to the network after a delay. ## Emitted when `trigger` is called, after a short delay. diff --git a/src/world/mechanics/trigger/gunk_trigger.gd b/src/world/mechanics/trigger/gunk_trigger.gd new file mode 100644 index 0000000..5435389 --- /dev/null +++ b/src/world/mechanics/trigger/gunk_trigger.gd @@ -0,0 +1,11 @@ +extends GunkNode +## Triggers other components when destroyed. + +@onready var mesh_instance_3d: MeshInstance3D = %MeshInstance3D + + +func _process(delta: float) -> void: + super._process(delta) + # TODO proper animation + var mat: StandardMaterial3D = mesh_instance_3d.mesh.surface_get_material(0) + mat.emission_energy_multiplier = pct_damage() diff --git a/src/world/mechanics/trigger/gunk_trigger.gd.uid b/src/world/mechanics/trigger/gunk_trigger.gd.uid new file mode 100644 index 0000000..3cad5f4 --- /dev/null +++ b/src/world/mechanics/trigger/gunk_trigger.gd.uid @@ -0,0 +1 @@ +uid://pfob2ntqm0xw diff --git a/src/world/mechanics/trigger/gunk_trigger.tscn b/src/world/mechanics/trigger/gunk_trigger.tscn new file mode 100644 index 0000000..f2bfbd5 --- /dev/null +++ b/src/world/mechanics/trigger/gunk_trigger.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=6 format=4 uid="uid://dgqx1h4dtkwma"] + +[ext_resource type="Script" uid="uid://pfob2ntqm0xw" path="res://src/world/mechanics/trigger/gunk_trigger.gd" id="1_t1c4j"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_t1c4j"] +emission_enabled = true +emission = Color(1, 0, 0, 1) +emission_energy_multiplier = 0.0 + +[sub_resource type="ArrayMesh" id="ArrayMesh_swi0f"] +_surfaces = [{ +"aabb": AABB(-0.894425, -1, -0.85064, 1.78885, 2, 1.70128), +"format": 34896613377, +"index_count": 60, +"index_data": PackedByteArray("AAABAAIAAgABAAMAAQAAAAQAAwABAAUABQABAAQABAAAAAYABQAEAAcABwAEAAYAAwAFAAgACAAFAAcAAgADAAkACQADAAgAAAACAAoACgACAAkABgAAAAoACAAHAAsABwAGAAsACQAIAAsABgAKAAsACgAJAAsA"), +"name": "Icosphere", +"primitive": 3, +"uv_scale": Vector4(0, 0, 0, 0), +"vertex_count": 12, +"vertex_data": PackedByteArray("jOfBRhrPAAD/fwAA/38AAHJYwUb//wAAAADBRv9/AACM58FG5DAAAHJYwUYAAAAA//89uf9/AACMpz25AAAAAHIYPbnkMAAAchg9uRrPAACMpz25//8AAP9/////fwAA") +}] +blend_shape_mode = 0 + +[sub_resource type="ArrayMesh" id="ArrayMesh_ulsff"] +_surfaces = [{ +"aabb": AABB(-0.894425, -1, -0.85064, 1.78885, 2, 1.70128), +"attribute_data": PackedByteArray("0UWv14su//9FF6/XFl3//9FFr9dcdK/X//+v17no//9z0a/Xc9Gv1y26///ooq/X6KKv16KL//9cdK/XXHSv19FFr9cWXWCv0UWv10UXr9eLLmCv//+v13PRr9e56GCvc9Gv1+iir9ctumCv6KKv11x0r9eii2CvFl1gr9FFr9eLLmCviy5gr0UXr9cAAGCvuehgr3PRr9ctumCvLbpgr+iir9eii2Cvootgr1x0r9cWXWCvFl1gr4suYK/RRRGHiy5grwAAYK9FFxGHuehgry26YK9z0RGHLbpgr6KLYK/oohGHootgrxZdYK9cdBGH"), +"format": 34896613399, +"index_count": 60, +"index_data": PackedByteArray("AAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA6ADsA"), +"material": SubResource("StandardMaterial3D_t1c4j"), +"name": "Icosphere", +"primitive": 3, +"uv_scale": Vector4(0, 0, 0, 0), +"vertex_count": 60, +"vertex_data": PackedByteArray("jOfBRhrPZaf/fwAA/39lp3JYwUb//2Wn/38AAP9/DciM58FGGs8NyIznwUbkMA3IcljBRv//nLT/fwAA/3+ctAAAwUb/f5y0AADBRv9/2N3/fwAA/3/Y3XJYwUYAANjdcljBRgAAiPT/fwAA/3+I9IznwUbkMIj0jOfBRuQwW8CM58FGGs9bwP//Pbn/f1vAjOfBRhrP6Y5yWMFG///pjoynPbn//+mOcljBRv//GacAAMFG/38Zp3IYPbkazxmnAADBRv9/yNlyWMFGAADI2XIYPbnkMMjZcljBRgAAQfOM58FG5DBB84ynPbkAAEHz//89uf9/GaeM58FGGs8Zp4ynPbn//xmnjKc9uf//6Y5yWMFG///pjnIYPbkaz+mOchg9uRrPW8AAAMFG/39bwHIYPbnkMFvAchg9ueQwQfNyWMFGAABB84ynPbkAAEHzjKc9uQAAyNmM58FG5DDI2f//Pbn/f8jZ//89uf9/nLSMpz25//+ctP9/////f5y0jKc9uf//ZadyGD25Gs9lp/9/////f2Wnchg9uRrPDchyGD255DANyP9/////fw3Ichg9ueQwiPSMpz25AACI9P9/////f4j0jKc9uQAA2N3//z25/3/Y3f9/////f9jdbylFZG8pRWRvKUVkLWCkPy1gpD8tYKQ/7DOZzewzmc3sM5nNSkmH7UpJh+1KSYftn3mdLp95nS6feZ0uz3VfFM91XxTPdV8UzFJcNMxSXDTMUlw092Nt7fdjbe33Y23t/2+Y+v9vmPr/b5j6RH6lDER+pQxEfqUMB5yREgeckRIHnJESMq2iyzKtossyraLLL4qf6y+Kn+svip/ruoFZ87qBWfO6gVnz/49mBf+PZgX/j2YFEsxlMhLMZTISzGUyj9a5m4/WuZuP1rmb0Z9awNGfWsDRn1rAX4Zh0V+GYdFfhmHRtLZ3ErS2dxK0tncS") +}] +blend_shape_mode = 0 +shadow_mesh = SubResource("ArrayMesh_swi0f") + +[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_t1c4j"] +data = PackedVector3Array(0.7236, -0.4472, 0.5257, 0, -1, 0, -0.2764, -0.4472, 0.8506, 0, -1, 0, 0.7236, -0.4472, 0.5257, 0.7236, -0.4472, -0.5257, -0.2764, -0.4472, 0.8506, 0, -1, 0, -0.8944, -0.4472, 0, -0.8944, -0.4472, 0, 0, -1, 0, -0.2764, -0.4472, -0.8506, -0.2764, -0.4472, -0.8506, 0, -1, 0, 0.7236, -0.4472, -0.5257, 0.7236, -0.4472, -0.5257, 0.7236, -0.4472, 0.5257, 0.8944, 0.4472, 0, 0.7236, -0.4472, 0.5257, -0.2764, -0.4472, 0.8506, 0.2764, 0.4472, 0.8506, -0.2764, -0.4472, 0.8506, -0.8944, -0.4472, 0, -0.7236, 0.4472, 0.5257, -0.8944, -0.4472, 0, -0.2764, -0.4472, -0.8506, -0.7236, 0.4472, -0.5257, -0.2764, -0.4472, -0.8506, 0.7236, -0.4472, -0.5257, 0.2764, 0.4472, -0.8506, 0.8944, 0.4472, 0, 0.7236, -0.4472, 0.5257, 0.2764, 0.4472, 0.8506, 0.2764, 0.4472, 0.8506, -0.2764, -0.4472, 0.8506, -0.7236, 0.4472, 0.5257, -0.7236, 0.4472, 0.5257, -0.8944, -0.4472, 0, -0.7236, 0.4472, -0.5257, -0.7236, 0.4472, -0.5257, -0.2764, -0.4472, -0.8506, 0.2764, 0.4472, -0.8506, 0.2764, 0.4472, -0.8506, 0.7236, -0.4472, -0.5257, 0.8944, 0.4472, 0, 0.8944, 0.4472, 0, 0.2764, 0.4472, 0.8506, 0, 1, 0, 0.2764, 0.4472, 0.8506, -0.7236, 0.4472, 0.5257, 0, 1, 0, -0.7236, 0.4472, 0.5257, -0.7236, 0.4472, -0.5257, 0, 1, 0, -0.7236, 0.4472, -0.5257, 0.2764, 0.4472, -0.8506, 0, 1, 0, 0.2764, 0.4472, -0.8506, 0.8944, 0.4472, 0, 0, 1, 0) + +[node name="GunkTrigger" type="StaticBody3D"] +collision_layer = 5 +collision_mask = 0 +script = ExtResource("1_t1c4j") +durability = 0.1 +metadata/_custom_type_script = "uid://bypgxi0gy56yk" + +[node name="MeshInstance3D" type="MeshInstance3D" parent="."] +unique_name_in_owner = true +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) +mesh = SubResource("ArrayMesh_ulsff") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) +shape = SubResource("ConcavePolygonShape3D_t1c4j") diff --git a/src/world/mechanics/watchdog/gunk_watchdog.gd b/src/world/mechanics/watchdog/gunk_watchdog.gd new file mode 100644 index 0000000..2379854 --- /dev/null +++ b/src/world/mechanics/watchdog/gunk_watchdog.gd @@ -0,0 +1,23 @@ +extends GunkNode +## Triggers an alarm when connection to a target is lost. + +const TRIGGER_SIGNAL := "trigger" + +@export var entry_point: GunkRelay +@export var target: GunkNode + + +static func _build_path(current: GunkRelay, target: GunkNode) -> Array[GunkNode]: + for connection: Callable in current.triggered.get_connections(): + var next_node := connection.get_object() as GunkNode + if next_node: + if next_node == target: + return [current, next_node] + var relay := next_node as GunkRelay + if relay: + var ret: Array[GunkNode] = [current] + # XXX + ret.append_array(_build_path(relay, target)) + return ret + + return [] diff --git a/src/world/mechanics/watchdog/gunk_watchdog.gd.uid b/src/world/mechanics/watchdog/gunk_watchdog.gd.uid new file mode 100644 index 0000000..0e05f78 --- /dev/null +++ b/src/world/mechanics/watchdog/gunk_watchdog.gd.uid @@ -0,0 +1 @@ +uid://uw4lx3ohj6s4 diff --git a/src/world/mechanics/watchdog/gunk_watchdog.tscn b/src/world/mechanics/watchdog/gunk_watchdog.tscn new file mode 100644 index 0000000..1a6cb56 --- /dev/null +++ b/src/world/mechanics/watchdog/gunk_watchdog.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=4 format=3 uid="uid://baavay05afcj8"] + +[ext_resource type="Script" uid="uid://uw4lx3ohj6s4" path="res://src/world/mechanics/watchdog/gunk_watchdog.gd" id="1_hr1mr"] + +[sub_resource type="SphereMesh" id="SphereMesh_hr1mr"] +radius = 0.25 +height = 0.5 + +[sub_resource type="SphereShape3D" id="SphereShape3D_lvqm8"] +radius = 0.25 + +[node name="GunkWatchdog" type="StaticBody3D"] +script = ExtResource("1_hr1mr") +metadata/_custom_type_script = "uid://bypgxi0gy56yk" + +[node name="MeshInstance3D" type="MeshInstance3D" parent="."] +mesh = SubResource("SphereMesh_hr1mr") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("SphereShape3D_lvqm8") diff --git a/vault/TODO.md b/vault/TODO.md index 6fe9532..1c06e9e 100644 --- a/vault/TODO.md +++ b/vault/TODO.md @@ -17,7 +17,7 @@ - [ ] #mechanics - [x] [[grunk alert]] - [x] [[alarm]] - - [ ] [[hotwire]] + - [ ] [[watchdog]] - [ ] [[tripwire]] - [ ] [[looker]] - [ ] [[listener]] diff --git a/vault/elements/hotwire.md b/vault/elements/watchdog.md similarity index 100% rename from vault/elements/hotwire.md rename to vault/elements/watchdog.md