diff --git a/addons/proton_scatter/cache/house_big_10774354_scatter_cache.res b/addons/proton_scatter/cache/house_big_10774354_scatter_cache.res index 875af07..406cd15 100644 Binary files a/addons/proton_scatter/cache/house_big_10774354_scatter_cache.res and b/addons/proton_scatter/cache/house_big_10774354_scatter_cache.res differ diff --git a/meshes/interior/Chandelier.gltf.import b/meshes/interior/Chandelier.gltf.import index 2aaf22f..2a71547 100644 --- a/meshes/interior/Chandelier.gltf.import +++ b/meshes/interior/Chandelier.gltf.import @@ -32,6 +32,12 @@ animation/trimming=false animation/remove_immutable_tracks=true animation/import_rest_as_RESET=false import_script/path="" -_subresources={} +_subresources={ +"nodes": { +"PATH:Chandelier": { +"mesh_instance/cast_shadow": 0 +} +} +} gltf/naming_version=1 gltf/embedded_image_handling=1 diff --git a/project.godot b/project.godot index 37cc13b..3061163 100644 --- a/project.godot +++ b/project.godot @@ -20,6 +20,10 @@ config/icon="res://icon.svg" window/size/viewport_width=1920 window/size/viewport_height=1080 +[editor] + +movie_writer/mjpeg_quality=0.9 + [editor_plugins] enabled=PackedStringArray("res://addons/portals/plugin.cfg", "res://addons/proton_scatter/plugin.cfg") diff --git a/scenes/house_big.tscn b/scenes/house_big.tscn index 677a78a..24323ca 100644 --- a/scenes/house_big.tscn +++ b/scenes/house_big.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=72 format=3 uid="uid://clxuoprslq8em"] +[gd_scene load_steps=73 format=3 uid="uid://clxuoprslq8em"] [ext_resource type="Script" uid="uid://4nvvgle511m4" path="res://scripts/house_big.gd" id="1_158ph"] [ext_resource type="PackedScene" uid="uid://wsu3b5udqtdu" path="res://meshes/village/Wall_UnevenBrick_Straight.gltf" id="1_p6qno"] @@ -53,6 +53,7 @@ [ext_resource type="PackedScene" uid="uid://ghgretojabc1" path="res://meshes/interior/Vase_4.gltf" id="40_4hat2"] [ext_resource type="PackedScene" uid="uid://co7ijbeyonv5" path="res://meshes/interior/Book_5.gltf" id="41_u6m7x"] [ext_resource type="PackedScene" uid="uid://d1imd6qqtgy2e" path="res://meshes/village/Stair_Interior_Rails.gltf" id="42_isn6p"] +[ext_resource type="PackedScene" uid="uid://c3myqiuhgghyo" path="res://meshes/interior/Lantern_Wall.gltf" id="54_nrbqc"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dss4m"] albedo_color = Color(0.448364, 0.428649, 0.0977373, 1) @@ -549,26 +550,30 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.9, 6, -3.5) [node name="OmniLight3D" type="OmniLight3D" parent="WallsAndShit/Chandelier2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0676376, -0.834157, 0.600262) light_color = Color(0.860136, 0.848595, 0.752131, 1) -light_energy = 0.961 -omni_range = 5.751 +light_energy = 0.576 +shadow_enabled = true +omni_range = 6.338 [node name="OmniLight3D2" type="OmniLight3D" parent="WallsAndShit/Chandelier2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0676376, -0.834157, -0.548677) light_color = Color(0.860136, 0.848595, 0.752131, 1) -light_energy = 0.961 -omni_range = 5.751 +light_energy = 0.576 +shadow_enabled = true +omni_range = 6.338 [node name="OmniLight3D3" type="OmniLight3D" parent="WallsAndShit/Chandelier2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.632596, -0.834157, -0.00643849) light_color = Color(0.860136, 0.848595, 0.752131, 1) -light_energy = 0.961 -omni_range = 5.751 +light_energy = 0.576 +shadow_enabled = true +omni_range = 6.338 [node name="OmniLight3D4" type="OmniLight3D" parent="WallsAndShit/Chandelier2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.572049, -0.834157, 0.00770402) light_color = Color(0.860136, 0.848595, 0.752131, 1) -light_energy = 0.961 -omni_range = 5.751 +light_energy = 0.576 +shadow_enabled = true +omni_range = 6.338 [node name="Bed_Twin12" parent="WallsAndShit" instance=ExtResource("21_77p6n")] transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -5.6, 0.3, -0.7) @@ -765,6 +770,19 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.60376, 0.0895298, -6.71063) [node name="Stair_Interior_Rails2" parent="WallsAndShit" instance=ExtResource("42_isn6p")] transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -0.185164, 0.0756873, -6.01873) +[node name="Lantern_Wall2" parent="WallsAndShit" instance=ExtResource("54_nrbqc")] +transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -6.2387, 6.11833, -3.1478) + +[node name="OmniLight3D" type="OmniLight3D" parent="WallsAndShit/Lantern_Wall2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.310703, 0.836766) +light_color = Color(0.873324, 0.836156, 0.57236, 1) +light_energy = 0.346 +light_size = 0.031 +light_bake_mode = 1 +shadow_blur = 2.971 +omni_range = 6.692 +omni_attenuation = 0.486 + [node name="NecessaryColliders" type="StaticBody3D" parent="."] [node name="BalconyGround" type="CollisionShape3D" parent="NecessaryColliders"] diff --git a/scenes/world.tscn b/scenes/world.tscn index a55f72b..c837eac 100644 --- a/scenes/world.tscn +++ b/scenes/world.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=30 format=4 uid="uid://dtbrnxalat1d4"] +[gd_scene load_steps=29 format=4 uid="uid://dtbrnxalat1d4"] [ext_resource type="PackedScene" uid="uid://wsu3b5udqtdu" path="res://meshes/village/Wall_UnevenBrick_Straight.gltf" id="1_4mrxx"] [ext_resource type="Texture2D" uid="uid://bgc5rl13dopuj" path="res://addons/proton_scatter/demos/assets/textures/sky_2.png" id="1_w7kh3"] @@ -12,9 +12,10 @@ [ext_resource type="PackedScene" uid="uid://v2td8h7kmqic" path="res://meshes/interior/Bed_Twin2.gltf" id="13_7t5mc"] [ext_resource type="Script" uid="uid://cw1r4c1d7beyv" path="res://addons/portals/scripts/portal_3d.gd" id="13_xo05s"] [ext_resource type="Material" uid="uid://dcfkcyddxkglf" path="res://addons/portals/materials/editor-preview-portal-material.tres" id="14_dss4m"] +[ext_resource type="Script" uid="uid://d2eiwbv6c3kcq" path="res://scripts/door_opener.gd" id="14_lakw3"] [ext_resource type="Script" uid="uid://bxcel82b180o3" path="res://addons/portals/scripts/portal_boxmesh.gd" id="15_7t5mc"] [ext_resource type="PackedScene" uid="uid://clxuoprslq8em" path="res://scenes/house_big.tscn" id="16_dss4m"] -[ext_resource type="Script" uid="uid://co2pjpdo4nyto" path="res://scripts/cinematic_camera.gd" id="18_lakw3"] +[ext_resource type="Script" uid="uid://d2crarvkhd45r" path="res://scripts/player.gd" id="17_7t5mc"] [ext_resource type="PackedScene" uid="uid://dc4ynch2n1ish" path="res://meshes/village/Roof_RoundTiles_4x4.gltf" id="22_kpybi"] [ext_resource type="PackedScene" uid="uid://b7mjoyryltilk" path="res://meshes/village/Roof_Front_Brick4.gltf" id="23_ctatt"] @@ -33,9 +34,11 @@ ambient_light_color = Color(0.939669, 0.875855, 0.802177, 1) ambient_light_energy = 0.2 tonemap_mode = 3 ssao_enabled = true -ssao_intensity = 5.0 +ssao_power = 0.75 +ssil_enabled = true fog_density = 0.0051 fog_sky_affect = 0.23 +adjustment_enabled = true [sub_resource type="BoxShape3D" id="BoxShape3D_q5onr"] size = Vector3(1.83496, 2.19373, 1.46497) @@ -78,19 +81,12 @@ size = Vector3(1.5, 2.5, 1) [sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_dss4m"] -[sub_resource type="SphereMesh" id="SphereMesh_lakw3"] - -[sub_resource type="Curve3D" id="Curve3D_lakw3"] -_data = { -"points": PackedVector3Array(2.30277, -4.88758e-05, 0.023995, -2.30277, 4.88758e-05, -0.023995, -6.02108, -1.2, -0.757503, 0.560486, 0.0225506, -0.115429, -0.560486, -0.0225506, 0.115429, -13.1853, -1.19995, -0.866791, 0.927, 0, -0.921, -0.927, 0, 0.921, -14.415, -1.2, 0.789, 1.07875, -0.421236, 0.749314, -1.07875, 0.421236, -0.749314, -17.8179, -0.94087, 1.55712, -0.0384521, -0.479881, 1.02453, 0.0384521, 0.479881, -1.02453, -18.2686, 0.298787, -0.965812, -5.40546, 0.0544367, -0.106041, 5.40546, -0.0544367, 0.106041, -12.8151, 1.96112, -3.85685), -"tilts": PackedFloat32Array(0, 0, 0, 0, 0, 0) -} -point_count = 6 - -[sub_resource type="Curve3D" id="Curve3D_7t5mc"] +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_dss4m"] +radius = 0.2 +height = 1.75 [node name="World" type="Node3D"] -metadata/movie_file = "captures/b_.png" +metadata/movie_file = "captures/f_.avi" [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_o8fc1") @@ -186,6 +182,7 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 3.1, 0 collision_layer = 0 collision_mask = 2 monitorable = false +script = ExtResource("14_lakw3") [node name="CollisionShape3D" type="CollisionShape3D" parent="DoorOpener"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.05282, 0.739908) @@ -237,7 +234,7 @@ _teleport_area_path = NodePath("TeleportArea") _teleport_collider_path = NodePath("TeleportArea/Collider") portal_size = Vector2(1.5, 2.5) exit_portal = NodePath("../PortalSmall") -portal_frame_width = 0.0 +portal_frame_width = 1.0 viewport_size_mode = 0 view_direction = 1 portal_render_layer = 524288 @@ -268,36 +265,18 @@ shape = SubResource("BoxShape3D_7t5mc") [node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"] shape = SubResource("WorldBoundaryShape3D_dss4m") -[node name="CinematicCamera" type="Camera3D" parent="." node_paths=PackedStringArray("path", "target")] -cull_mask = 524287 -current = true -script = ExtResource("18_lakw3") -travel_time = 15.0 -path = NodePath("../B_Camera") -target = NodePath("../Target") +[node name="CharacterBody3D" type="CharacterBody3D" parent="." node_paths=PackedStringArray("camera")] +transform = Transform3D(-0.524357, 0, 0.851498, 0, 1, 0, -0.851498, 0, -0.524357, 10.6968, 1.36224, -8.3989) +collision_layer = 3 +script = ExtResource("17_7t5mc") +camera = NodePath("Camera3D") +metadata/_edit_group_ = true -[node name="Target" type="MeshInstance3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 996.473, 0.638, -2.74) -layers = 524288 -mesh = SubResource("SphereMesh_lakw3") +[node name="Camera3D" type="Camera3D" parent="CharacterBody3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.925, 0) -[node name="A_FlyAround" type="Path3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 15.0132, 3, -2.29886) -curve = SubResource("Curve3D_lakw3") - -[node name="PathFollow3D" type="PathFollow3D" parent="A_FlyAround"] -transform = Transform3D(0.0104181, 2.12225e-05, 0.999827, 0, 0.999999, -2.12211e-05, -0.999827, 2.21137e-07, 0.0104181, -6.02108, -1.2, -0.757503) - -[node name="B_Camera" type="Path3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1015.01, 3, -2.299) -curve = SubResource("Curve3D_lakw3") - -[node name="PathFollow3D" type="PathFollow3D" parent="B_Camera"] -transform = Transform3D(0.0104181, 2.12225e-05, 0.999827, 0, 0.999999, -2.12211e-05, -0.999827, 2.21137e-07, 0.0104181, -6.02108, -1.2, -0.757503) - -[node name="B_Target" type="Path3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 996.473, 0.638, -2.74) -curve = SubResource("Curve3D_7t5mc") +[node name="CollisionShape3D" type="CollisionShape3D" parent="CharacterBody3D"] +shape = SubResource("CapsuleShape3D_dss4m") [connection signal="body_entered" from="DoorOpener" to="House_Small/PortalDoor" method="open"] [connection signal="body_entered" from="DoorOpener" to="HouseBig" method="open_door"] diff --git a/scripts/door_opener.gd b/scripts/door_opener.gd new file mode 100644 index 0000000..bc2a5ce --- /dev/null +++ b/scripts/door_opener.gd @@ -0,0 +1,6 @@ +extends Area3D + + +func _process(delta: float) -> void: + if Input.is_key_pressed(KEY_E): + body_entered.emit(null) diff --git a/scripts/door_opener.gd.uid b/scripts/door_opener.gd.uid new file mode 100644 index 0000000..7a5c553 --- /dev/null +++ b/scripts/door_opener.gd.uid @@ -0,0 +1 @@ +uid://d2eiwbv6c3kcq diff --git a/scripts/player.gd b/scripts/player.gd index 536ec9a..2fa9186 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -30,37 +30,51 @@ func _process(delta: float) -> void: rotation.y = lerp_angle(rotation.y, target_rotation.y, delta * ROTATION_SPEED) camera.rotation.x = lerp_angle(camera.rotation.x, target_rotation.x, delta * ROTATION_SPEED) - -func _physics_process(delta: float) -> void: - var right: Vector3 = (global_transform.basis.x * Vector3(1, 0, 1)).normalized() - var forward: Vector3 = (-global_transform.basis.z * Vector3(1, 0, 1)).normalized() - var has_input = false - velocity.x = 0 - velocity.z = 0 +const ACCELERATION := 10.0 +const DECELERATION := 6.0 + +var input_direction := Vector3.ZERO +var target_velocity := Vector3.ZERO + +func _get_input_direction() -> Vector3: + var direction := Vector3.ZERO if Input.is_key_pressed(KEY_LEFT) or Input.is_key_pressed(KEY_A): - has_input = true - velocity -= right + direction.x -= 1 if Input.is_key_pressed(KEY_RIGHT) or Input.is_key_pressed(KEY_D): - has_input = true - velocity += right + direction.x += 1 if Input.is_key_pressed(KEY_UP) or Input.is_key_pressed(KEY_W): - has_input = true - velocity += forward + direction.z += 1 if Input.is_key_pressed(KEY_DOWN) or Input.is_key_pressed(KEY_S): - has_input = true - velocity -= forward + direction.z -= 1 + return direction.normalized() + +func _physics_process(delta: float) -> void: + # Get input direction relative to player orientation + input_direction = _get_input_direction() - if has_input: - var normalized_horizontal_velocity = Vector2(velocity.x, velocity.z).normalized() - velocity.x = normalized_horizontal_velocity.x * SPEED - velocity.z = normalized_horizontal_velocity.y * SPEED + var basis := global_transform.basis + var forward := -basis.z.normalized() + var right := basis.x.normalized() + # Desired horizontal movement direction in world space + var desired_velocity : Vector3 = (right * input_direction.x + forward * input_direction.z) * SPEED + desired_velocity.y = 0 # Only horizontal + + # Smooth acceleration/deceleration + var accel := DECELERATION if input_direction == Vector3.ZERO else ACCELERATION + target_velocity.x = lerp(target_velocity.x, desired_velocity.x, accel * delta) + target_velocity.z = lerp(target_velocity.z, desired_velocity.z, accel * delta) + + # Preserve existing vertical velocity if not is_on_floor(): - velocity += get_gravity() * delta - - if Input.is_action_just_pressed("ui_accept") and is_on_floor(): - velocity.y = JUMP_VELOCITY + target_velocity.y += get_gravity().y * delta + else: + target_velocity.y = 0 + if Input.is_action_just_pressed("ui_accept"): + target_velocity.y = JUMP_VELOCITY + # Apply movement + velocity = target_velocity move_and_slide()