group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
tms Namespace Reference

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.

Detailed Description

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.

Variable Documentation

◆ k_adsSpeed

float tms::k_adsSpeed = 280.0f
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.

◆ k_bulletHitSlowDuration

float tms::k_bulletHitSlowDuration = 0.5f
constexpr

Seconds the slow lingers after the last bullet hit.

Each new hit refreshes the timer, so sustained fire keeps the target slowed.

◆ k_bulletHitSlowFactor

float tms::k_bulletHitSlowFactor = 0.8f
constexpr

Multiplier on wish speed while bullet-slowed (0.8 = 20% slow).

◆ k_coyoteTime

float tms::k_coyoteTime = 0.15f
constexpr

Grace period after leaving ground/wall to still jump (s).

◆ k_crouchingCapsuleHalfHeight

float tms::k_crouchingCapsuleHalfHeight = k_crouchingHalfHeight - k_playerCapsuleRadius
constexpr

Capsule segment half-length when crouching.

◆ k_crouchingHalfHeight

float tms::k_crouchingHalfHeight = 22.0f
constexpr

Crouching/sliding AABB half-height (u).

◆ k_crouchSpeed

float tms::k_crouchSpeed = 350.0f
constexpr

Max wish speed when crouching (u/s).

◆ k_doubleJumpCooldown

float tms::k_doubleJumpCooldown = 0.10f
constexpr

Min time after first jump before double jump is allowed (s).

◆ k_doubleJumpGroundedRefreshTime

float tms::k_doubleJumpGroundedRefreshTime = 0.5f
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.

◆ k_doubleJumpHorizBoost

float tms::k_doubleJumpHorizBoost = 400.0f
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.

◆ k_doubleJumpSpeed

float tms::k_doubleJumpSpeed = 600.0f
constexpr

Upward velocity on air jump (u/s).

◆ k_enableJumpLurch

int tms::k_enableJumpLurch = 1
constexpr

Master enable for jump lurch (1 = enabled, 0 = disabled).

◆ k_grappleCooldown

float tms::k_grappleCooldown = 5.0f
constexpr

Cooldown between grapples (s).

◆ k_grappleDetachDist

float tms::k_grappleDetachDist = 80.0f
constexpr

Auto-detach when this close to anchor (~2 m).

◆ k_grappleLaunchLookBias

float tms::k_grappleLaunchLookBias
constexpr
Initial value:
=
0.6f

Look-direction weight on detach launch (0 = pure grapple dir, 1 = pure look).

◆ k_grappleLaunchSpeedMult

float tms::k_grappleLaunchSpeedMult = 1.15f
constexpr

Speed multiplier on launch (slight boost for momentum).

◆ k_grappleMaxDuration

float tms::k_grappleMaxDuration = 5.0f
constexpr

Safety timeout (s).

◆ k_grappleMaxRange

float tms::k_grappleMaxRange = 2200.0f
constexpr

Max hook distance (nerfed from 4000 — shorter reach).

◆ k_grapplePerchFeetOffset

float tms::k_grapplePerchFeetOffset = 50.0f
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.

◆ k_grapplePerchMinHorizFactor

float tms::k_grapplePerchMinHorizFactor = 0.25f
constexpr

Floor on horizontal-speed throttle while below target.

0.0 = freezes XZ when below; 1.0 = no rise bias at all.

◆ k_grapplePerchRiseRange

float tms::k_grapplePerchRiseRange = 100.0f
constexpr

Altitude diff (u) below target at which horizontal speed bottoms out — controls how steep the rise phase feels.

◆ k_grapplePerchVerticalGain

float tms::k_grapplePerchVerticalGain = 8.0f
constexpr

Vertical-pull P-controller gain (1/s).

Final vy is clamped to ±k_grapplePullSpeed so very tall arcs are bounded.

◆ k_grapplePullSpeed

float tms::k_grapplePullSpeed
constexpr
Initial value:
=
2400.0f

Direct velocity toward anchor (u/s). Overrides, not additive (nerfed from 4000 — slower pull).

◆ k_jumpLurchBaseVelocity

float tms::k_jumpLurchBaseVelocity = 100.0f
constexpr

Base lurch velocity before scaling (u/s).

◆ k_jumpLurchGraceMax

float tms::k_jumpLurchGraceMax = 0.5f
constexpr

Time after jump where lurch is disabled entirely (s).

◆ k_jumpLurchGraceMin

float tms::k_jumpLurchGraceMin = 0.2f
constexpr

Time after jump where lurch is at max strength (s).

◆ k_jumpLurchMax

float tms::k_jumpLurchMax = 400.0f
constexpr

Maximum lurch velocity magnitude (u/s).

◆ k_jumpLurchMinGroundedTime

float tms::k_jumpLurchMinGroundedTime = 0.3f
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.

◆ k_jumpLurchSpeedLoss

float tms::k_jumpLurchSpeedLoss = 0.125f
constexpr

Fraction of speed lost on lurch (12.5%).

◆ k_jumpLurchStrength

float tms::k_jumpLurchStrength = 5.0f
constexpr

Multiplier for lurch intensity.

◆ k_jumpSpeed

float tms::k_jumpSpeed = 660.0f
constexpr

Upward velocity on ground jump (u/s). Must mirror physics::k_jumpSpeed.

◆ k_playerCapsuleRadius

float tms::k_playerCapsuleRadius = 16.0f
constexpr

Capsule cross-section radius (u), fixed across stances.

◆ k_slideBoostCooldown

float tms::k_slideBoostCooldown = 1.5f
constexpr

Cooldown between slide boosts (s).

◆ k_slideBoostMax

float tms::k_slideBoostMax = 380.0f
constexpr

Max speed boost on slide entry (u/s).

◆ k_slideBoostMin

float tms::k_slideBoostMin = 180.0f
constexpr

Min speed boost on slide entry (u/s).

◆ k_slideBrakingDecelMax

float tms::k_slideBrakingDecelMax = 400.0f
constexpr

Maximum braking deceleration (u/s^2).

◆ k_slideBrakingDecelMin

float tms::k_slideBrakingDecelMin = 200.0f
constexpr

Initial braking deceleration (u/s^2).

◆ k_slideBrakingRampTime

float tms::k_slideBrakingRampTime = 3.0f
constexpr

Time to ramp from min to max braking (s).

◆ k_slideFatigueDecayTicks

int tms::k_slideFatigueDecayTicks = 200
constexpr

Ticks (at 128Hz = 3s) to reset one fatigue level.

◆ k_slideFatigueMax

int tms::k_slideFatigueMax = 4
constexpr

Max fatigue levels (boost fully killed at this).

◆ k_slideFloorInfluenceForce

float tms::k_slideFloorInfluenceForce = 400.0f
constexpr

How much slope angle affects slide speed (u/s^2).

◆ k_slidehopJumpSpeed

float tms::k_slidehopJumpSpeed = 500.0f
constexpr

Upward velocity when jumping during slide (u/s).

◆ k_slideMinSpeed

float tms::k_slideMinSpeed = 200.0f
constexpr

Slide cancels below this speed (u/s).

◆ k_slideMinStartSpeed

float tms::k_slideMinStartSpeed = 400.0f
constexpr

Min horizontal speed to enter slide (u/s).

◆ k_slideSteerTurnRate

float tms::k_slideSteerTurnRate = 1.8f
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.

◆ k_speedCap

float tms::k_speedCap = 7000.0f
constexpr

Hard horizontal speed limit (u/s).

◆ k_sprintSpeed

float tms::k_sprintSpeed = 550.0f
constexpr

Deprecated: sprint removed. Kept equal to k_walkSpeed for safety.

◆ k_standingCapsuleHalfHeight

float tms::k_standingCapsuleHalfHeight = k_standingHalfHeight - k_playerCapsuleRadius
constexpr

Capsule segment half-length when standing.

◆ k_standingHalfHeight

float tms::k_standingHalfHeight = 36.0f
constexpr

Standing AABB half-height (u).

◆ k_walkForwardSpeed

float tms::k_walkForwardSpeed = 620.0f
constexpr

Forward (W/S) wish speed on foot (u/s) — slightly faster than the legacy uniform value so a pure forward run feels punchier.

◆ k_walkSpeed

float tms::k_walkSpeed = 550.0f
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.

◆ k_walkStrafeSpeed

float tms::k_walkStrafeSpeed = 350.0f
constexpr

Side strafe (A/D) wish speed on foot (u/s).

Sits below k_slideMinStartSpeed so pure-strafe momentum can never trigger a slide.

◆ k_wallJumpSideForce

float tms::k_wallJumpSideForce = 350.0f
constexpr

Sideways velocity on wall jump (away from wall) (u/s).

◆ k_wallJumpUpForce

float tms::k_wallJumpUpForce = 640.0f
constexpr

Upward velocity on wall jump (u/s).

◆ k_wallrunAccel

float tms::k_wallrunAccel = 500.0f
constexpr

Forward acceleration along wall (u/s^2).

◆ k_wallrunCameraTilt

float tms::k_wallrunCameraTilt = 7.5f
constexpr

Camera roll when wallrunning (degrees).

◆ k_wallrunCameraTiltSpeed

float tms::k_wallrunCameraTiltSpeed = 10.0f
constexpr

Interpolation speed for camera tilt.

◆ k_wallrunCheckDist

float tms::k_wallrunCheckDist = 35.0f
constexpr

Sphere-cast distance for side walls (u).

◆ k_wallrunDetachThreshold

float tms::k_wallrunDetachThreshold = -0.26f
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.

◆ k_wallrunEntryHorizSnap

float tms::k_wallrunEntryHorizSnap = 1.0f
constexpr

Horizontal speed retention on wallrun entry.

◆ k_wallrunEntryVerticalCeiling

float tms::k_wallrunEntryVerticalCeiling = 640.0f
constexpr

Maximum vertical speed after the entry kick (u/s).

◆ k_wallrunEntryVerticalImpulse

float tms::k_wallrunEntryVerticalImpulse = 440.0f
constexpr

Lucio-style upward kick when attaching (u/s).

◆ k_wallrunExitTime

float tms::k_wallrunExitTime = 0.2f
constexpr

Duration of "exiting wall" flag after leaving (s).

◆ k_wallrunGravityRampTime

float tms::k_wallrunGravityRampTime = 2.0f
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.

◆ k_wallrunGripTime

float tms::k_wallrunGripTime = 1.0f
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.

◆ k_wallrunIntentThreshold

float tms::k_wallrunIntentThreshold = 0.1f
constexpr

Min dot(wishDir, -wallNormal) to ENTER a wallrun.

0.1 ≈ 84° off-axis tolerance.

◆ k_wallrunKickoffDuration

float tms::k_wallrunKickoffDuration = 5.0f
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.

◆ k_wallrunMaxFaceRedirect

float tms::k_wallrunMaxFaceRedirect = 1.57079632679f
constexpr

Max face-normal rotation accepted per tick (rad).

◆ k_wallrunMaxSpeed

float tms::k_wallrunMaxSpeed = 800.0f
constexpr

Max speed while wallrunning (u/s).

◆ k_wallrunMinAttachSpeed

float tms::k_wallrunMinAttachSpeed = 200.0f
constexpr

Min horizontal speed required to enter wallrun (u/s).

◆ k_wallrunMinGroundDist

float tms::k_wallrunMinGroundDist = 50.0f
constexpr

Min height above ground to wallrun (u).

◆ k_wallrunMinStaySpeed

float tms::k_wallrunMinStaySpeed = 100.0f
constexpr

Drop wallrun below this horizontal speed (u/s).

◆ k_wallrunPushForce

float tms::k_wallrunPushForce = 800.0f
constexpr

Force pushing player toward wall (u/s^2).

◆ k_wallrunSameWallReattachSpeed

float tms::k_wallrunSameWallReattachSpeed = 100.0f
constexpr

Min inward speed to reattach a blacklisted wall (u/s).

◆ k_wallrunSpeedLossDelay

float tms::k_wallrunSpeedLossDelay = 0.2f
constexpr

Delay before clamping speed on wall (s).

◆ k_wallrunSphereRadius

float tms::k_wallrunSphereRadius = 12.0f
constexpr

Sphere-cast radius for wall detection (u).

◆ k_wallrunVerticalDecayTau

float tms::k_wallrunVerticalDecayTau = 0.45f
constexpr

Exponential vertical decay while attached (s).