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
parent
ac9818a2cd
commit
275645c6cf
|
|
@ -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
|
## 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.
|
## upper surface across an internal edge (lip hang). Relaxed once feet are near the goal height.
|
||||||
const DESCEND_LIP_SNAP_CAP: float = 0.12
|
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
|
## Strong downward multiplier at a stalled lip (stall tick, wallish contact, or carry from prior).
|
||||||
## or wall contact). Full-time on-floor gravity was removed — it made platform→floor crossing
|
|
||||||
## feel glued until the capsule finally dropped.
|
|
||||||
const DESCEND_LIP_GRAVITY_MULT: float = 7.0
|
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).
|
## Y lift when blocked by wall-ish slide but nav goal is higher (stepped bumps).
|
||||||
const WALK_STEP_ASSIST_DELTA: float = 0.11
|
const WALK_STEP_ASSIST_DELTA: float = 0.11
|
||||||
## Skip assist when horizontal velocity already aligns enough with want-dir (corners slide slowly).
|
## 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
|
var goal_below: bool = _auth_walk_goal.y < feet_y - DESCEND_GOAL_Y_MARGIN
|
||||||
if not goal_below:
|
if not goal_below:
|
||||||
return
|
return
|
||||||
var wallish: bool = _walk_has_wallish_slide_contact()
|
# While clearly above the lower target, always relax — waiting for wallish/stall left step→floor
|
||||||
if wallish or _descend_lip_stall_ticks >= 1:
|
# 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
|
floor_block_on_wall = false
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -296,15 +301,18 @@ func _apply_descend_lip_peel(
|
||||||
) -> void:
|
) -> void:
|
||||||
if _auth_walk_goal.y >= feet_y - DESCEND_GOAL_Y_MARGIN:
|
if _auth_walk_goal.y >= feet_y - DESCEND_GOAL_Y_MARGIN:
|
||||||
return
|
return
|
||||||
|
if not is_on_floor():
|
||||||
|
return
|
||||||
var g := get_gravity() * delta
|
var g := get_gravity() * delta
|
||||||
if g.y >= 0.0:
|
if g.y >= 0.0:
|
||||||
return
|
return
|
||||||
if (
|
var strong: bool = (
|
||||||
_descend_lip_stall_ticks >= 1
|
_descend_lip_stall_ticks >= 1
|
||||||
or _walk_has_wallish_slide_contact()
|
or _walk_has_wallish_slide_contact()
|
||||||
or carry_lip_from_prior_move
|
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:
|
func _descend_update_lip_stall_after_move() -> void:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue