NEON-29: Descend floor_block + weak lip peel (fix stuck step/platform→floor)

Relax floor_block whenever feet are >7 cm above a lower goal — stall/wall was too
late for step1→floor. Re-tighten only in the last centimeters (wallish/stall).

Apply DESCEND_WEAK_PEEL_MULT on_floor while descending every frame; ramp to
DESCEND_LIP_GRAVITY_MULT when stalled/wallish/carry. Skip peel when airborne
(full gravity from _apply_walk_air_gravity).
pull/41/head
VinPropane 2026-04-12 00:07:36 -04:00
parent ac9818a2cd
commit 275645c6cf
1 changed files with 16 additions and 8 deletions

View File

@ -31,10 +31,11 @@ const DESCEND_GOAL_Y_MARGIN: float = 0.06
## Cap floor snap while descending from a step so Jolt cannot snap the capsule back onto the
## upper surface across an internal edge (lip hang). Relaxed once feet are near the goal height.
const DESCEND_LIP_SNAP_CAP: float = 0.12
## Extra downward integration vs plain gravity when the descend path is stalled at a lip (ticks>0
## or wall contact). Full-time on-floor gravity was removed — it made platform→floor crossing
## feel glued until the capsule finally dropped.
## Strong downward multiplier at a stalled lip (stall tick, wallish contact, or carry from prior).
const DESCEND_LIP_GRAVITY_MULT: float = 7.0
## Weaker always-on peel while on_floor and descending so internal edges unstick without waiting
## for stall detection; kept < 1.0 so flat spans on a platform still allow horizontal motion.
const DESCEND_WEAK_PEEL_MULT: float = 0.72
## Y lift when blocked by wall-ish slide but nav goal is higher (stepped bumps).
const WALK_STEP_ASSIST_DELTA: float = 0.11
## Skip assist when horizontal velocity already aligns enough with want-dir (corners slide slowly).
@ -286,8 +287,12 @@ func _update_floor_block_on_wall_for_terraces(feet_y: float) -> void:
var goal_below: bool = _auth_walk_goal.y < feet_y - DESCEND_GOAL_Y_MARGIN
if not goal_below:
return
var wallish: bool = _walk_has_wallish_slide_contact()
if wallish or _descend_lip_stall_ticks >= 1:
# While clearly above the lower target, always relax — waiting for wallish/stall left step→floor
# and platform→floor stuck with no recovery. Tighten again near landing so floor contact stays sane.
if feet_y > _auth_walk_goal.y + 0.07:
floor_block_on_wall = false
return
if _walk_has_wallish_slide_contact() or _descend_lip_stall_ticks >= 1:
floor_block_on_wall = false
@ -296,15 +301,18 @@ func _apply_descend_lip_peel(
) -> void:
if _auth_walk_goal.y >= feet_y - DESCEND_GOAL_Y_MARGIN:
return
if not is_on_floor():
return
var g := get_gravity() * delta
if g.y >= 0.0:
return
if (
var strong: bool = (
_descend_lip_stall_ticks >= 1
or _walk_has_wallish_slide_contact()
or carry_lip_from_prior_move
):
velocity.y += g.y * DESCEND_LIP_GRAVITY_MULT
)
var w: float = DESCEND_LIP_GRAVITY_MULT if strong else DESCEND_WEAK_PEEL_MULT
velocity.y += g.y * w
func _descend_update_lip_stall_after_move() -> void: