From a69ed298dc33ea57a99f628c38ff69a5d8b1fd27 Mon Sep 17 00:00:00 2001 From: SchimmelSpreu83 Date: Mon, 23 Mar 2026 20:24:55 +0100 Subject: [PATCH] Added a debug box mesh visualization for LevelStreamers (finding unload spots better) - Also added some cheats for LimboConsole. --- game/src/core/utils.gd | 15 +- .../level/debug_aabb_ingame_material.tres | 12 + .../core/world/level/debug_aabb_material.tres | 10 + game/src/core/world/level/level_streamer.gd | 46 ++ game/src/core/world/world.gd | 39 +- game/src/game.gd | 21 +- game/src/game.tscn | 4 +- .../characters/player/player_character.gd | 72 ++ .../systems/flashlight/flashlight_manager.gd | 8 + game/src/ui/loading_screen/loading_screen.gd | 8 +- .../exposition/exposition.tscn5556120197.tmp | 715 ------------------ game/tools/debug_outline.gdshader | 44 ++ game/tools/debug_outline.gdshader.uid | 1 + game/tools/debug_outline_material.tres | 12 + 14 files changed, 280 insertions(+), 727 deletions(-) create mode 100644 game/src/core/world/level/debug_aabb_ingame_material.tres create mode 100644 game/src/core/world/level/debug_aabb_material.tres delete mode 100644 game/src/worlds/exposition/exposition.tscn5556120197.tmp create mode 100644 game/tools/debug_outline.gdshader create mode 100644 game/tools/debug_outline.gdshader.uid create mode 100644 game/tools/debug_outline_material.tres diff --git a/game/src/core/utils.gd b/game/src/core/utils.gd index 5033fdd..af2bbaa 100644 --- a/game/src/core/utils.gd +++ b/game/src/core/utils.gd @@ -3,6 +3,8 @@ extends Object const VEC3_HOR := Vector3(1.0, 0.0, 1.0) +const VEC3_XY := Vector3(1.0, 1.0, 0.0) +const VEC3_YZ := Vector3(0.0, 1.0, 1.0) static func free_node_safely(node: Node) -> void: @@ -43,13 +45,13 @@ static func get_all_children(node: Node, internal: bool = false) -> Array[Node]: static func node_distance( - node_a: Node3D, node_b: Node3D, position_modifier := Vector3.ONE + node_a: Node3D, node_b: Node3D, position_multiplier := Vector3.ONE ) -> float: if not is_instance_valid(node_a) or not is_instance_valid(node_b): return -1.0 - return (node_a.global_position * position_modifier).distance_to( - node_b.global_position * position_modifier + return (node_a.global_position * position_multiplier).distance_to( + node_b.global_position * position_multiplier ) @@ -132,3 +134,10 @@ static func uid_to_res_path(uid: Variant) -> Variant: return paths return null + + +static func create_box_mesh_from_aabb(aabb: AABB) -> BoxMesh: + var mesh := BoxMesh.new() + mesh.size = aabb.size + return mesh + diff --git a/game/src/core/world/level/debug_aabb_ingame_material.tres b/game/src/core/world/level/debug_aabb_ingame_material.tres new file mode 100644 index 0000000..afa73bb --- /dev/null +++ b/game/src/core/world/level/debug_aabb_ingame_material.tres @@ -0,0 +1,12 @@ +[gd_resource type="ShaderMaterial" format=3 uid="uid://dag4adrscn4b7"] + +[ext_resource type="Shader" uid="uid://b3d0qp0pjfhmk" path="res://tools/debug_outline.gdshader" id="1_1ceck"] + +[resource] +render_priority = 0 +shader = ExtResource("1_1ceck") +shader_parameter/base_color = Color(0.3, 1, 0.3, 0.15) +shader_parameter/edge_color = Color(1, 1, 0.3, 0.8) +shader_parameter/edge_power = 3.0 +shader_parameter/box_center = Vector3(0, 0, 0) +shader_parameter/box_extents = Vector3(0, 0, 0) diff --git a/game/src/core/world/level/debug_aabb_material.tres b/game/src/core/world/level/debug_aabb_material.tres new file mode 100644 index 0000000..5e27ec2 --- /dev/null +++ b/game/src/core/world/level/debug_aabb_material.tres @@ -0,0 +1,10 @@ +[gd_resource type="ShaderMaterial" format=3 uid="uid://c8jcuss805aie"] + +[ext_resource type="Shader" uid="uid://b3d0qp0pjfhmk" path="res://tools/debug_outline.gdshader" id="1_ibo8j"] + +[resource] +render_priority = 0 +shader = ExtResource("1_ibo8j") +shader_parameter/base_color = Color(0.29803923, 1, 0.29803923, 0.019607844) +shader_parameter/edge_color = Color(1, 1, 0.49803922, 0.06666667) +shader_parameter/edge_power = 2.0 diff --git a/game/src/core/world/level/level_streamer.gd b/game/src/core/world/level/level_streamer.gd index 54c4c2f..3d6e984 100644 --- a/game/src/core/world/level/level_streamer.gd +++ b/game/src/core/world/level/level_streamer.gd @@ -34,6 +34,7 @@ signal loading_finished #for aabb: AABB in load_aabbs: #add_gizmo.call_deferred(AABBGizmo.new(aabb, self)) @export_tool_button("Auto Generate AABB", "CSGBox3D") var editor_auto_gen_aabb: Callable = _editor_auto_gen_aabb +@export var editor_visualize_aabbs_with_box: bool = true: set = _editor_set_visualize_aabbs_with_box var loaded_level: Node var is_loading_level: bool = false @@ -140,6 +141,13 @@ func precompute_aabb() -> void: for aabb: AABB in _precomputed_aabbs: _precomputed_aabb = _precomputed_aabb.merge(aabb) + if Engine.is_editor_hint() and editor_visualize_aabbs_with_box: + setup_debug_meshes() + + +func get_precomputed_aabbs() -> Array[AABB]: + return _precomputed_aabbs + func load_level() -> void: _unload_time_left = unload_delay @@ -200,6 +208,36 @@ func is_position_in_bounds(point: Vector3) -> bool: return false +func setup_debug_meshes(debug_material: Material = load("uid://c8jcuss805aie")) -> void: + var children: Array[Node] = find_children("_DEBUG_VISIBILITY*", "MeshInstance3D", false, false) + + if not children.is_empty(): + for child: Node in children: + child.free() + + var aabbs: Array[AABB] = get_precomputed_aabbs() + + for aabb_index: int in range(aabbs.size()): + var aabb: AABB = aabbs[aabb_index] + var mesh: BoxMesh = Utils.create_box_mesh_from_aabb(aabb) + var mesh_instance := MeshInstance3D.new() + mesh_instance.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_OFF + mesh_instance.mesh = mesh + mesh_instance.material_override = debug_material + mesh_instance.name = "_DEBUG_VISIBILITY" + str(aabb_index) + add_child(mesh_instance) + mesh_instance.position = to_local(aabb.position + aabb.size / 2.0) + mesh_instance.set_instance_shader_parameter(&"box_extents", aabb.size * 0.5) + mesh_instance.set_instance_shader_parameter(&"box_center", mesh_instance.global_position) + + +func clear_debug_meshes() -> void: + var children: Array[Node] = find_children("_DEBUG_VISIBILITY*", "MeshInstance3D", false, false) + + for child: Node in children: + child.free() + + func _draw_debug() -> void: for aabb: AABB in _precomputed_aabbs: Game.debug_draw("aabb", [aabb, Color.LAWN_GREEN]) @@ -243,3 +281,11 @@ func _editor_auto_gen_aabb() -> void: ud.add_do_property(self, &"load_aabbs", load_aabbs) ud.add_undo_property(self, &"load_aabbs", previous_aabbs) ud.commit_action() + + +func _editor_set_visualize_aabbs_with_box(value: bool) -> void: + editor_visualize_aabbs_with_box = value + if value: + setup_debug_meshes() + else: + clear_debug_meshes() diff --git a/game/src/core/world/world.gd b/game/src/core/world/world.gd index ff7d2fb..3aedba3 100644 --- a/game/src/core/world/world.gd +++ b/game/src/core/world/world.gd @@ -5,11 +5,12 @@ signal loaded signal change_world_requested(new_world_path: String, save_previous: bool, load_from_save: bool) signal world_unload_requested(do_save: bool) -@export var level_streamers: Array[LevelStreamer] +@export var level_streamers: Array[LevelStreamer] = [] ## Reference to the player. ## Should probably have a [method apply_orientation] and [method get_orientation] function, ## since the return value get's put into [member WorldState.player_transform]. @export var player: Node3D + @export_group("Debug", "debug_") ## Only applies when this world is the game's current scene. @export_custom(PROPERTY_HINT_GROUP_ENABLE, "debug_") var debug_enabled: bool = false @@ -23,6 +24,10 @@ signal world_unload_requested(do_save: bool) var world_state: WorldState +func _exit_tree() -> void: + LimboConsole.unregister_command("toggle_level_streamer_visibility") + + func _ready() -> void: if debug_enabled: if get_tree().current_scene == self: @@ -36,6 +41,8 @@ func _ready() -> void: initialize_level_streamers() initialize_world_proxies() + register_commands() + loaded.emit() @@ -148,6 +155,36 @@ func get_instance_state(key: String, default: Variant) -> Variant: return world_state.instance_data.get(key, default) +func register_commands() -> void: + var toggle_streamer_visibility: Callable = func() -> void: + var center_marker_mat := StandardMaterial3D.new() + center_marker_mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED + center_marker_mat.no_depth_test = true + center_marker_mat.depth_draw_mode = BaseMaterial3D.DEPTH_DRAW_DISABLED + center_marker_mat.disable_ambient_light = true + center_marker_mat.disable_fog = true + center_marker_mat.disable_specular_occlusion = true + center_marker_mat.disable_receive_shadows = true + + for streamer: LevelStreamer in level_streamers: + var children: Array[Node] = streamer.find_children("_DEBUG_VISIBILITY*", "MeshInstance3D", false, false) + + if children.is_empty(): + streamer.setup_debug_meshes(load("uid://dag4adrscn4b7")) + + var center_marker := MeshInstance3D.new() + center_marker.mesh = SphereMesh.new() + center_marker.scale *= 0.2 + center_marker.name = "_DEBUG_VISIBILITY_CMARKER" + streamer.level_id + center_marker.material_override = center_marker_mat + streamer.add_child(center_marker) + else: + for child: Node in children: + child.queue_free() + + LimboConsole.register_command(toggle_streamer_visibility, "toggle_level_streamer_visibility") + + func _load_levels_player_is_in() -> void: if not is_instance_valid(player): return diff --git a/game/src/game.gd b/game/src/game.gd index 49ce5b7..c44b216 100644 --- a/game/src/game.gd +++ b/game/src/game.gd @@ -34,6 +34,7 @@ static func debug_draw(draw_shape: String, args: Array) -> void: func _ready() -> void: if not Engine.is_editor_hint(): load_main_menu() + register_commands() func load_game(save_data: SaveData, save_slot: int) -> void: @@ -93,7 +94,6 @@ func unload_world(do_save: bool = true) -> void: save_world_state() world.process_mode = Node.PROCESS_MODE_DISABLED - await loading_screen.fade_in() world.queue_free() @@ -142,12 +142,27 @@ func quit_game() -> void: get_tree().quit() -func _on_unload_world_request(do_save: bool) -> void: - await unload_world(do_save) +func register_commands() -> void: + var load_save_func: Callable = func(save_index: int) -> void: + var path: String = MainMenu.get_save_path(save_index) + if ResourceLoader.exists(path): + load_game(load(path), save_index) + LimboConsole.register_command(load_save_func, "load_save", "Loads the save with the given save slot index.") + LimboConsole.register_command(save_game, "save_game", "Saves the game based on the current save slot.") + + +func _on_unload_world_request(do_save: bool) -> void: if do_save: save_game() + if is_instance_valid(world): + world.process_mode = Node.PROCESS_MODE_DISABLED + + await loading_screen.fade_in() + + unload_world(do_save) + await load_main_menu() loading_screen.fade_out() diff --git a/game/src/game.tscn b/game/src/game.tscn index 32b5712..2129739 100644 --- a/game/src/game.tscn +++ b/game/src/game.tscn @@ -10,5 +10,7 @@ metadata/_custom_type_script = "uid://cl1u038dbrou2" [node name="WorldContainer" type="Node" parent="." unique_id=1835125942] unique_name_in_owner = true -[node name="LoadingScreen" parent="." unique_id=1509462056 instance=ExtResource("2_3msxb")] +[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=919699501] + +[node name="LoadingScreen" parent="CanvasLayer" unique_id=1509462056 instance=ExtResource("2_3msxb")] unique_name_in_owner = true diff --git a/game/src/gameplay/characters/player/player_character.gd b/game/src/gameplay/characters/player/player_character.gd index 4e9e504..5ad181c 100644 --- a/game/src/gameplay/characters/player/player_character.gd +++ b/game/src/gameplay/characters/player/player_character.gd @@ -31,6 +31,8 @@ var has_control: bool = true var can_run: bool = true var is_crouching: bool = false var crouch_speed_affection: float = 0.0 +var _noclipping: bool = false +var _flying: bool = false @onready var head: PlayerHead = %Head @onready var collision_shape: CollisionShape3D = %CylinderCollider @@ -43,12 +45,19 @@ func _init() -> void: player = self +func _exit_tree() -> void: + LimboConsole.unregister_command("player_fly") + LimboConsole.unregister_command("player_noclip") + + func _ready() -> void: head.rotation.y = global_rotation.y global_rotation.y = 0.0 flashlight.manager = flashlight_manager + _register_commands() + func _physics_process(delta: float) -> void: #var lagspike: bool = randf() < 0.005 @@ -170,3 +179,66 @@ func handle_crouching(delta: float) -> void: "Crouching Speed Affection: %s\nIs Crouching: %s" % [crouch_speed_affection, is_crouching], true ) + + +func _register_commands() -> void: + var noclip_func: Callable = func() -> void: + const _NOCLIP_SPEED: float = 15.0 + _flying = not _flying + + if _flying and _noclipping: + _flying = false + + while _flying and is_inside_tree(): + if InputManager.is_window_focused(): + set_physics_process(false) + var input_dir: Vector3 = get_input_direction() + movement_direction = transform.basis * Vector3(input_dir.x, 1.0, input_dir.z) + movement_direction = (movement_direction * Utils.VEC3_HOR).normalized() + movement_direction = movement_direction.rotated(Vector3.UP, head.global_rotation.y) + + if Input.is_action_pressed(ACTION_JUMP): + movement_direction.y = 1.0 * _NOCLIP_SPEED + elif Input.is_action_pressed(ACTION_CROUCH): + movement_direction.y = -1.0 * _NOCLIP_SPEED + + speed = _NOCLIP_SPEED + move(movement_direction, get_physics_process_delta_time()) + velocity.y = movement_direction.y + global_position += velocity * get_physics_process_delta_time() + + await get_tree().process_frame + + set_physics_process(true) + + var fly_func: Callable = func() -> void: + const _FLY_SPEED: float = 15.0 + _flying = not _flying + + if _noclipping and _flying: + _noclipping = false + + while _flying and is_inside_tree(): + if InputManager.is_window_focused(): + set_physics_process(false) + var input_dir: Vector3 = get_input_direction() + movement_direction = transform.basis * Vector3(input_dir.x, 1.0, input_dir.z) + movement_direction = (movement_direction * Utils.VEC3_HOR).normalized() + movement_direction = movement_direction.rotated(Vector3.UP, head.global_rotation.y) + + if Input.is_action_pressed(ACTION_JUMP): + movement_direction.y = 1.0 * _FLY_SPEED + elif Input.is_action_pressed(ACTION_CROUCH): + movement_direction.y = -1.0 * _FLY_SPEED + + speed = _FLY_SPEED + move(movement_direction, get_physics_process_delta_time()) + velocity.y = movement_direction.y + move_and_slide() + + await get_tree().process_frame + + set_physics_process(true) + + LimboConsole.register_command(noclip_func, "player_noclip") + LimboConsole.register_command(fly_func, "player_fly") diff --git a/game/src/gameplay/systems/flashlight/flashlight_manager.gd b/game/src/gameplay/systems/flashlight/flashlight_manager.gd index 7bf8193..0e15148 100644 --- a/game/src/gameplay/systems/flashlight/flashlight_manager.gd +++ b/game/src/gameplay/systems/flashlight/flashlight_manager.gd @@ -31,6 +31,14 @@ func _enter_tree() -> void: _world_proxy = WorldProxy.new() add_child(_world_proxy) + LimboConsole.register_command(refill_power, "flashlight_refill", "Fill up the flashlight's power by this amount.") + LimboConsole.register_command(drain_power, "flashlight_drain", "Drain the flashlight's power by this amount.") + + +func _exit_tree() -> void: + LimboConsole.unregister_command(refill_power) + LimboConsole.unregister_command(drain_power) + func _ready() -> void: world = await _world_proxy.wait_for_world() diff --git a/game/src/ui/loading_screen/loading_screen.gd b/game/src/ui/loading_screen/loading_screen.gd index f6dcdec..78e885a 100644 --- a/game/src/ui/loading_screen/loading_screen.gd +++ b/game/src/ui/loading_screen/loading_screen.gd @@ -23,7 +23,7 @@ func _ready() -> void: mouse_filter = Control.MOUSE_FILTER_IGNORE -func fade_in() -> void: +func fade_in(duration: float = fade_in_duration) -> void: color_rect.show() set_process(true) fading = true @@ -33,13 +33,13 @@ func fade_in() -> void: _tween.kill() _tween = create_tween() - _tween.tween_property(color_rect, ^"color:a", 1.0, fade_in_duration) + _tween.tween_property(color_rect, ^"color:a", 1.0, duration) await _tween.finished set_loading_hints_visible(true) -func fade_out() -> void: +func fade_out(duration: float = fade_out_duration) -> void: set_loading_hints_visible(false) mouse_filter = Control.MOUSE_FILTER_IGNORE fading = false @@ -48,7 +48,7 @@ func fade_out() -> void: _tween.kill() _tween = create_tween() - _tween.tween_property(color_rect, ^"color:a", 0.0, fade_out_duration) + _tween.tween_property(color_rect, ^"color:a", 0.0, duration) await _tween.finished color_rect.hide() diff --git a/game/src/worlds/exposition/exposition.tscn5556120197.tmp b/game/src/worlds/exposition/exposition.tscn5556120197.tmp deleted file mode 100644 index 31f0989..0000000 --- a/game/src/worlds/exposition/exposition.tscn5556120197.tmp +++ /dev/null @@ -1,715 +0,0 @@ -[gd_scene format=3 uid="uid://cnfgc6k86hp1q"] - -[ext_resource type="PackedScene" uid="uid://8y3swwnmxwg2" path="res://src/worlds/world.tscn" id="1_3iyfg"] -[ext_resource type="Material" uid="uid://c38215ysnknyk" path="res://assets/dev/dark/dark_01.tres" id="2_f04cf"] -[ext_resource type="Script" uid="uid://s1vhbwkyewdg" path="res://src/gameplay/systems/flashlight/flashlight_manager.gd" id="2_whdyi"] -[ext_resource type="PackedScene" uid="uid://yuthv3c7rx8" path="res://src/ui/pause_menu/pause_menu.tscn" id="2_yht7d"] -[ext_resource type="Material" uid="uid://r527wj0qbkvs" path="res://assets/dev/orange/orange_02.tres" id="3_en67y"] -[ext_resource type="Material" uid="uid://d02jll28bgkap" path="res://assets/dev/orange/orange_05.tres" id="3_gdn1s"] -[ext_resource type="Material" uid="uid://bahys2ntbh2ap" path="res://assets/dev/orange/orange_01.tres" id="3_wtnit"] -[ext_resource type="Material" uid="uid://biu40ot7f55no" path="res://assets/dev/dark/dark_04.tres" id="4_8xmty"] -[ext_resource type="PackedScene" uid="uid://cprtg457nr86q" path="res://assets/models/plush/godot_plush_v2.glb" id="8_qm8ha"] -[ext_resource type="PackedScene" uid="uid://bkq8nkmqu7drf" path="res://src/gameplay/systems/flashlight/flashlight_battery.tscn" id="9_n68sy"] -[ext_resource type="Script" uid="uid://qpwf8svieydl" path="res://src/worlds/exposition/levels/entrance_hall/entrance_hall_power_box.gd" id="10_btgc1"] -[ext_resource type="PackedScene" uid="uid://c2wxc6rij53vs" path="res://src/gameplay/systems/flashlight/flashlight_trigger.tscn" id="10_dy1qy"] -[ext_resource type="PackedScene" uid="uid://cpa000c2xd3ea" path="res://src/gameplay/systems/power_box/power_box_fuse.tscn" id="10_xp6ux"] -[ext_resource type="Script" uid="uid://y1nxrfv31pke" path="res://tools/cutscene_animation_player.gd" id="11_map4s"] -[ext_resource type="PackedScene" uid="uid://bbqf7j8s2n81l" path="res://src/gameplay/systems/power_box/fuse_pickup.tscn" id="11_qm8ha"] -[ext_resource type="PackedScene" uid="uid://lyl5v6s6waw" path="res://_development/ayuroo/maestro/_mo_chase_test.tscn" id="14_264wa"] - -[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_gdn1s"] -sky_top_color = Color(0.055987924, 0.081590004, 0.17344469, 1) -sky_horizon_color = Color(0.07963555, 0.093164064, 0.14665467, 1) -ground_horizon_color = Color(0.07963555, 0.093164064, 0.14665467, 1) -sun_angle_max = 2.93 -sun_curve = 2.2392747 - -[sub_resource type="Sky" id="Sky_dy1qy"] -sky_material = SubResource("ProceduralSkyMaterial_gdn1s") - -[sub_resource type="Environment" id="Environment_dy1qy"] -background_mode = 2 -sky = SubResource("Sky_dy1qy") -tonemap_mode = 2 -glow_enabled = true - -[sub_resource type="Sky" id="Sky_wb8ak"] -sky_material = SubResource("ProceduralSkyMaterial_gdn1s") - -[sub_resource type="Environment" id="Environment_whdyi"] -background_mode = 2 -sky = SubResource("Sky_wb8ak") -tonemap_mode = 2 -glow_enabled = true - -[sub_resource type="Animation" id="Animation_gdn1s"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("DoorRight:rotation") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector3(0, 0, 0)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("DoorLeft:rotation") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector3(0, 0, 0)] -} - -[sub_resource type="Animation" id="Animation_8xmty"] -resource_name = "open" -length = 10.0 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("DoorLeft:rotation") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 10), -"transitions": PackedFloat32Array(0.5, 1), -"update": 0, -"values": [Vector3(0, 0, 0), Vector3(0, 1.8325957, 0)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("DoorRight:rotation") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0, 10), -"transitions": PackedFloat32Array(0.5, 1), -"update": 0, -"values": [Vector3(0, 0, 0), Vector3(0, -1.8325957, 0)] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_gdn1s"] -_data = { -&"RESET": SubResource("Animation_gdn1s"), -&"open": SubResource("Animation_8xmty") -} - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_wtnit"] -transparency = 1 -albedo_color = Color(1, 1, 1, 0.35686275) - -[sub_resource type="Animation" id="Animation_map4s"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("../Cutscene/Camera3D:position") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector3(0, 2.5, -5)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("../Cutscene/Camera3D:rotation") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector3(0, 0, 0)] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("../Cutscene/Camera3D:current") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [false] -} -tracks/3/type = "value" -tracks/3/imported = false -tracks/3/enabled = true -tracks/3/path = NodePath("../Cutscene/Camera3D:fov") -tracks/3/interp = 1 -tracks/3/loop_wrap = true -tracks/3/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [65.0] -} - -[sub_resource type="Animation" id="Animation_qm8ha"] -resource_name = "activated" -length = 2.0 -capture_included = true -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("../Cutscene/Camera3D:position") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0.3, 1.7), -"transitions": PackedFloat32Array(1, 1), -"update": 2, -"values": [Vector3(0, 2.6, -5), Vector3(0, 2.6, -5)] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("../Cutscene/Camera3D:rotation") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0.3, 1.7), -"transitions": PackedFloat32Array(1, 1), -"update": 2, -"values": [Vector3(0.14835298, 0, 0), Vector3(0.14835298, 0, 0)] -} -tracks/2/type = "method" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("../Cutscene/PowerBoxAnimation") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0.3, 1), -"transitions": PackedFloat32Array(1, 1), -"values": [{ -"args": [], -"method": &"lock_player" -}, { -"args": [], -"method": &"align_player_with_end_alignment" -}] -} -tracks/3/type = "value" -tracks/3/imported = false -tracks/3/enabled = true -tracks/3/path = NodePath("../Cutscene/Camera3D:fov") -tracks/3/interp = 1 -tracks/3/loop_wrap = true -tracks/3/keys = { -"times": PackedFloat32Array(0.3, 1.7), -"transitions": PackedFloat32Array(1, 1), -"update": 2, -"values": [65.0, 65.0] -} -tracks/4/type = "value" -tracks/4/imported = false -tracks/4/enabled = true -tracks/4/path = NodePath("../Cutscene/Camera3D:current") -tracks/4/interp = 1 -tracks/4/loop_wrap = true -tracks/4/keys = { -"times": PackedFloat32Array(0, 2), -"transitions": PackedFloat32Array(1, 1), -"update": 1, -"values": [true, true] -} - -[sub_resource type="Animation" id="Animation_264wa"] -resource_name = "animation_end" -length = 0.5 -tracks/0/type = "method" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("../Cutscene/PowerBoxAnimation") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.5), -"transitions": PackedFloat32Array(1, 1), -"values": [{ -"args": [0.5], -"method": &"interpolate_camera_back" -}, { -"args": [], -"method": &"restore_flashlight" -}] -} -tracks/1/type = "method" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("../Cutscene/PowerBoxAnimation") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0.5), -"transitions": PackedFloat32Array(1), -"values": [{ -"args": [], -"method": &"unlock_player" -}] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("../Cutscene/Camera3D:current") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0, 0.5), -"transitions": PackedFloat32Array(1, 1), -"update": 1, -"values": [true, false] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_map4s"] -_data = { -&"RESET": SubResource("Animation_map4s"), -&"activated": SubResource("Animation_qm8ha"), -&"animation_end": SubResource("Animation_264wa") -} - -[sub_resource type="BoxShape3D" id="BoxShape3D_dy1qy"] -size = Vector3(14.6, 3, 1) - -[node name="Exposition" unique_id=1613733883 instance=ExtResource("1_3iyfg")] - -[node name="NightEnvironment" type="WorldEnvironment" parent="." index="0" unique_id=1572071534] -environment = SubResource("Environment_dy1qy") - -[node name="DayEnvironment" type="WorldEnvironment" parent="." index="1" unique_id=168205352] -environment = SubResource("Environment_whdyi") - -[node name="DaySun" type="DirectionalLight3D" parent="." index="2" unique_id=1667672001] -transform = Transform3D(-0.8660254, -0.43301278, 0.25, 0, 0.49999997, 0.86602545, -0.50000006, 0.75, -0.43301266, 0, 0, 0) -visible = false -shadow_enabled = true - -[node name="NightSun" type="DirectionalLight3D" parent="." index="3" unique_id=372201677] -transform = Transform3D(-0.8660254, -0.43301278, 0.25, 0, 0.49999997, 0.86602545, -0.50000006, 0.75, -0.43301266, 0, 0, 0) -light_color = Color(0.31085983, 0.314331, 0.35950518, 1) -light_angular_distance = 0.75 -shadow_enabled = true - -[node name="PlayerCharacter" parent="." index="4" unique_id=1678220543 node_paths=PackedStringArray("flashlight_manager")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0000005, 17) -flashlight_manager = NodePath("FlashlightManager") - -[node name="FlashlightManager" type="Node" parent="PlayerCharacter" index="6" unique_id=583526169 node_paths=PackedStringArray("world")] -script = ExtResource("2_whdyi") -world = NodePath("../..") -metadata/_custom_type_script = "uid://s1vhbwkyewdg" - -[node name="EntranceHall" type="Node3D" parent="." index="5" unique_id=1518685491] - -[node name="Doors" type="CSGCombiner3D" parent="EntranceHall" index="0" unique_id=2012245375] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -19.6) -use_collision = true - -[node name="AnimationPlayer" type="AnimationPlayer" parent="EntranceHall/Doors" index="0" unique_id=906939002] -libraries/ = SubResource("AnimationLibrary_gdn1s") - -[node name="DoorLeft" type="CSGCombiner3D" parent="EntranceHall/Doors" index="1" unique_id=1094260622] -transform = Transform3D(0.9999997, 0, 0, 0, 1, 0, 0, 0, 0.9999997, -5.2, 0, 0.10000038) - -[node name="Box" type="CSGBox3D" parent="EntranceHall/Doors/DoorLeft" index="0" unique_id=1833029438] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.45, 7, 0) -visible = false -size = Vector3(5.5, 14, 1) -material = ExtResource("3_en67y") - -[node name="Box3" type="CSGBox3D" parent="EntranceHall/Doors/DoorLeft" index="1" unique_id=1258502275] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.45, 5.625, 0) -size = Vector3(5.5, 11.25, 1) -material = ExtResource("3_en67y") - -[node name="Box4" type="CSGBox3D" parent="EntranceHall/Doors/DoorLeft" index="2" unique_id=1346859939] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.825, 7, 0) -size = Vector3(2.75, 14, 1) -material = ExtResource("3_en67y") - -[node name="Box2" type="CSGCylinder3D" parent="EntranceHall/Doors/DoorLeft" index="3" unique_id=1015521100] -transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 2.45, 11.25, 0) -radius = 2.75 -height = 1.0 -material = ExtResource("3_en67y") - -[node name="DoorRight" type="CSGCombiner3D" parent="EntranceHall/Doors" index="2" unique_id=275591387] -transform = Transform3D(0.9999997, 0, 0, 0, 1, 0, 0, 0, 0.9999997, 5.2, 0, 0.10000038) - -[node name="Box" type="CSGBox3D" parent="EntranceHall/Doors/DoorRight" index="0" unique_id=404654783] -transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, -2.4625, 7, 0) -visible = false -size = Vector3(5.5, 14, 1) -material = ExtResource("3_en67y") - -[node name="Box3" type="CSGBox3D" parent="EntranceHall/Doors/DoorRight" index="1" unique_id=1124114693] -transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, -2.4625, 5.625, 0) -size = Vector3(5.5, 11.25, 1) -material = ExtResource("3_en67y") - -[node name="Box4" type="CSGBox3D" parent="EntranceHall/Doors/DoorRight" index="2" unique_id=461171599] -transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, -3.8374999, 7, 0) -size = Vector3(2.75, 14, 1) -material = ExtResource("3_en67y") - -[node name="Box2" type="CSGCylinder3D" parent="EntranceHall/Doors/DoorRight" index="3" unique_id=1740694143] -transform = Transform3D(-1, 8.742278e-08, -3.821371e-15, 0, -4.371139e-08, -1, -8.742278e-08, -1, 4.371139e-08, -2.4625, 11.25, 0) -radius = 2.75 -height = 1.0 -material = ExtResource("3_en67y") - -[node name="Floor" type="CSGBox3D" parent="EntranceHall/Doors" index="3" unique_id=872627719] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0.10000038) -size = Vector3(11, 1, 1) -material = ExtResource("3_en67y") - -[node name="Blockout" type="CSGCombiner3D" parent="EntranceHall" index="1" unique_id=2092187673] -use_collision = true - -[node name="Floor" type="CSGBox3D" parent="EntranceHall/Blockout" index="0" unique_id=106297379] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) -size = Vector3(40, 1, 38) -material = ExtResource("2_f04cf") - -[node name="Ceiling" type="CSGBox3D" parent="EntranceHall/Blockout" index="1" unique_id=678154528] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 18.5, 0) -size = Vector3(40, 1, 38) -material = ExtResource("2_f04cf") - -[node name="HollowSphere" type="CSGSphere3D" parent="EntranceHall/Blockout/Ceiling" index="0" unique_id=123150142] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) -operation = 2 -radius = 12.0 -radial_segments = 24 -material = ExtResource("2_f04cf") - -[node name="CenterCashier" type="CSGCombiner3D" parent="EntranceHall/Blockout" index="2" unique_id=1862985509] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) - -[node name="Statue" type="CSGCombiner3D" parent="EntranceHall/Blockout/CenterCashier" index="0" unique_id=134083437] - -[node name="Room" type="CSGCombiner3D" parent="EntranceHall/Blockout/CenterCashier" index="1" unique_id=120658381] - -[node name="Cylinder" type="CSGCylinder3D" parent="EntranceHall/Blockout/CenterCashier/Room" index="0" unique_id=1559637996] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.25, 0) -radius = 6.0 -height = 4.5 -sides = 18 -material = ExtResource("3_wtnit") - -[node name="HollowCylinder" type="CSGCylinder3D" parent="EntranceHall/Blockout/CenterCashier/Room" index="1" unique_id=1402496092] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.7656252, 0) -operation = 2 -radius = 5.8 -height = 4.6312504 -sides = 18 -material = ExtResource("3_wtnit") - -[node name="Window" type="CSGBox3D" parent="EntranceHall/Blockout/CenterCashier/Room" index="2" unique_id=556425626] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.95, 0) -operation = 2 -size = Vector3(1.5, 2, 12) -material = ExtResource("2_f04cf") - -[node name="Window2" type="CSGBox3D" parent="EntranceHall/Blockout/CenterCashier/Room" index="3" unique_id=1652618075] -transform = Transform3D(0.70710677, 0, -0.70710677, 0, 1, 0, 0.70710677, 0, 0.70710677, 0, 1.95, 0) -operation = 2 -size = Vector3(1.5, 2, 12) -material = ExtResource("2_f04cf") - -[node name="_TEMPDoor" type="CSGBox3D" parent="EntranceHall/Blockout/CenterCashier/Room" index="4" unique_id=136289796] -transform = Transform3D(0.70710677, 0, -0.70710677, 0, 1, 0, 0.70710677, 0, 0.70710677, -3.535534, 1.45, 3.535534) -operation = 2 -size = Vector3(1.5, 3, 2) -material = ExtResource("2_f04cf") - -[node name="Window3" type="CSGBox3D" parent="EntranceHall/Blockout/CenterCashier/Room" index="5" unique_id=1044909127] -transform = Transform3D(0, 0, -0.99999994, 0, 1, 0, 0.99999994, 0, 0, 0, 1.95, 0) -operation = 2 -size = Vector3(1.5, 2, 12) -material = ExtResource("2_f04cf") - -[node name="Window4" type="CSGBox3D" parent="EntranceHall/Blockout/CenterCashier/Room" index="6" unique_id=2033585943] -transform = Transform3D(-0.70710665, 0, -0.70710665, 0, 1, 0, 0.70710665, 0, -0.70710665, 0, 1.95, 0) -operation = 2 -size = Vector3(1.5, 2, 12) -material = ExtResource("2_f04cf") - -[node name="Dome" type="CSGCombiner3D" parent="EntranceHall/Blockout" index="3" unique_id=949578487] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 19, 0) - -[node name="Sphere" type="CSGSphere3D" parent="EntranceHall/Blockout/Dome" index="0" unique_id=796313331] -radius = 13.0 -radial_segments = 24 -material = SubResource("StandardMaterial3D_wtnit") - -[node name="DomeDetails" type="CSGCombiner3D" parent="EntranceHall/Blockout/Dome" index="1" unique_id=1959193638] - -[node name="Torus" type="CSGTorus3D" parent="EntranceHall/Blockout/Dome/DomeDetails" index="0" unique_id=1458632213] -transform = Transform3D(1, 0, 0, 0, 2.9802322e-08, -1, 0, 1, 2.9802322e-08, 0, 0, 0) -inner_radius = 13.075 -outer_radius = 14.0 -sides = 24 -material = ExtResource("3_en67y") - -[node name="Torus2" type="CSGTorus3D" parent="EntranceHall/Blockout/Dome/DomeDetails" index="1" unique_id=778282688] -transform = Transform3D(0.70710677, -0.70710677, -2.1073424e-08, 0, 2.9802322e-08, -1, 0.70710677, 0.70710677, 2.1073424e-08, 0, 0, 0) -inner_radius = 13.075 -outer_radius = 14.0 -sides = 24 -material = ExtResource("3_en67y") - -[node name="Torus3" type="CSGTorus3D" parent="EntranceHall/Blockout/Dome/DomeDetails" index="2" unique_id=793102935] -transform = Transform3D(0, -0.99999994, -2.980232e-08, 0, 2.9802322e-08, -1, 0.99999994, 0, 0, 0, 0, 0) -inner_radius = 13.075 -outer_radius = 14.0 -sides = 24 -material = ExtResource("3_en67y") - -[node name="Torus4" type="CSGTorus3D" parent="EntranceHall/Blockout/Dome/DomeDetails" index="3" unique_id=357788534] -transform = Transform3D(-0.70710665, -0.70710665, -2.107342e-08, 0, 2.9802322e-08, -1, 0.70710665, -0.70710665, -2.107342e-08, 0, 0, 0) -inner_radius = 13.075 -outer_radius = 14.0 -sides = 24 -material = ExtResource("3_en67y") - -[node name="TopTorus" type="CSGTorus3D" parent="EntranceHall/Blockout/Dome/DomeDetails" index="4" unique_id=1057763023] -transform = Transform3D(0.9999998, 0, 0, 0, 0.9999998, 0, 0, 0, 1, 0, 12.263981, 0) -inner_radius = 5.0 -outer_radius = 6.0 -sides = 24 -material = ExtResource("3_en67y") - -[node name="TorusCutoff" type="CSGSphere3D" parent="EntranceHall/Blockout/Dome/DomeDetails" index="5" unique_id=1278980607] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 14.358425, 0) -operation = 2 -radius = 5.6310983 -radial_segments = 24 -material = ExtResource("3_en67y") - -[node name="LowerCutoff" type="CSGBox3D" parent="EntranceHall/Blockout/Dome" index="2" unique_id=2066422133] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -7.25, 0) -operation = 2 -size = Vector3(29, 14.5, 28) -material = SubResource("StandardMaterial3D_wtnit") - -[node name="FrontWall" type="CSGBox3D" parent="EntranceHall/Blockout" index="4" unique_id=767189909] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, 19.5) -size = Vector3(40, 18, 1) -material = ExtResource("4_8xmty") - -[node name="DoorCutLeft" type="CSGBox3D" parent="EntranceHall/Blockout/FrontWall" index="0" unique_id=787685923] -transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 2.5, -7.5, 0) -operation = 2 -size = Vector3(2, 2, 3) -material = ExtResource("2_f04cf") - -[node name="DoorCutLeft2" type="CSGBox3D" parent="EntranceHall/Blockout/FrontWall" index="1" unique_id=1636072458] -transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, -2.5, -7.5, 0) -operation = 2 -size = Vector3(2, 2, 3) -material = ExtResource("2_f04cf") - -[node name="CSGCylinder3D" type="CSGCylinder3D" parent="EntranceHall/Blockout/FrontWall" index="2" unique_id=1660686906] -transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, -9, 0) -operation = 2 -radius = 11.0 -sides = 18 -material = ExtResource("2_f04cf") - -[node name="LowerCutoff" type="CSGBox3D" parent="EntranceHall/Blockout/FrontWall/CSGCylinder3D" index="0" unique_id=1970869844] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -5.25) -operation = 2 -size = Vector3(25, 1, 12.5) -material = ExtResource("2_f04cf") - -[node name="BackWall" type="CSGCombiner3D" parent="EntranceHall/Blockout" index="5" unique_id=1852128943] - -[node name="Box" type="CSGBox3D" parent="EntranceHall/Blockout/BackWall" index="0" unique_id=651549013] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -12.75, 10, -19.5) -size = Vector3(14.5, 18, 1) -material = ExtResource("4_8xmty") - -[node name="Box2" type="CSGBox3D" parent="EntranceHall/Blockout/BackWall" index="1" unique_id=762610247] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12.75, 10, -19.5) -size = Vector3(14.5, 18, 1) -material = ExtResource("4_8xmty") - -[node name="Box3" type="CSGBox3D" parent="EntranceHall/Blockout/BackWall" index="2" unique_id=1251599122] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 17, -19.5) -size = Vector3(11, 4, 1) -material = ExtResource("4_8xmty") - -[node name="RightWall" type="CSGCombiner3D" parent="EntranceHall/Blockout" index="6" unique_id=427128707] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 20.5, 1, 0) - -[node name="Box" type="CSGBox3D" parent="EntranceHall/Blockout/RightWall" index="0" unique_id=156076418] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 9, 0) -size = Vector3(1, 18, 40) -material = ExtResource("4_8xmty") - -[node name="SecondEntranceHall" type="Node3D" parent="." index="6" unique_id=282414961] - -[node name="Blockout" type="CSGCombiner3D" parent="SecondEntranceHall" index="0" unique_id=1024650246] -use_collision = true - -[node name="Floor" type="CSGBox3D" parent="SecondEntranceHall/Blockout" index="0" unique_id=315162571] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -28) -size = Vector3(40, 1, 16) -material = ExtResource("3_gdn1s") - -[node name="Walls" type="CSGCombiner3D" parent="SecondEntranceHall/Blockout" index="1" unique_id=740998809] - -[node name="BackWall" type="CSGBox3D" parent="SecondEntranceHall/Blockout/Walls" index="0" unique_id=1051803353] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10, -42.5) -size = Vector3(40, 18, 13) -material = ExtResource("4_8xmty") - -[node name="RightWall" type="CSGBox3D" parent="SecondEntranceHall/Blockout/Walls" index="1" unique_id=1843712677] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 20.5, 10, -28.5) -size = Vector3(1, 18, 17) -material = ExtResource("4_8xmty") - -[node name="DoorHole" type="CSGBox3D" parent="SecondEntranceHall/Blockout/Walls" index="2" unique_id=1089314270] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, -36.5) -operation = 2 -size = Vector3(1, 2, 1) -material = ExtResource("4_8xmty") - -[node name="HologramStage" type="CSGBox3D" parent="SecondEntranceHall/Blockout/Walls" index="3" unique_id=1899767208] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 12.5, -38.5) -operation = 2 -size = Vector3(17, 11, 5) -material = ExtResource("4_8xmty") - -[node name="godot_plush V2" parent="." index="7" unique_id=1756431274 instance=ExtResource("8_qm8ha")] -transform = Transform3D(-50, 0, 4.371139e-06, 0, 50, 0, -4.371139e-06, 0, -50, 0, 5.628097, 0) - -[node name="godot_plush_01" parent="godot_plush V2" index="0" unique_id=1349065114] -visible = false - -[node name="godot_plush_sitted" parent="godot_plush V2" index="1" unique_id=1735494843] -visible = false - -[node name="godot_plush_02" parent="godot_plush V2" index="2" unique_id=460556493] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0025618896, 0) - -[node name="Objects" type="Node3D" parent="." index="8" unique_id=249052389] - -[node name="FlashlightBattery" parent="Objects" index="0" unique_id=1021450063 node_paths=PackedStringArray("world", "manager") instance=ExtResource("9_n68sy")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.39999998, 2.0499978, 5.8) -world = NodePath("../..") -manager = NodePath("../../PlayerCharacter/FlashlightManager") - -[node name="FlashlightBattery2" parent="Objects" index="1" unique_id=1280919267 node_paths=PackedStringArray("world", "manager") instance=ExtResource("9_n68sy")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.19999997, 2.0499978, 5.8) -world = NodePath("../..") -manager = NodePath("../../PlayerCharacter/FlashlightManager") - -[node name="FlashlightBattery3" parent="Objects" index="2" unique_id=180006569 node_paths=PackedStringArray("world", "manager") instance=ExtResource("9_n68sy")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.9802322e-08, 2.0499978, 5.8) -world = NodePath("../..") -manager = NodePath("../../PlayerCharacter/FlashlightManager") - -[node name="FlashlightBattery4" parent="Objects" index="3" unique_id=2057837844 node_paths=PackedStringArray("world", "manager") instance=ExtResource("9_n68sy")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.10000003, 2.0499978, 5.8) -world = NodePath("../..") -manager = NodePath("../../PlayerCharacter/FlashlightManager") - -[node name="FlashlightBattery5" parent="Objects" index="4" unique_id=1599096313 node_paths=PackedStringArray("world", "manager") instance=ExtResource("9_n68sy")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.30000004, 2.0499978, 5.8) -world = NodePath("../..") -manager = NodePath("../../PlayerCharacter/FlashlightManager") -refill_amount = 1.0 - -[node name="FlashlightBattery6" parent="Objects" index="5" unique_id=1386160339 node_paths=PackedStringArray("world", "manager") instance=ExtResource("9_n68sy")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.50000006, 2.0499978, 5.8) -world = NodePath("../..") -manager = NodePath("../../PlayerCharacter/FlashlightManager") -refill_amount = 0.5 - -[node name="LogicCluster" type="Node3D" parent="Objects" index="6" unique_id=556526856 node_paths=PackedStringArray("world", "doors_animation_player")] -transform = Transform3D(1.0000001, 0, 0, 0, 1, 0, 0, 0, 1.0000001, 0, 0, 0) -script = ExtResource("10_btgc1") -world = NodePath("../..") -doors_animation_player = NodePath("../../EntranceHall/Doors/AnimationPlayer") - -[node name="Cutscene" type="Node3D" parent="Objects/LogicCluster" index="0" unique_id=970055626] - -[node name="EndAlignment" type="Marker3D" parent="Objects/LogicCluster/Cutscene" index="0" unique_id=399304482] -transform = Transform3D(1.0000001, 0, 0, 0, 1, 0, 0, 0, 1.0000001, 0, 1, -5) -top_level = true - -[node name="PowerBoxAnimation" type="AnimationPlayer" parent="Objects/LogicCluster/Cutscene" index="1" unique_id=426856812 node_paths=PackedStringArray("camera", "player", "end_alignment")] -root_node = NodePath("../../PowerBoxFuse") -libraries/ = SubResource("AnimationLibrary_map4s") -next/activated = &"animation_end" -script = ExtResource("11_map4s") -camera = NodePath("../Camera3D") -player = NodePath("../../../../PlayerCharacter") -end_alignment = NodePath("../EndAlignment") -cutscene_animation = &"activated" -metadata/_custom_type_script = "uid://y1nxrfv31pke" - -[node name="Camera3D" type="Camera3D" parent="Objects/LogicCluster/Cutscene" index="2" unique_id=297973960] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, -5) -top_level = true -fov = 65.0 - -[node name="PowerBoxFuse" parent="Objects/LogicCluster" index="1" unique_id=1951712625 node_paths=PackedStringArray("world") instance=ExtResource("10_xp6ux")] -transform = Transform3D(0.96592575, 0, 0.25881898, 0, 1, 0, -0.25881898, 0, 0.96592575, -1.2618543, 2.5, -5.657638) -world = NodePath("../../..") - -[node name="FusePickup" parent="Objects/LogicCluster" index="2" unique_id=38269817 node_paths=PackedStringArray("power_box", "world") instance=ExtResource("11_qm8ha")] -transform = Transform3D(0.9999998, 0, 0, 0, 1, 0, 0, 0, 0.9999998, -4.2999997, 2.0499978, -3.9999995) -power_box = NodePath("../PowerBoxFuse") -world = NodePath("../../..") - -[node name="Triggers" type="Node3D" parent="." index="9" unique_id=1343544739] - -[node name="FlashlightTrigger" parent="Triggers" index="0" unique_id=1379952044 node_paths=PackedStringArray("world", "manager", "allowed_bodies") instance=ExtResource("10_dy1qy")] -world = NodePath("../..") -manager = NodePath("../../PlayerCharacter/FlashlightManager") -allowed_bodies = [NodePath("../../PlayerCharacter")] -change_manager_drain_mode = true -manager_drain_mode = 1 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="Triggers/FlashlightTrigger" index="0" unique_id=858698798] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 13.200001, 2.4, 0) -shape = SubResource("BoxShape3D_dy1qy") - -[node name="FlashlightTrigger2" parent="Triggers" index="1" unique_id=275007123 node_paths=PackedStringArray("world", "manager", "allowed_bodies") instance=ExtResource("10_dy1qy")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14, 0, -23) -world = NodePath("../..") -manager = NodePath("../../PlayerCharacter/FlashlightManager") -allowed_bodies = [NodePath("../../PlayerCharacter")] -trigger_once = false -drain_mode = 1 -change_manager_drain_mode = true - -[node name="CollisionShape3D" type="CollisionShape3D" parent="Triggers/FlashlightTrigger2" index="0" unique_id=1259939989] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 13.200001, 2.4, 0) -shape = SubResource("BoxShape3D_dy1qy") - -[node name="ChaseTest" parent="." index="10" unique_id=1255206756 instance=ExtResource("14_264wa")] -transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -20.5, 0, 8.9608346e-07) - -[node name="PauseMenu" parent="." index="11" unique_id=90120455 node_paths=PackedStringArray("world") instance=ExtResource("2_yht7d")] -visible = false -world = NodePath("..") - -[editable path="godot_plush V2"] diff --git a/game/tools/debug_outline.gdshader b/game/tools/debug_outline.gdshader new file mode 100644 index 0000000..971eb57 --- /dev/null +++ b/game/tools/debug_outline.gdshader @@ -0,0 +1,44 @@ +shader_type spatial; +render_mode unshaded, cull_disabled; + +// From ChatGPT since I'm not that good at shaders (and for a debug visualizer it's okay). + +uniform vec4 base_color : source_color = vec4(0.3, 1.0, 0.3, 0.12); +uniform vec4 edge_color : source_color = vec4(1.0, 1.0, 0.5, 0.7); + +uniform float edge_power = 2.0; + +instance uniform vec3 box_center; +instance uniform vec3 box_extents; + +void fragment() { + // Fresnel edge factor (works from inside + outside) + float ndv = abs(dot(NORMAL, VIEW)); + float fresnel = pow(1.0 - ndv, edge_power); + fresnel = clamp(fresnel + 0.15, 0.0, 1.0); + + // Subtle face shading for depth cues + float lighting = dot(NORMAL, vec3(0.3, 0.7, 0.6)) * 0.5 + 0.5; + + // Camera distance to box center + vec3 cam_to_center = CAMERA_POSITION_WORLD - box_center; + float cam_dist = length(cam_to_center); + + // Normalize distance (tweak as needed) + float cam_proximity = clamp(1.0 - cam_dist / 100.0, 0.0, 1.0); + + // Camera-based tint (blue far → red near) + vec3 cam_tint = mix(vec3(0.2, 0.6, 1.0), vec3(1.0, 0.3, 0.2), cam_proximity); + + // Base color + edge highlight + vec3 color = mix(base_color.rgb, edge_color.rgb, fresnel); + color *= lighting; + + // Subtle camera-based tint + color = mix(color, cam_tint, 0.2 * cam_proximity); + + float alpha = mix(base_color.a, edge_color.a, fresnel); + + ALBEDO = color; + ALPHA = alpha; +} \ No newline at end of file diff --git a/game/tools/debug_outline.gdshader.uid b/game/tools/debug_outline.gdshader.uid new file mode 100644 index 0000000..81245b1 --- /dev/null +++ b/game/tools/debug_outline.gdshader.uid @@ -0,0 +1 @@ +uid://b3d0qp0pjfhmk diff --git a/game/tools/debug_outline_material.tres b/game/tools/debug_outline_material.tres new file mode 100644 index 0000000..7b100b2 --- /dev/null +++ b/game/tools/debug_outline_material.tres @@ -0,0 +1,12 @@ +[gd_resource type="ShaderMaterial" format=3 uid="uid://cmsdf0apnwvpd"] + +[ext_resource type="Shader" uid="uid://b3d0qp0pjfhmk" path="res://tools/debug_outline.gdshader" id="1_3pgam"] + +[resource] +render_priority = 0 +shader = ExtResource("1_3pgam") +shader_parameter/base_color = Color(0.3, 1, 0.3, 0.15) +shader_parameter/edge_color = Color(1, 1, 0.3, 0.8) +shader_parameter/edge_power = 3.0 +shader_parameter/box_center = Vector3(0, 0, 0) +shader_parameter/box_extents = Vector3(0, 0, 0)