From 50a8b609be8eb7e918a84c3526d5699f9cfae814 Mon Sep 17 00:00:00 2001 From: VinPropane Date: Sun, 12 Apr 2026 19:49:19 -0400 Subject: [PATCH] NEON-29: Latch stable idle on ridged stair treads (idle jitter). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Idle jitter was not walk/peel: without has_goal, stable idle required floor_normal·up >= 0.998. Tread+riser contacts often report ~0.996–0.997, so stable idle never latched and rim settle nudge + idle move_and_slide ran every tick. Use STABLE_IDLE_FLOOR_HOLD_MIN_UP_DOT (0.992) for the floor-flat check when slide contacts are ridged and we are still using the strict entry threshold. --- client/scripts/player.gd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/scripts/player.gd b/client/scripts/player.gd index 675271a..bf980a9 100644 --- a/client/scripts/player.gd +++ b/client/scripts/player.gd @@ -728,7 +728,15 @@ static func idle_support_is_stable( ) -> bool: if not on_floor: return false - if floor_normal.dot(Vector3.UP) < min_flat_up_dot: + var ridged: bool = idle_slide_contacts_are_ridged(slide_normals) + # Entering stable idle uses [member STABLE_IDLE_FLOOR_MIN_UP_DOT] (0.998). On stair treads, + # [code]get_floor_normal()[/code] often sits ~0.996–0.997 with a riser contact — never latches, + # so idle stays in corrective [method _maybe_idle_rim_settle_nudge] + [method _physics_idle_tick] + # forever (HUD jitter while **not** walking). Use the latched hold threshold (0.992) when ridged. + var required_up: float = min_flat_up_dot + if ridged and min_flat_up_dot >= STABLE_IDLE_FLOOR_MIN_UP_DOT - 1e-6: + required_up = STABLE_IDLE_FLOOR_HOLD_MIN_UP_DOT + if floor_normal.dot(Vector3.UP) < required_up: return false # Post-stop **ridged** slides (tread + riser) used to force unstable idle for the entire # `loose_ticks` window even when the **floor** is level — e.g. idle on a flat approach tread @@ -737,7 +745,7 @@ static func idle_support_is_stable( # proximity to a riser on an otherwise flat tread. if ( loose_ticks > 0 - and idle_slide_contacts_are_ridged(slide_normals) + and ridged and floor_normal.dot(Vector3.UP) < IDLE_RIM_MIN_FLOOR_UP_DOT ): return false