|
group2 0.1.0
CSE 125 Group 2
|
Titanfall-inspired movement constants, adapted to Quake units. More...
Variables | |
| constexpr float | k_walkSpeed = 550.0f |
| Max wish speed when walking (u/s). | |
| constexpr float | k_walkForwardSpeed = 620.0f |
| Forward (W/S) wish speed on foot (u/s) — slightly faster than the legacy uniform value so a pure forward run feels punchier. | |
| constexpr float | k_walkStrafeSpeed = 350.0f |
| Side strafe (A/D) wish speed on foot (u/s). | |
| constexpr float | k_sprintSpeed = 550.0f |
| Deprecated: sprint removed. Kept equal to k_walkSpeed for safety. | |
| constexpr float | k_crouchSpeed = 350.0f |
| Max wish speed when crouching (u/s). | |
| constexpr float | k_adsSpeed = 280.0f |
| Max wish speed while ADS-ing a precision (charge) weapon (u/s). | |
| constexpr float | k_jumpSpeed = 660.0f |
| Upward velocity on ground jump (u/s). Must mirror physics::k_jumpSpeed. | |
| constexpr float | k_doubleJumpSpeed = 600.0f |
| Upward velocity on air jump (u/s). | |
| constexpr float | k_slidehopJumpSpeed = 500.0f |
| Upward velocity when jumping during slide (u/s). | |
| constexpr float | k_doubleJumpCooldown = 0.10f |
| Min time after first jump before double jump is allowed (s). | |
| constexpr float | k_doubleJumpHorizBoost = 400.0f |
| Horizontal velocity (u/s) toward WASD wishDir on double jump. | |
| constexpr float | k_doubleJumpGroundedRefreshTime = 0.5f |
| Continuous time grounded (s) needed to refresh DJ. | |
| constexpr float | k_coyoteTime = 0.15f |
| Grace period after leaving ground/wall to still jump (s). | |
| constexpr int | k_enableJumpLurch = 1 |
| Master enable for jump lurch (1 = enabled, 0 = disabled). | |
| constexpr float | k_jumpLurchMinGroundedTime = 0.3f |
| Min continuous grounded time before a ground jump re-arms lurch (s). | |
| constexpr float | k_jumpLurchGraceMin = 0.2f |
| Time after jump where lurch is at max strength (s). | |
| constexpr float | k_jumpLurchGraceMax = 0.5f |
| Time after jump where lurch is disabled entirely (s). | |
| constexpr float | k_jumpLurchStrength = 5.0f |
| Multiplier for lurch intensity. | |
| constexpr float | k_jumpLurchMax = 400.0f |
| Maximum lurch velocity magnitude (u/s). | |
| constexpr float | k_jumpLurchBaseVelocity = 100.0f |
| Base lurch velocity before scaling (u/s). | |
| constexpr float | k_jumpLurchSpeedLoss = 0.125f |
| Fraction of speed lost on lurch (12.5%). | |
| constexpr float | k_slideMinStartSpeed = 400.0f |
| Min horizontal speed to enter slide (u/s). | |
| constexpr float | k_slideMinSpeed = 200.0f |
| Slide cancels below this speed (u/s). | |
| constexpr float | k_slideBoostMin = 180.0f |
| Min speed boost on slide entry (u/s). | |
| constexpr float | k_slideBoostMax = 380.0f |
| Max speed boost on slide entry (u/s). | |
| constexpr float | k_slideBoostCooldown = 1.5f |
| Cooldown between slide boosts (s). | |
| constexpr float | k_slideBrakingDecelMin = 200.0f |
| Initial braking deceleration (u/s^2). | |
| constexpr float | k_slideBrakingDecelMax = 400.0f |
| Maximum braking deceleration (u/s^2). | |
| constexpr float | k_slideBrakingRampTime = 3.0f |
| Time to ramp from min to max braking (s). | |
| constexpr float | k_slideFloorInfluenceForce = 400.0f |
| How much slope angle affects slide speed (u/s^2). | |
| constexpr float | k_slideSteerTurnRate = 1.8f |
| Max heading turn rate while sliding (rad/s). | |
| constexpr int | k_slideFatigueDecayTicks = 200 |
| Ticks (at 128Hz = 3s) to reset one fatigue level. | |
| constexpr int | k_slideFatigueMax = 4 |
| Max fatigue levels (boost fully killed at this). | |
| constexpr float | k_wallrunCheckDist = 35.0f |
| Sphere-cast distance for side walls (u). | |
| constexpr float | k_wallrunSphereRadius = 12.0f |
| Sphere-cast radius for wall detection (u). | |
| constexpr float | k_wallrunMinGroundDist = 50.0f |
| Min height above ground to wallrun (u). | |
| constexpr float | k_wallrunMinAttachSpeed = 200.0f |
| Min horizontal speed required to enter wallrun (u/s). | |
| constexpr float | k_wallrunMinStaySpeed = 100.0f |
| Drop wallrun below this horizontal speed (u/s). | |
| constexpr float | k_wallrunSameWallReattachSpeed = 100.0f |
| Min inward speed to reattach a blacklisted wall (u/s). | |
| constexpr float | k_wallrunMaxSpeed = 800.0f |
| Max speed while wallrunning (u/s). | |
| constexpr float | k_wallrunAccel = 500.0f |
| Forward acceleration along wall (u/s^2). | |
| constexpr float | k_wallrunPushForce = 800.0f |
| Force pushing player toward wall (u/s^2). | |
| constexpr float | k_wallrunKickoffDuration = 5.0f |
| Max time on same wall before forced detach (s). | |
| constexpr float | k_wallrunSpeedLossDelay = 0.2f |
| Delay before clamping speed on wall (s). | |
| constexpr float | k_wallrunIntentThreshold = 0.1f |
| Min dot(wishDir, -wallNormal) to ENTER a wallrun. | |
| constexpr float | k_wallrunDetachThreshold = -0.26f |
| Min dot(wishDir, -wallNormal) to STAY on the wall. | |
| constexpr float | k_wallrunGripTime = 1.0f |
| Initial zero-gravity "grip" phase on a wall (s). | |
| constexpr float | k_wallrunGravityRampTime = 2.0f |
| Time to ramp gravity 0 → full after grip ends (s). | |
| constexpr float | k_wallJumpUpForce = 640.0f |
| Upward velocity on wall jump (u/s). | |
| constexpr float | k_wallJumpSideForce = 350.0f |
| Sideways velocity on wall jump (away from wall) (u/s). | |
| constexpr float | k_wallrunExitTime = 0.2f |
| Duration of "exiting wall" flag after leaving (s). | |
| constexpr float | k_wallrunCameraTilt = 7.5f |
| Camera roll when wallrunning (degrees). | |
| constexpr float | k_wallrunCameraTiltSpeed = 10.0f |
| Interpolation speed for camera tilt. | |
| constexpr float | k_wallrunEntryVerticalImpulse = 440.0f |
| Lucio-style upward kick when attaching (u/s). | |
| constexpr float | k_wallrunEntryVerticalCeiling = 640.0f |
| Maximum vertical speed after the entry kick (u/s). | |
| constexpr float | k_wallrunEntryHorizSnap = 1.0f |
| Horizontal speed retention on wallrun entry. | |
| constexpr float | k_wallrunVerticalDecayTau = 0.45f |
| Exponential vertical decay while attached (s). | |
| constexpr float | k_wallrunMaxFaceRedirect = 1.57079632679f |
| Max face-normal rotation accepted per tick (rad). | |
| constexpr float | k_speedCap = 7000.0f |
| Hard horizontal speed limit (u/s). | |
| constexpr float | k_bulletHitSlowFactor = 0.8f |
| Multiplier on wish speed while bullet-slowed (0.8 = 20% slow). | |
| constexpr float | k_bulletHitSlowDuration = 0.5f |
| Seconds the slow lingers after the last bullet hit. | |
| constexpr float | k_playerCapsuleRadius = 16.0f |
| Capsule cross-section radius (u), fixed across stances. | |
| constexpr float | k_standingHalfHeight = 36.0f |
| Standing AABB half-height (u). | |
| constexpr float | k_crouchingHalfHeight = 22.0f |
| Crouching/sliding AABB half-height (u). | |
| constexpr float | k_standingCapsuleHalfHeight = k_standingHalfHeight - k_playerCapsuleRadius |
| Capsule segment half-length when standing. | |
| constexpr float | k_crouchingCapsuleHalfHeight = k_crouchingHalfHeight - k_playerCapsuleRadius |
| Capsule segment half-length when crouching. | |
| constexpr float | k_grappleMaxRange = 2200.0f |
| Max hook distance (nerfed from 4000 — shorter reach). | |
| constexpr float | k_grapplePullSpeed |
| Direct velocity toward anchor (u/s). Overrides, not additive (nerfed from 4000 — slower pull). | |
| constexpr float | k_grappleDetachDist = 80.0f |
| Auto-detach when this close to anchor (~2 m). | |
| constexpr float | k_grappleMaxDuration = 5.0f |
| Safety timeout (s). | |
| constexpr float | k_grappleCooldown = 5.0f |
| Cooldown between grapples (s). | |
| constexpr float | k_grappleLaunchLookBias |
| Look-direction weight on detach launch (0 = pure grapple dir, 1 = pure look). | |
| constexpr float | k_grappleLaunchSpeedMult = 1.15f |
| Speed multiplier on launch (slight boost for momentum). | |
| constexpr float | k_grapplePerchFeetOffset = 50.0f |
| Feet height above the hook point in perch mode (u). | |
| constexpr float | k_grapplePerchVerticalGain = 8.0f |
| Vertical-pull P-controller gain (1/s). | |
| constexpr float | k_grapplePerchRiseRange = 100.0f |
| Altitude diff (u) below target at which horizontal speed bottoms out — controls how steep the rise phase feels. | |
| constexpr float | k_grapplePerchMinHorizFactor = 0.25f |
| Floor on horizontal-speed throttle while below target. | |
Titanfall-inspired movement constants, adapted to Quake units.
All speeds in units/second, distances in units, times in seconds. Tuned to replicate the TMS (Titanfall Movement System) feel within our custom swept-AABB engine at 128 Hz physics.
See docs/titanfall-movement-design.md for conversion rationale.
|
constexpr |
Max wish speed while ADS-ing a precision (charge) weapon (u/s).
20% slower than crouch — keeps the charge rifle's RMB stance deliberate without freezing the player in place.
|
constexpr |
Seconds the slow lingers after the last bullet hit.
Each new hit refreshes the timer, so sustained fire keeps the target slowed.
|
constexpr |
Multiplier on wish speed while bullet-slowed (0.8 = 20% slow).
|
constexpr |
Grace period after leaving ground/wall to still jump (s).
|
constexpr |
Capsule segment half-length when crouching.
|
constexpr |
Crouching/sliding AABB half-height (u).
|
constexpr |
Max wish speed when crouching (u/s).
|
constexpr |
Min time after first jump before double jump is allowed (s).
|
constexpr |
Continuous time grounded (s) needed to refresh DJ.
DJ does NOT refresh from wall jump, slidehop, or instant landing — only by being on the ground (OnFoot) for this long. Counters DJ-dash spam.
|
constexpr |
Horizontal velocity (u/s) toward WASD wishDir on double jump.
Replaces horizontal velocity with wishDir * max(this, currentHs) so the second jump becomes an air dash. If no WASD held, horizontal momentum is preserved.
|
constexpr |
Upward velocity on air jump (u/s).
|
constexpr |
Master enable for jump lurch (1 = enabled, 0 = disabled).
|
constexpr |
Cooldown between grapples (s).
|
constexpr |
Auto-detach when this close to anchor (~2 m).
|
constexpr |
Look-direction weight on detach launch (0 = pure grapple dir, 1 = pure look).
|
constexpr |
Speed multiplier on launch (slight boost for momentum).
|
constexpr |
Safety timeout (s).
|
constexpr |
Max hook distance (nerfed from 4000 — shorter reach).
|
constexpr |
Feet height above the hook point in perch mode (u).
Lets you grapple to a corner/wall and land on top of the platform rather than slamming into the surface you hooked.
|
constexpr |
Floor on horizontal-speed throttle while below target.
0.0 = freezes XZ when below; 1.0 = no rise bias at all.
|
constexpr |
Altitude diff (u) below target at which horizontal speed bottoms out — controls how steep the rise phase feels.
|
constexpr |
Vertical-pull P-controller gain (1/s).
Final vy is clamped to ±k_grapplePullSpeed so very tall arcs are bounded.
|
constexpr |
Direct velocity toward anchor (u/s). Overrides, not additive (nerfed from 4000 — slower pull).
|
constexpr |
Base lurch velocity before scaling (u/s).
|
constexpr |
Time after jump where lurch is disabled entirely (s).
|
constexpr |
Time after jump where lurch is at max strength (s).
|
constexpr |
Maximum lurch velocity magnitude (u/s).
|
constexpr |
Min continuous grounded time before a ground jump re-arms lurch (s).
Prevents lurch from firing on bhop-chain jumps where the player only touches the ground for 1-2 ticks between hops.
|
constexpr |
Fraction of speed lost on lurch (12.5%).
|
constexpr |
Multiplier for lurch intensity.
|
constexpr |
Upward velocity on ground jump (u/s). Must mirror physics::k_jumpSpeed.
|
constexpr |
Capsule cross-section radius (u), fixed across stances.
|
constexpr |
Cooldown between slide boosts (s).
|
constexpr |
Max speed boost on slide entry (u/s).
|
constexpr |
Min speed boost on slide entry (u/s).
|
constexpr |
Maximum braking deceleration (u/s^2).
|
constexpr |
Initial braking deceleration (u/s^2).
|
constexpr |
Time to ramp from min to max braking (s).
|
constexpr |
Ticks (at 128Hz = 3s) to reset one fatigue level.
|
constexpr |
Max fatigue levels (boost fully killed at this).
|
constexpr |
How much slope angle affects slide speed (u/s^2).
|
constexpr |
Upward velocity when jumping during slide (u/s).
|
constexpr |
Slide cancels below this speed (u/s).
|
constexpr |
Min horizontal speed to enter slide (u/s).
|
constexpr |
Max heading turn rate while sliding (rad/s).
The slide's velocity is rotated toward the WASD/view wish direction at up to this rate, preserving speed, so the player can carve their trajectory without instantly pivoting.
|
constexpr |
Hard horizontal speed limit (u/s).
|
constexpr |
Deprecated: sprint removed. Kept equal to k_walkSpeed for safety.
|
constexpr |
Capsule segment half-length when standing.
|
constexpr |
Standing AABB half-height (u).
|
constexpr |
Forward (W/S) wish speed on foot (u/s) — slightly faster than the legacy uniform value so a pure forward run feels punchier.
|
constexpr |
Max wish speed when walking (u/s).
Sprint removed; this is the only base speed. Kept for non-walking callers (currentWishSpeed, DebugUI). On-foot walking uses the asymmetric forward/strafe pair below.
|
constexpr |
Side strafe (A/D) wish speed on foot (u/s).
Sits below k_slideMinStartSpeed so pure-strafe momentum can never trigger a slide.
|
constexpr |
Sideways velocity on wall jump (away from wall) (u/s).
|
constexpr |
Upward velocity on wall jump (u/s).
|
constexpr |
Forward acceleration along wall (u/s^2).
|
constexpr |
Camera roll when wallrunning (degrees).
|
constexpr |
Interpolation speed for camera tilt.
|
constexpr |
Sphere-cast distance for side walls (u).
|
constexpr |
Min dot(wishDir, -wallNormal) to STAY on the wall.
Negative = 15° grace past the wall plane, so the player can start looking away before detaching. cos(105°) ≈ -0.26.
|
constexpr |
Horizontal speed retention on wallrun entry.
|
constexpr |
Maximum vertical speed after the entry kick (u/s).
|
constexpr |
Lucio-style upward kick when attaching (u/s).
|
constexpr |
Duration of "exiting wall" flag after leaving (s).
|
constexpr |
Time to ramp gravity 0 → full after grip ends (s).
Produces a natural slide-off so the player can't wallrun indefinitely even before the hard kickoff.
|
constexpr |
Initial zero-gravity "grip" phase on a wall (s).
During this window the player is pinned (vel.y = 0); after it, gravity leaks in gradually.
|
constexpr |
Min dot(wishDir, -wallNormal) to ENTER a wallrun.
0.1 ≈ 84° off-axis tolerance.
|
constexpr |
Max time on same wall before forced detach (s).
At this point the wall lets go: no impulse, no jump refresh — the player drops off and gravity takes over.
|
constexpr |
Max face-normal rotation accepted per tick (rad).
|
constexpr |
Max speed while wallrunning (u/s).
|
constexpr |
Min horizontal speed required to enter wallrun (u/s).
|
constexpr |
Min height above ground to wallrun (u).
|
constexpr |
Drop wallrun below this horizontal speed (u/s).
|
constexpr |
Force pushing player toward wall (u/s^2).
|
constexpr |
Min inward speed to reattach a blacklisted wall (u/s).
|
constexpr |
Delay before clamping speed on wall (s).
|
constexpr |
Sphere-cast radius for wall detection (u).
|
constexpr |
Exponential vertical decay while attached (s).