From f6baf3bf72ccb863239b48efe171cb1f03753d9d Mon Sep 17 00:00:00 2001 From: VinPropane Date: Sun, 5 Apr 2026 00:55:15 -0400 Subject: [PATCH] NS-23: NS-19 bump single frustum collider (fix departure edges) Replace top slab + four ramp wedges with one ConvexPolygonShape3D frustum per bump so plateau and slopes are one manifold (no collider seams at table edges when walking off). Add CharacterBody3D safe_margin to reduce edge contact with physics. --- client/scenes/main.tscn | 93 +++------------------------------------- client/scripts/player.gd | 2 +- 2 files changed, 8 insertions(+), 87 deletions(-) diff --git a/client/scenes/main.tscn b/client/scenes/main.tscn index 9c9fce8..a954d9e 100644 --- a/client/scenes/main.tscn +++ b/client/scenes/main.tscn @@ -42,44 +42,14 @@ albedo_color = Color(0.15, 0.4, 1, 1) [sub_resource type="BoxMesh" id="BoxMesh_ns19_bump_a"] size = Vector3(1, 0.15, 1) -[sub_resource type="BoxShape3D" id="BoxShape3D_ns19_bump_a"] -size = Vector3(1, 0.15, 1) - -[sub_resource type="BoxShape3D" id="BoxShape3D_ns19_bump_a_top"] -size = Vector3(1, 0.06, 1) - [sub_resource type="BoxMesh" id="BoxMesh_ns19_bump_b"] size = Vector3(0.85, 0.12, 0.85) -[sub_resource type="BoxShape3D" id="BoxShape3D_ns19_bump_b"] -size = Vector3(0.85, 0.12, 0.85) +[sub_resource type="ConvexPolygonShape3D" id="Convex_ns19a_frustum"] +points = PackedVector3Array(-0.65, -0.075, -0.65, 0.65, -0.075, -0.65, 0.65, -0.075, 0.65, -0.65, -0.075, 0.65, -0.5, 0.075, -0.5, 0.5, 0.075, -0.5, 0.5, 0.075, 0.5, -0.5, 0.075, 0.5) -[sub_resource type="BoxShape3D" id="BoxShape3D_ns19_bump_b_top"] -size = Vector3(0.85, 0.06, 0.85) - -[sub_resource type="ConvexPolygonShape3D" id="Convex_ns19a_ramp_s"] -points = PackedVector3Array(-0.5, -0.075, -0.65, 0.5, -0.075, -0.65, 0.5, -0.075, -0.5, -0.5, -0.075, -0.5, 0.5, 0.075, -0.5, -0.5, 0.075, -0.5) - -[sub_resource type="ConvexPolygonShape3D" id="Convex_ns19a_ramp_n"] -points = PackedVector3Array(-0.5, -0.075, 0.5, 0.5, -0.075, 0.5, 0.5, -0.075, 0.65, -0.5, -0.075, 0.65, 0.5, 0.075, 0.5, -0.5, 0.075, 0.5) - -[sub_resource type="ConvexPolygonShape3D" id="Convex_ns19a_ramp_e"] -points = PackedVector3Array(0.5, -0.075, -0.5, 0.65, -0.075, -0.5, 0.65, -0.075, 0.5, 0.5, -0.075, 0.5, 0.5, 0.075, 0.5, 0.5, 0.075, -0.5) - -[sub_resource type="ConvexPolygonShape3D" id="Convex_ns19a_ramp_w"] -points = PackedVector3Array(-0.65, -0.075, -0.5, -0.5, -0.075, -0.5, -0.5, -0.075, 0.5, -0.65, -0.075, 0.5, -0.5, 0.075, 0.5, -0.5, 0.075, -0.5) - -[sub_resource type="ConvexPolygonShape3D" id="Convex_ns19b_ramp_s"] -points = PackedVector3Array(-0.425, -0.06, -0.575, 0.425, -0.06, -0.575, 0.425, -0.06, -0.425, -0.425, -0.06, -0.425, 0.425, 0.06, -0.425, -0.425, 0.06, -0.425) - -[sub_resource type="ConvexPolygonShape3D" id="Convex_ns19b_ramp_n"] -points = PackedVector3Array(-0.425, -0.06, 0.425, 0.425, -0.06, 0.425, 0.425, -0.06, 0.575, -0.425, -0.06, 0.575, 0.425, 0.06, 0.425, -0.425, 0.06, 0.425) - -[sub_resource type="ConvexPolygonShape3D" id="Convex_ns19b_ramp_e"] -points = PackedVector3Array(0.425, -0.06, -0.425, 0.575, -0.06, -0.425, 0.575, -0.06, 0.425, 0.425, -0.06, 0.425, 0.425, 0.06, 0.425, 0.425, 0.06, -0.425) - -[sub_resource type="ConvexPolygonShape3D" id="Convex_ns19b_ramp_w"] -points = PackedVector3Array(-0.575, -0.06, -0.425, -0.425, -0.06, -0.425, -0.425, -0.06, 0.425, -0.575, -0.06, 0.425, -0.425, 0.06, 0.425, -0.425, 0.06, -0.425) +[sub_resource type="ConvexPolygonShape3D" id="Convex_ns19b_frustum"] +points = PackedVector3Array(-0.575, -0.06, -0.575, 0.575, -0.06, -0.575, 0.575, -0.06, 0.575, -0.575, -0.06, 0.575, -0.425, 0.06, -0.425, 0.425, 0.06, -0.425, 0.425, 0.06, 0.425, -0.425, 0.06, 0.425) [sub_resource type="BoxMesh" id="BoxMesh_ns19_pedestal"] size = Vector3(1.5, 2.5, 1.5) @@ -170,32 +140,7 @@ mesh = SubResource("BoxMesh_ns19_bump_a") surface_material_override/0 = SubResource("Mat_ns19_bump") [node name="CollisionShape3D" type="CollisionShape3D" parent="World/NavigationRegion3D/NS19BumpA" unique_id=1900003] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.045, 0) -shape = SubResource("BoxShape3D_ns19_bump_a_top") - -[node name="RampSouth" type="StaticBody3D" parent="World/NavigationRegion3D/NS19BumpA" unique_id=1900004 groups=["walkable"]] -collision_layer = 1 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="World/NavigationRegion3D/NS19BumpA/RampSouth" unique_id=1900005] -shape = SubResource("Convex_ns19a_ramp_s") - -[node name="RampNorth" type="StaticBody3D" parent="World/NavigationRegion3D/NS19BumpA" unique_id=1900006 groups=["walkable"]] -collision_layer = 1 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="World/NavigationRegion3D/NS19BumpA/RampNorth" unique_id=1900007] -shape = SubResource("Convex_ns19a_ramp_n") - -[node name="RampEast" type="StaticBody3D" parent="World/NavigationRegion3D/NS19BumpA" unique_id=1900008 groups=["walkable"]] -collision_layer = 1 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="World/NavigationRegion3D/NS19BumpA/RampEast" unique_id=1900009] -shape = SubResource("Convex_ns19a_ramp_e") - -[node name="RampWest" type="StaticBody3D" parent="World/NavigationRegion3D/NS19BumpA" unique_id=1900010 groups=["walkable"]] -collision_layer = 1 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="World/NavigationRegion3D/NS19BumpA/RampWest" unique_id=1910014] -shape = SubResource("Convex_ns19a_ramp_w") +shape = SubResource("Convex_ns19a_frustum") [node name="NS19BumpB" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=1900011 groups=["walkable"]] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.85, 0.06, -4.1) @@ -206,32 +151,7 @@ mesh = SubResource("BoxMesh_ns19_bump_b") surface_material_override/0 = SubResource("Mat_ns19_bump") [node name="CollisionShape3D" type="CollisionShape3D" parent="World/NavigationRegion3D/NS19BumpB" unique_id=1900013] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.03, 0) -shape = SubResource("BoxShape3D_ns19_bump_b_top") - -[node name="RampSouth" type="StaticBody3D" parent="World/NavigationRegion3D/NS19BumpB" unique_id=1911004 groups=["walkable"]] -collision_layer = 1 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="World/NavigationRegion3D/NS19BumpB/RampSouth" unique_id=1911005] -shape = SubResource("Convex_ns19b_ramp_s") - -[node name="RampNorth" type="StaticBody3D" parent="World/NavigationRegion3D/NS19BumpB" unique_id=1900016 groups=["walkable"]] -collision_layer = 1 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="World/NavigationRegion3D/NS19BumpB/RampNorth" unique_id=1900017] -shape = SubResource("Convex_ns19b_ramp_n") - -[node name="RampEast" type="StaticBody3D" parent="World/NavigationRegion3D/NS19BumpB" unique_id=1900018 groups=["walkable"]] -collision_layer = 1 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="World/NavigationRegion3D/NS19BumpB/RampEast" unique_id=1900019] -shape = SubResource("Convex_ns19b_ramp_e") - -[node name="RampWest" type="StaticBody3D" parent="World/NavigationRegion3D/NS19BumpB" unique_id=1900020 groups=["walkable"]] -collision_layer = 1 - -[node name="CollisionShape3D" type="CollisionShape3D" parent="World/NavigationRegion3D/NS19BumpB/RampWest" unique_id=1900024] -shape = SubResource("Convex_ns19b_ramp_w") +shape = SubResource("Convex_ns19b_frustum") [node name="NS19RejectPedestal" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=1900021 groups=["walkable"]] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.5, 0, -6.5) @@ -275,6 +195,7 @@ collision_layer = 2 collision_mask = 1 floor_max_angle = 0.872665 floor_snap_length = 0.28 +safe_margin = 0.045 script = ExtResource("2_player") [node name="CollisionShape3D" type="CollisionShape3D" parent="Player" unique_id=1695755590] diff --git a/client/scripts/player.gd b/client/scripts/player.gd index 413c00e..a79476a 100644 --- a/client/scripts/player.gd +++ b/client/scripts/player.gd @@ -1,7 +1,7 @@ extends CharacterBody3D ## NS-23: Nav waypoints + stored server goal for arrival. -## NS-19: invisible convex **ramps** on bumps; no `test_move` autostep (bad vs `move_and_slide`). +## NS-19: bump collision is one convex frustum (plateau + slopes); no autostep. const MOVE_SPEED: float = 5.0 const ARRIVE_EPS: float = 0.35