NEON-29: Drop tread speed cap; widen stair continuation probe.

Remove WALK_TREAD_STABILITY horiz cap (it ran for whole vlat&&ncol band and
made the last steps sluggish without fixing jitter).

Raise WALK_CONTINUATION_MAX_BELOW_FEET 0.078→0.108 m so ~0.104 m tread drops
count as walk continuation; probe/debounced peel+snap stop flipping each tick.
Kept below ~0.25 m so ~0.3 m gold→floor void still rejects the slab.

Revert NAV_PATH_STEER_MIN_LOOKAHEAD to 0.22 m.
pull/41/head
VinPropane 2026-04-12 19:15:27 -04:00
parent 4a08ede736
commit ec903d9c11
1 changed files with 7 additions and 35 deletions

View File

@ -24,8 +24,8 @@ const NAV_COLUMN_STEER_ENTER_DIST: float = 0.74
const NAV_COLUMN_STEER_EXIT_DIST: float = 0.97
## First path waypoint used for column steer must be at least this far in XZ. [method NavigationAgent3D.get_next_path_position]
## can sit ~4 cm from the capsule; Jolt slides ~4 cm/tick → the “toward next” vector flips 180° every frame
## (`vlat && ncol` NEON-16 traces). ~28 cm reduces waypoint flip on treads without starving short segments.
const NAV_PATH_STEER_MIN_LOOKAHEAD: float = 0.28
## (`vlat && ncol` NEON-16 traces). A 22 cm gate matches foot-scale probes and stays stable on treads.
const NAV_PATH_STEER_MIN_LOOKAHEAD: float = 0.22
## If lookahead steering points more than ~105° from the click direction (XZ), use direct goal steer instead.
const NAV_PATH_STEER_MIN_GOAL_DOT: float = -0.25
## While [code]vlat && ncol[/code], ledge peel + zero floor snap fight [method move_and_slide] on approach treads
@ -38,11 +38,6 @@ const WALK_PEEL_SUSPEND_VERT_SEP: float = 0.48
## so shallow lips (~0.48 m) still peel; widened from 0.34 to cover ~0.350.47 m stair/goal gaps.
const WALK_PEEL_SUSPEND_HORIZ_VERT_SEP: float = 0.46
const WALK_PEEL_SUSPEND_HORIZ_DIST: float = 5.0
## On-floor only: cap horizontal speed in [method _walk_tread_jitter_damp_active] so full [member MOVE_SPEED]
## does not hammer stair risers after peel/snap debounce (still ~mmcm Y noise at y≈1.09).
const WALK_TREAD_STABILITY_MAX_HORIZ_SPEED: float = 1.35
## With [code]vlat[/code] false, only damp when this close in XZ — avoids slowing long same-level approaches.
const WALK_TREAD_STABILITY_DAMP_HORIZ_DIST: float = 1.05
## [method _walk_has_close_floor_probe_below] often flips on stairs: next tread is ~0.104 m down but
## [member WALK_CONTINUATION_MAX_BELOW_FEET] is 0.078 m, so rays reject the hit → peel + zero snap
## alternate with full snap each tick (~y≈1.0 jitter). Require this many consecutive probe-fail frames
@ -97,12 +92,11 @@ const WALK_STEP_ASSIST_MAX_SURFACE_DELTA: float = 0.35
## Down-ray length under the capsule foot disk while walking (~[member NavigationMesh.agent_max_climb]).
const WALK_SUPPORT_PROBE_DEPTH: float = 0.32
const WALK_SUPPORT_PROBE_MIN_UP_DOT: float = 0.42
## Ignore ray hits farther below the feet than this (m). Must stay **below** approach tread rise
## (~0.104 m in [code]main.tscn[/code]): if the next tread counts as “continuation”, [method _walk_has_close_floor_probe_below]
## stays true on stairs while [code]is_on_floor()[/code] flickers — ledge peel never runs and the capsule
## glides horizontally with only weak airborne gravity. Still below a full gold→floor drop (~0.3 m) so
## void probes toward the slab reject the lower hit.
const WALK_CONTINUATION_MAX_BELOW_FEET: float = 0.078
## Ignore ray hits farther below the feet than this (m). Set just **above** QA tread rise (~0.104 m in
## [code]main.tscn[/code]) so the next tread usually counts as continuation — stabilizes debounced peel/snap
## on violet stairs. Must stay **below** ~0.25 m so a gold→floor (~0.3 m) void still rejects the slab hit
## (no horizontal skate off the deck).
const WALK_CONTINUATION_MAX_BELOW_FEET: float = 0.108
## If capsule feet are farther above the clicks surface Y than this, always use walk gravity + zero
## moving snap (rays can still read “support” while [method CharacterBody3D.is_on_floor] hugs a lip).
## ~0.42 m: **TerracePlatformB** top (~0.6 m) → floor (0) qualifies; **TerraceStepB** (~0.3 m) → floor does
@ -501,25 +495,6 @@ func _walk_peel_suspend_near_goal(feet_y: float, horiz_dist: float) -> bool:
return vsep <= WALK_PEEL_SUSPEND_HORIZ_VERT_SEP and horiz_dist <= WALK_PEEL_SUSPEND_HORIZ_DIST
func _walk_tread_jitter_damp_active(feet_y: float, horiz_dist: float) -> bool:
if not _has_walk_goal or not is_on_floor():
return false
var vsep: float = absf(_auth_walk_goal.y - feet_y)
if _walk_vert_route_latched and _walk_nav_column_steering and vsep < WALK_PEEL_SUSPEND_VERT_SEP:
return true
return vsep <= WALK_PEEL_SUSPEND_HORIZ_VERT_SEP and horiz_dist <= WALK_TREAD_STABILITY_DAMP_HORIZ_DIST
func _walk_apply_tread_horizontal_speed_cap() -> void:
var vxz := Vector2(velocity.x, velocity.z)
var sp: float = vxz.length()
if sp <= WALK_TREAD_STABILITY_MAX_HORIZ_SPEED + 1e-6:
return
var h_scale: float = WALK_TREAD_STABILITY_MAX_HORIZ_SPEED / sp
velocity.x = vxz.x * h_scale
velocity.z = vxz.y * h_scale
func _walk_refresh_ledge_peel_debounce(feet_y: float, move_dir_xz: Vector2) -> void:
var probe_ok: bool = _walk_has_close_floor_probe_below(move_dir_xz)
var deep: bool = feet_y > _auth_walk_goal.y + WALK_DEEP_DESCENT_FEET_ABOVE_GOAL
@ -1123,9 +1098,6 @@ func _physics_process(delta: float) -> void:
else:
_set_horizontal_velocity_toward(_auth_walk_goal, want_goal_h)
if _walk_tread_jitter_damp_active(feet_y, horiz_dist):
_walk_apply_tread_horizontal_speed_cap()
var walk_move_dir_xz: Vector2 = _resolve_walk_probe_dir_xz(feet_y, want_goal_h)
_walk_refresh_ledge_peel_debounce(feet_y, walk_move_dir_xz)