NEON-29: Fix floor walk stall from tight nav agent distances.
Revert path_desired_distance and target_desired_distance to 0.35; 0.22 was below practical per-tick progress toward waypoints and led to oscillation or stuck path state. When NavigationAgent reports finished but horizontal distance still exceeds ARRIVE_EPS, steer directly toward the authoritative goal in XZ.pull/41/head
parent
44984780d4
commit
4df71ac0cc
|
|
@ -480,8 +480,8 @@ script = ExtResource("2_player")
|
||||||
shape = SubResource("CapsuleShape3D_player")
|
shape = SubResource("CapsuleShape3D_player")
|
||||||
|
|
||||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="World/Player" unique_id=8880002]
|
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="World/Player" unique_id=8880002]
|
||||||
path_desired_distance = 0.22
|
path_desired_distance = 0.35
|
||||||
target_desired_distance = 0.22
|
target_desired_distance = 0.35
|
||||||
radius = 0.4
|
radius = 0.4
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/Player" unique_id=2027034386]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/Player" unique_id=2027034386]
|
||||||
|
|
|
||||||
|
|
@ -687,17 +687,23 @@ func _physics_process(delta: float) -> void:
|
||||||
else:
|
else:
|
||||||
_set_horizontal_velocity_from_nav_path_or_goal(want_goal_h)
|
_set_horizontal_velocity_from_nav_path_or_goal(want_goal_h)
|
||||||
else:
|
else:
|
||||||
var next_path_position: Vector3 = _nav_agent.get_next_path_position()
|
# Tight path_desired_distance can make the agent oscillate around a corner without ever
|
||||||
var to_next_h: Vector3 = Vector3(
|
# satisfying the advance threshold; finished-with-no-path can also happen if the map was
|
||||||
next_path_position.x - global_position.x, 0.0, next_path_position.z - global_position.z
|
# empty or the target projected oddly. In those cases keep bee-lining in XZ toward the goal.
|
||||||
)
|
if _nav_agent.is_navigation_finished() and horiz_dist > ARRIVE_EPS:
|
||||||
# When the next mesh point is almost under the capsule (same XZ), still steer using the
|
|
||||||
# segment from agent to next point if it has length; else fall back to full goal direction
|
|
||||||
# (not arbitrary +X) so vertical-offset goals and nav edges resolve.
|
|
||||||
if to_next_h.length_squared() > 0.0025:
|
|
||||||
_set_horizontal_velocity_toward(next_path_position, want_goal_h)
|
|
||||||
else:
|
|
||||||
_set_horizontal_velocity_toward(_auth_walk_goal, want_goal_h)
|
_set_horizontal_velocity_toward(_auth_walk_goal, want_goal_h)
|
||||||
|
else:
|
||||||
|
var next_path_position: Vector3 = _nav_agent.get_next_path_position()
|
||||||
|
var to_next_h: Vector3 = Vector3(
|
||||||
|
next_path_position.x - global_position.x, 0.0, next_path_position.z - global_position.z
|
||||||
|
)
|
||||||
|
# When the next mesh point is almost under the capsule (same XZ), still steer using the
|
||||||
|
# segment from agent to next point if it has length; else fall back to full goal direction
|
||||||
|
# (not arbitrary +X) so vertical-offset goals and nav edges resolve.
|
||||||
|
if to_next_h.length_squared() > 0.0025:
|
||||||
|
_set_horizontal_velocity_toward(next_path_position, want_goal_h)
|
||||||
|
else:
|
||||||
|
_set_horizontal_velocity_toward(_auth_walk_goal, want_goal_h)
|
||||||
|
|
||||||
_apply_walk_air_gravity(delta)
|
_apply_walk_air_gravity(delta)
|
||||||
floor_snap_length = _walk_floor_snap_length(feet_y, want_goal_h)
|
floor_snap_length = _walk_floor_snap_length(feet_y, want_goal_h)
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ No new automated GDScript tests are added for this story — there is no new GDS
|
||||||
- **Lip stuck (floor→platform / platform→floor):** QA screenshots for this were on **`TerracePlatformA`** (10 × 10 large SE pad, **0.3 m** single step — not the NW **Terrace B** step/platform pair). Step assist required **`vel_h.dot(want) ≤ 0.52`**, so a **head-on** push into the vertical face (dot ≈ 1) **never** triggered the lift. **Removed** that gate. For **platform→floor**, **`floor_block_on_wall = false`** only when the nav goal is **below** the feet **and** **`is_on_wall()`** or a **wall-ish slide normal** exists, so open deck walking stays stable.
|
- **Lip stuck (floor→platform / platform→floor):** QA screenshots for this were on **`TerracePlatformA`** (10 × 10 large SE pad, **0.3 m** single step — not the NW **Terrace B** step/platform pair). Step assist required **`vel_h.dot(want) ≤ 0.52`**, so a **head-on** push into the vertical face (dot ≈ 1) **never** triggered the lift. **Removed** that gate. For **platform→floor**, **`floor_block_on_wall = false`** only when the nav goal is **below** the feet **and** **`is_on_wall()`** or a **wall-ish slide normal** exists, so open deck walking stays stable.
|
||||||
- **Teal pad still stuck (follow-up):** Step assist used **slide normals only**; Jolt often exposes the lip via **`is_on_wall()`** / **`get_wall_normal()`** instead — re-added a **directional** wall check (`wnh.dot(want) < -0.02`). Descend relax now also triggers on **shallow floor normal** (`get_floor_normal().dot(UP) < 0.992`) and slightly wider vertical-ish slide band. **`TerracePlatformA`** root **Y = 0.012 m** breaks **coplanarity** with the main floor without the larger gap that hurt **TerraceStepB** approach.
|
- **Teal pad still stuck (follow-up):** Step assist used **slide normals only**; Jolt often exposes the lip via **`is_on_wall()`** / **`get_wall_normal()`** instead — re-added a **directional** wall check (`wnh.dot(want) < -0.02`). Descend relax now also triggers on **shallow floor normal** (`get_floor_normal().dot(UP) < 0.992`) and slightly wider vertical-ish slide band. **`TerracePlatformA`** root **Y = 0.012 m** breaks **coplanarity** with the main floor without the larger gap that hurt **TerraceStepB** approach.
|
||||||
- **Teal cardinal / tread shake (rollback):** Aggressive tweaks (**0.16** lift, **1**-tick cooldown, **`descending_stall`** toggling **`floor_block_on_wall`**, **seam-based** step-assist clear, **walk-stall nav replan**) caused **oscillation** on the small approach treads. **Reverted** to **`WALK_STEP_ASSIST_DELTA = 0.11`**, **`WALK_STEP_ASSIST_COOLDOWN_TICKS = 8`**, **no** stall replan, **no** `descending_stall` branch, **no** seam-based assist clear — only the original clear (clean floor without wall, or airborne with no slides). **Climb** wallish snap cap applies only when **`goal.y > feet_y + 0.12`** so shallow tread-to-tread motion is not capped to assist snap every frame.
|
- **Teal cardinal / tread shake (rollback):** Aggressive tweaks (**0.16** lift, **1**-tick cooldown, **`descending_stall`** toggling **`floor_block_on_wall`**, **seam-based** step-assist clear, **walk-stall nav replan**) caused **oscillation** on the small approach treads. **Reverted** to **`WALK_STEP_ASSIST_DELTA = 0.11`**, **`WALK_STEP_ASSIST_COOLDOWN_TICKS = 8`**, **no** stall replan, **no** `descending_stall` branch, **no** seam-based assist clear — only the original clear (clean floor without wall, or airborne with no slides). **Climb** wallish snap cap applies only when **`goal.y > feet_y + 0.12`** so shallow tread-to-tread motion is not capped to assist snap every frame.
|
||||||
- **Teal pad — geometry wins:** Script-only mitigations still failed in practice; **`TerracePlatformA_Approach`** adds **twelve** `walkable` **`StaticBody3D`** treads (three per cardinal) with **~0.104 m** rise each, **darker teal** albedo, flush to the platform lip — nav + `CharacterBody3D` use **sloped contact** instead of fighting a **single vertical face**. **Follow-up:** tread **run** was **0.45 m** along the climb axis while the capsule **diameter is 0.8 m** — the body was wider than each tread, causing straddle / stuck motion when **entering** and blocking horizontal progress toward the lip when **exiting**. Treads widened to **1.0 m** run with positions re-centered; **`NavigationAgent3D`** `path_desired_distance` / `target_desired_distance` tightened **0.35 → 0.22** so path corners are not released while still far from the stair entry.
|
- **Teal pad — geometry wins:** Script-only mitigations still failed in practice; **`TerracePlatformA_Approach`** adds **twelve** `walkable` **`StaticBody3D`** treads (three per cardinal) with **~0.104 m** rise each, **darker teal** albedo, flush to the platform lip — nav + `CharacterBody3D` use **sloped contact** instead of fighting a **single vertical face**. **Follow-up:** tread **run** was **0.45 m** along the climb axis while the capsule **diameter is 0.8 m** — the body was wider than each tread, causing straddle / stuck motion when **entering** and blocking horizontal progress toward the lip when **exiting**. Treads widened to **1.0 m** run with positions re-centered. **`NavigationAgent3D`** `path_desired_distance` / `target_desired_distance` were briefly lowered to **0.22** but that caused **floor** movement to **stall** (waypoint threshold tighter than practical motion at `MOVE_SPEED` / physics dt, plus finished-without-arrival edge cases); **reverted to 0.35** and **`player.gd`** now **bee-lines in XZ** when **`is_navigation_finished()`** yet **`horiz_dist > ARRIVE_EPS`**.
|
||||||
|
|
||||||
## Open questions / risks
|
## Open questions / risks
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue