NEON-29: Tie tread XZ freeze to peel suspend + vert arrival band.
Replace vlat/ncol + tight vert_sep window (often missed or band-flickered) with: peel suspend, horiz_dist <= 0.38 m, VERT_ARRIVE_EPS < verr <= 0.18 m, goal not above feet. Aligns freeze with tread snap/peel regime; caps XZ against 5 m peel-suspend fallback.pull/41/head
parent
ea3903d8ab
commit
db7973d368
|
|
@ -38,13 +38,12 @@ const WALK_PEEL_SUSPEND_VERT_SEP: float = 0.48
|
||||||
## so shallow lips (~0.48 m) still peel; widened from 0.34 to cover ~0.35–0.47 m stair/goal gaps.
|
## so shallow lips (~0.48 m) still peel; widened from 0.34 to cover ~0.35–0.47 m stair/goal gaps.
|
||||||
const WALK_PEEL_SUSPEND_HORIZ_VERT_SEP: float = 0.46
|
const WALK_PEEL_SUSPEND_HORIZ_VERT_SEP: float = 0.46
|
||||||
const WALK_PEEL_SUSPEND_HORIZ_DIST: float = 5.0
|
const WALK_PEEL_SUSPEND_HORIZ_DIST: float = 5.0
|
||||||
## In [code]vlat && ncol[/code], when XZ is almost at arrival but [code]vert_sep[/code] sits in a tread
|
## With [method _walk_peel_suspend_near_goal] (tread snap/peel stability), zero XZ [member velocity] when
|
||||||
## wobble band (~4.5–13 cm), full [member MOVE_SPEED] slide keeps pumping Y (NEON-16 ~0.89–0.95). Zero
|
## close in XZ but vertical arrival still unresolved — avoids band-edge flicker from a tight [code]vert_sep[/code]
|
||||||
## horizontal [member velocity] for that tick so only floor snap settles height — narrow gates avoid
|
## window. [member WALK_PEEL_SUSPEND_HORIZ_DIST] can be 5 m; cap XZ here so we never freeze long crosses.
|
||||||
## freezing open-floor approaches or long vertical offsets.
|
const WALK_TREAD_FREEZE_HORIZ_MAX: float = 0.38
|
||||||
const WALK_TREAD_FREEZE_HORIZ_FRAC: float = 0.92
|
## Freeze only while vertical error is in a “tread wobble” band (past arrival noise, not a big drop).
|
||||||
const WALK_TREAD_FREEZE_VERT_SEP_MIN: float = 0.045
|
const WALK_TREAD_FREEZE_VERT_ERR_MAX: float = 0.18
|
||||||
const WALK_TREAD_FREEZE_VERT_SEP_MAX: float = 0.13
|
|
||||||
## [method _walk_has_close_floor_probe_below] often flips on stairs: next tread is ~0.104 m down but
|
## [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
|
## [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
|
## alternate with full snap each tick (~y≈1.0 jitter). Require this many consecutive probe-fail frames
|
||||||
|
|
@ -502,21 +501,23 @@ 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
|
return vsep <= WALK_PEEL_SUSPEND_HORIZ_VERT_SEP and horiz_dist <= WALK_PEEL_SUSPEND_HORIZ_DIST
|
||||||
|
|
||||||
|
|
||||||
func _walk_tread_freeze_horizontal_active(feet_y: float, horiz_dist: float) -> bool:
|
func _walk_tread_freeze_horizontal_active(_feet_y: float, horiz_dist: float) -> bool:
|
||||||
if not is_on_floor() or not _has_walk_goal:
|
if not is_on_floor() or not _has_walk_goal:
|
||||||
return false
|
return false
|
||||||
# Step-up / climb still needs XZ motion along the face.
|
# Step-up / climb still needs XZ motion along the face.
|
||||||
if _auth_walk_goal.y > feet_y + 0.04:
|
if _auth_walk_goal.y > _feet_y + 0.04:
|
||||||
return false
|
return false
|
||||||
if horiz_dist > ARRIVE_EPS * WALK_TREAD_FREEZE_HORIZ_FRAC:
|
if not _walk_peel_suspend_near_goal(_feet_y, horiz_dist):
|
||||||
return false
|
return false
|
||||||
var vsep: float = absf(_auth_walk_goal.y - feet_y)
|
if horiz_dist > WALK_TREAD_FREEZE_HORIZ_MAX:
|
||||||
if vsep <= WALK_TREAD_FREEZE_VERT_SEP_MIN or vsep > WALK_TREAD_FREEZE_VERT_SEP_MAX:
|
|
||||||
return false
|
return false
|
||||||
if _walk_vert_route_latched and _walk_nav_column_steering:
|
var cap_half: float = CAPSULE_HALF_HEIGHT + PLAYER_CAPSULE_RADIUS
|
||||||
return true
|
var verr: float = vertical_arrival_error(_auth_walk_goal.y, global_position.y, cap_half)
|
||||||
# [code]vlat[/code] can unlatch on long descents; keep freeze only when clearly dropping.
|
if verr <= VERT_ARRIVE_EPS:
|
||||||
return _auth_walk_goal.y < feet_y - DESCEND_GOAL_Y_MARGIN
|
return false
|
||||||
|
if verr > WALK_TREAD_FREEZE_VERT_ERR_MAX:
|
||||||
|
return false
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
func _walk_refresh_ledge_peel_debounce(feet_y: float, move_dir_xz: Vector2) -> void:
|
func _walk_refresh_ledge_peel_debounce(feet_y: float, move_dir_xz: Vector2) -> void:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue