Feat/14 movement overhaul #20

Merged
Dotts merged 86 commits from feat/14-movement-overhaul into main 2026-07-17 10:44:23 -07:00
6 changed files with 15 additions and 16 deletions
Showing only changes of commit 462d12bee5 - Show all commits
+4 -5
View File
@@ -60,7 +60,7 @@ func _build_geometry() -> void:
_build_outer_walls() _build_outer_walls()
_build_central_structure() _build_central_structure()
_build_corner_towers() _build_corner_towers()
-build_elevated_walkways() _build_elevated_walkways()
_build_ramps() _build_ramps()
_build_stepping_stones() _build_stepping_stones()
_build_wall_run_surfaces() _build_wall_run_surfaces()
@@ -151,7 +151,6 @@ func _build_environment() -> void:
environment.fog_enabled = true environment.fog_enabled = true
environment.fog_light_color = Color(0.45, 0.48, 0.55) environment.fog_light_color = Color(0.45, 0.48, 0.55)
environment.fog_density = 0.003 environment.fog_density = 0.003
environment.fog_sky_affinity = 0.5
env.environment = environment env.environment = environment
add_child(env) add_child(env)
@@ -374,7 +373,7 @@ func _build_grapple_anchors() -> void:
Vector3(0, 0, 30), Vector3(0, 0, 30),
] ]
for i in range(pillar_positions.size()): for i in range(pillar_positions.size()):
var pos := pillar_positions[i] var pos: Vector3 = pillar_positions[i]
# Pillar shaft (15u tall) # Pillar shaft (15u tall)
_box_static(pos + Vector3(0, 7.5, 0), Vector3(2, 15, 2), C_METAL, "GrapplePillar_%d" % i) _box_static(pos + Vector3(0, 7.5, 0), Vector3(2, 15, 2), C_METAL, "GrapplePillar_%d" % i)
# Pillar top (grapple target marker) # Pillar top (grapple target marker)
@@ -689,7 +688,7 @@ func _spawn_player(pid: int) -> CharacterBody3D:
player.add_child(col_shape) player.add_child(col_shape)
# Apply movement controller script # Apply movement controller script
var mover_script = preload("res://movement/player_movement_controller.gd") var mover_script = load("res://movement/player_movement_controller.gd")
if mover_script: if mover_script:
player.set_script(mover_script) player.set_script(mover_script)
@@ -1066,7 +1065,7 @@ func _process(_delta: float) -> void:
if "weapon_name" in active_weapon: if "weapon_name" in active_weapon:
w_name = active_weapon.weapon_name w_name = active_weapon.weapon_name
elif active_weapon is DoubleBarrelShotgun: elif active_weapon.get("weapon_name") == null and "shells" in active_weapon:
w_name = "Double Barrel Shotgun" w_name = "Double Barrel Shotgun"
if "current_ammo" in active_weapon: if "current_ammo" in active_weapon:
+3 -3
View File
@@ -226,7 +226,7 @@ func detect_wall_horizontal() -> Vector3:
continue continue
var n: Vector3 = hit.get("normal", Vector3.ZERO) var n: Vector3 = hit.get("normal", Vector3.ZERO)
# Wall must be roughly vertical (normal mostly horizontal) # Wall must be roughly vertical (normal mostly horizontal)
if absf(n.y) < 0.3 and n.length_squared() > 0.0: if abs(n.y) < 0.3 and n.length_squared() > 0.0:
wall_normal = n.normalized() wall_normal = n.normalized()
wall_side = side_data["side"] wall_side = side_data["side"]
return wall_normal return wall_normal
@@ -246,7 +246,7 @@ func detect_wall_horizontal() -> Vector3:
if collider is PlayerMovementController or collider is CharacterBody3D or collider.has_method("take_damage"): if collider is PlayerMovementController or collider is CharacterBody3D or collider.has_method("take_damage"):
continue continue
var n: Vector3 = hit.get("normal", Vector3.ZERO) var n: Vector3 = hit.get("normal", Vector3.ZERO)
if absf(n.y) < 0.3 and n.length_squared() > 0.0: if abs(n.y) < 0.3 and n.length_squared() > 0.0:
wall_normal = n.normalized() wall_normal = n.normalized()
wall_side = side_data["side"] wall_side = side_data["side"]
return wall_normal return wall_normal
@@ -294,7 +294,7 @@ func detect_wall_forward() -> Dictionary:
return {"hit": false, "normal": Vector3.ZERO, "is_short": false} return {"hit": false, "normal": Vector3.ZERO, "is_short": false}
var normal: Vector3 = best_hit.get("normal", Vector3.ZERO) var normal: Vector3 = best_hit.get("normal", Vector3.ZERO)
if absf(normal.y) >= 0.3: if abs(normal.y) >= 0.3:
return {"hit": false, "normal": Vector3.ZERO, "is_short": false} # Not a vertical wall return {"hit": false, "normal": Vector3.ZERO, "is_short": false} # Not a vertical wall
# Check if wall is short (ledge check) using a top ray # Check if wall is short (ledge check) using a top ray
+1 -1
View File
@@ -1112,7 +1112,7 @@ func _throw_grenade() -> void:
var throw_vel = camera.global_transform.basis.z * -throw_speed + Vector3.UP * throw_up_speed + velocity var throw_vel = camera.global_transform.basis.z * -throw_speed + Vector3.UP * throw_up_speed + velocity
var spawn_pos = camera.global_position + camera.global_transform.basis.z * -0.5 var spawn_pos = camera.global_position + camera.global_transform.basis.z * -0.5
if multiplayer.has_multiplayer_peer() and multiplayer.multiplayer_peer is not OfflineMultiplayerPeer: if multiplayer.has_multiplayer_peer() and not (multiplayer.multiplayer_peer is OfflineMultiplayerPeer):
server_spawn_grenade.rpc_id(1, spawn_pos, throw_vel) server_spawn_grenade.rpc_id(1, spawn_pos, throw_vel)
else: else:
_spawn_grenade_local(spawn_pos, throw_vel, 1) _spawn_grenade_local(spawn_pos, throw_vel, 1)
+1 -1
View File
@@ -145,7 +145,7 @@ func update(delta: float) -> void:
# Require looking mostly along the wall (angle > 41 degrees from normal) # Require looking mostly along the wall (angle > 41 degrees from normal)
# and inputting mostly along the wall (angle > 31 degrees from normal, allows W+A/D diagonally into wall) # and inputting mostly along the wall (angle > 31 degrees from normal, allows W+A/D diagonally into wall)
if absf(h_look.dot(wall_n)) < 0.75 and absf(wish_dir.dot(wall_n)) < 0.85: if abs(h_look.dot(wall_n)) < 0.75 and abs(wish_dir.dot(wall_n)) < 0.85:
machine.switch_to("wall_run") machine.switch_to("wall_run")
return return
+2 -2
View File
@@ -96,7 +96,7 @@ func update(delta: float) -> void:
if wish_dir.length_squared() > 0.01 and not machine.input_crouch: if wish_dir.length_squared() > 0.01 and not machine.input_crouch:
for i in range(player.get_slide_collision_count()): for i in range(player.get_slide_collision_count()):
var col = player.get_slide_collision(i) var col = player.get_slide_collision(i)
if absf(col.get_normal().y) < 0.3: # Hit a wall if abs(col.get_normal().y) < 0.3: # Hit a wall
var max_step_height = 0.95 var max_step_height = 0.95
var space_state = player.get_world_3d().direct_space_state var space_state = player.get_world_3d().direct_space_state
var feet_y = player.global_position.y - (machine.original_capsule_height / 2.0) var feet_y = player.global_position.y - (machine.original_capsule_height / 2.0)
@@ -209,7 +209,7 @@ func update(delta: float) -> void:
# Require looking mostly along the wall (angle > 41 degrees from normal) # Require looking mostly along the wall (angle > 41 degrees from normal)
# and inputting mostly along the wall (angle > 31 degrees from normal, allows W+A/D diagonally into wall) # and inputting mostly along the wall (angle > 31 degrees from normal, allows W+A/D diagonally into wall)
if absf(h_look.dot(wall_n)) < 0.75 and absf(wish_dir.dot(wall_n)) < 0.85: if abs(h_look.dot(wall_n)) < 0.75 and abs(wish_dir.dot(wall_n)) < 0.85:
machine.switch_to("wall_run") machine.switch_to("wall_run")
return return
+4 -4
View File
@@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://pp1g1inidixa"] [gd_scene format=3]
[ext_resource type="Script" uid="uid://c7ltcn37gfd71" path="res://debug/test_level_builder.gd" id="1_2venv"] [ext_resource type="Script" path="res://debug/test_level_builder.gd" id="1"]
[node name="TestLevel" type="Node3D" unique_id=130984349] [node name="TestLevel" type="Node3D"]
script = ExtResource("1_2venv") script = ExtResource("1")