feat: overhaul movement for flow — momentum-preserving states, smooth crouch, landing feel

- Quake-style air-strafe accelerate (real speed gain from strafing; external
  speed from dash/rockets never clamped)
- Wall run: keeps entry momentum (incl. upward carry), accelerates along the
  wall instead of hard-setting velocity, gravity fades in over the run
- Slide: slope physics (gravity projected along floor accelerates downhill),
  flat-ground decel instead of multiplicative friction, entry boost, direct
  slide->wallrun and slide->dash transitions
- Dash: cooldown 10s -> 2s, per-player (was a static shared across instances),
  momentum fully kept on exit, FOV punch event
- Grapple: taut pendulum with active rope control (W reels in, S pays out),
  release keeps swing energy
- Wall climb: carries upward momentum in, jump-off kick, shared vault helper
- Crouch capsule: single owner in the machine, smoothly lerped, ceiling check;
  camera eye height follows via crouch factor (no more head snapping)
- Landing: machine emits 'land' events scaled by impact; camera dip + pitched
  down thud; footsteps get pitch variation
- Camera rig: event-driven (land dip, dash FOV kick, vault pitch impulse),
  slide roll tilt
- Model: Jump vs Fall split by vertical velocity, Land one-shot on heavy
  landings, wall-run body lean (synced to remotes via synced_wall_side)

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Nicholas Butzke
2026-07-17 11:58:14 -04:00
co-authored by Claude Fable 5
parent c4a538a469
commit 0ba14a9469
16 changed files with 653 additions and 493 deletions
+52 -35
View File
@@ -3,10 +3,10 @@ class_name MovementParams
# ── Ground ────────────────────────────────────────────────────────────────────
@export var walk_speed: float = 11.0
@export var crouch_speed: float = 4.0
@export var crouch_speed: float = 4.5
@export var ground_friction: float = 10.0
@export var ground_acceleration: float = 50.0
@export var ground_deceleration: float = 40.0
@export var ground_acceleration: float = 60.0
@export var ground_deceleration: float = 45.0
# ── Jump / Air ────────────────────────────────────────────────────────────────
@export var jump_velocity: float = 8.5
@@ -14,70 +14,84 @@ class_name MovementParams
@export var jump_buffer: float = 0.12
@export var air_control: float = 0.35
@export var air_acceleration: float = 30.0
@export var max_air_speed: float = 16.0
@export var max_air_speed: float = 18.0
@export var gravity: float = 22.0
@export var fall_multiplier: float = 2.2
@export var fall_multiplier: float = 2.0
@export var low_jump_multiplier: float = 1.6
# ── Air Strafe (Quake-style) ──────────────────────────────────────────────────
@export var air_strafe_accel: float = 80.0
@export var air_strafe_max_gain: float = 1.0
# Classic accelerate: only the velocity component along wish_dir is capped, so
# turning while strafing genuinely gains speed (up to max_air_speed overall).
@export var air_strafe_accel: float = 55.0
@export var air_wish_speed_cap: float = 1.2 # per-tick projection cap (m/s), quake-style
# ── Bunny Hop ─────────────────────────────────────────────────────────────────
@export var bunny_hop_impulse: float = 1.15
@export var bunny_hop_speed_gain: float = 0.5
@export var bunny_hop_speed_cap: float = 16.0
@export var bunny_hop_impulse: float = 1.1
@export var bunny_hop_speed_gain: float = 0.7
@export var bunny_hop_speed_cap: float = 20.0
# ── Slide ─────────────────────────────────────────────────────────────────────
@export var slide_speed: float = 14.0
@export var slide_friction: float = 0.96
@export var slide_min_speed: float = 5.0
@export var slide_duration: float = 0.8
@export var slide_cooldown: float = 0.4 # Prevents rapid slide re-entry
@export var slide_jump_speed_boost: float = 1.5 # Extra m/s added when jumping out of slide
@export var slide_boost: float = 3.0 # flat entry boost when grounded and fast
@export var slide_friction_flat: float = 2.2 # m/s^2 decel on flat ground (low = long slides)
@export var slide_slope_accel: float = 16.0 # downhill acceleration from gravity projection
@export var slide_min_speed: float = 4.0
@export var slide_cooldown: float = 0.35 # prevents rapid slide re-entry
@export var slide_steer_rate: float = 2.5 # how fast slide direction bends toward input
@export var slide_jump_speed_boost: float = 1.5 # extra m/s added when jumping out of slide
# ── Wall Run ──────────────────────────────────────────────────────────────────
@export var wall_run_speed: float = 12.0
@export var wall_run_vertical_speed: float = 4.0
@export var wall_run_duration: float = 1.2
@export var wall_run_gravity: float = 6.0
@export var wall_run_speed: float = 13.0
@export var wall_run_accel: float = 18.0 # accelerate toward run speed (no hard set)
@export var wall_run_duration: float = 1.8
@export var wall_run_gravity: float = 5.0
@export var wall_run_entry_max_up: float = 3.5 # keep this much upward momentum on attach
@export var wall_run_auto_jump_speed: float = 10.0
@export var wall_run_jump_horizontal: float = 8.0
@export var wall_run_jump_off_normal: float = 5.0
@export var wall_run_jump_off_normal: float = 6.0
@export var wall_angle_threshold: float = 70.0
@export var wall_detect_distance: float = 0.7
@export var wall_detect_distance: float = 0.8
@export var wall_ray_up_height: float = 0.6
@export var wall_ray_down_height: float = 0.0
# ── Wall Climb ────────────────────────────────────────────────────────────────
@export var wall_climb_speed: float = 6.0
@export var wall_climb_duration: float = 3.0
@export var wall_climb_speed: float = 6.5
@export var wall_climb_duration: float = 2.2
@export var wall_climb_max_angle: float = 75.0
@export var wall_climb_vault_forward: float = 16.0
@export var wall_climb_vault_up: float = 14.0
@export var wall_climb_vault_forward: float = 14.0
@export var wall_climb_vault_up: float = 12.0
@export var wall_climb_vault_height_check: float = 1.0
# ── Jumping ───────────────────────────────────────────────────────────────────
@export var jump_cooldown: float = 0.27
@export var jump_cooldown: float = 0.12
# ── Wall Cling ────────────────────────────────────────────────────────────────
@export var wall_cling_slide_speed: float = -1.5
@export var wall_cling_stamina_drain: float = 2.0
@export var wall_cling_max_stamina: float = 2.0
@export var wall_cling_stamina_drain: float = 1.0
@export var wall_cling_max_stamina: float = 2.5
# ── Grapple ───────────────────────────────────────────────────────────────────
@export var grapple_range: float = 30.0
@export var grapple_pull_force: float = 25.0
@export var grapple_range: float = 35.0
@export var grapple_pull_force: float = 18.0 # constant reel toward the hook
@export var grapple_reel_force: float = 22.0 # extra reel while holding forward
@export var grapple_jump_boost: float = 12.0
@export var grapple_spring_strength: float = 10.0
@export var grapple_air_control: float = 20.0
@export var grapple_spring_strength: float = 14.0
@export var grapple_air_control: float = 24.0
@export var grapple_shoot_speed: float = 70.0 # hook travel speed (m/s)
# ── Dash ──────────────────────────────────────────────────────────────────────
@export var dash_speed: float = 10.0
@export var dash_duration: float = 0.25
@export var dash_cooldown: float = 10.0
@export var dash_speed: float = 13.0
@export var dash_duration: float = 0.18
@export var dash_cooldown: float = 2.0
@export var dash_invulnerability_time: float = 0.1
# ── Landing feel ──────────────────────────────────────────────────────────────
@export var land_soft_speed: float = 8.0 # fall speed where landing feedback starts
@export var land_heavy_speed: float = 18.0 # fall speed considered a heavy landing
# ── Crouch ────────────────────────────────────────────────────────────────────
@export var crouch_transition_speed: float = 12.0 # capsule/camera height lerp rate
# ── Rocket Jump ───────────────────────────────────────────────────────────────
@export var rocket_jump_self_damage: float = 15.0
@export var rocket_jump_up_impulse: float = 20.0
@@ -106,3 +120,6 @@ class_name MovementParams
@export var head_bob_amplitude: float = 0.04
@export var wall_run_tilt_angle: float = 12.0
@export var wall_run_tilt_speed: float = 8.0
@export var slide_tilt_angle: float = 4.0
@export var land_dip_scale: float = 0.012 # camera dip per m/s of landing speed
@export var land_dip_max: float = 0.25 # max camera dip on heavy landings