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 = 320.0f
 Max wish speed when walking (u/s).
 
constexpr float k_sprintSpeed = 530.0f
 Max wish speed when sprinting (u/s).
 
constexpr float k_crouchSpeed = 200.0f
 Max wish speed when crouching (u/s).
 
constexpr float k_jumpSpeed = 380.0f
 Upward velocity on ground jump (u/s).
 
constexpr float k_doubleJumpSpeed = 340.0f
 Upward velocity on air jump (u/s).
 
constexpr float k_slidehopJumpSpeed = 280.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_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 = 180.0f
 Maximum lurch velocity magnitude (u/s).
 
constexpr float k_jumpLurchBaseVelocity = 60.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 = 100.0f
 Slide cancels below this speed (u/s).
 
constexpr float k_slideBoostMin = 80.0f
 Min speed boost on slide entry (u/s).
 
constexpr float k_slideBoostMax = 200.0f
 Max speed boost on slide entry (u/s).
 
constexpr float k_slideBoostCooldown = 2.0f
 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 int k_slideFatigueDecayTicks = 384
 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_wallrunMaxSpeed = 630.0f
 Max speed while wallrunning (u/s).
 
constexpr float k_wallrunAccel = 800.0f
 Forward acceleration along wall (u/s^2).
 
constexpr float k_wallrunPushForce = 300.0f
 Force pushing player toward wall (u/s^2).
 
constexpr float k_wallrunKickoffDuration = 1.75f
 Max time on same wall before kickoff (s).
 
constexpr float k_wallrunSpeedLossDelay = 0.1f
 Delay before clamping speed on wall (s).
 
constexpr float k_wallrunIntentThreshold = 0.1f
 Min dot(wishDir, -wallNormal) to enter/maintain a wallrun.
 
constexpr float k_wallrunGripTime = 0.5f
 Initial zero-gravity "grip" phase on a wall (s).
 
constexpr float k_wallrunGravityRampTime = 1.0f
 Time to ramp gravity 0 → full after grip ends (s).
 
constexpr float k_wallJumpUpForce = 320.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_climbCheckDist = 35.0f
 Forward sphere-cast distance (u).
 
constexpr float k_climbSphereRadius = 12.0f
 Sphere-cast radius for climb detection (u).
 
constexpr float k_climbMaxSpeed = 280.0f
 Max upward climbing speed (u/s).
 
constexpr float k_climbMinSpeed = 180.0f
 Min climbing speed (after decay) (u/s).
 
constexpr float k_climbKickoffDuration = 1.5f
 Max climb time on same wall (s).
 
constexpr float k_climbMaxWallLookAngle = 30.0f
 Max angle (degrees) between look dir and wall normal.
 
constexpr float k_climbSidewaysMultiplier = 0.1f
 Sideways movement reduction while climbing.
 
constexpr float k_climbJumpUpForce = 320.0f
 Upward velocity on climb jump (u/s).
 
constexpr float k_climbJumpBackForce = 350.0f
 Backward velocity on climb jump (u/s).
 
constexpr float k_climbMinGroundDist = 40.0f
 Min height above ground to start climbing (u).
 
constexpr float k_climbExitTime = 0.5f
 Duration of "exiting climb" flag (s).
 
constexpr float k_climbRegrabLowerHeight = 400.0f
 Must be this much lower to regrab same wall (u).
 
constexpr float k_ledgeCheckDist = 35.0f
 Forward trace distance for ledge detection (u).
 
constexpr float k_ledgeSphereRadius = 12.0f
 Sphere-cast radius for ledge traces (u).
 
constexpr float k_ledgeMaxGrabDist = 35.0f
 Max distance from ledge surface to grab (u).
 
constexpr float k_ledgeMinHoldTime = 0.5f
 Min time frozen on ledge before release (s).
 
constexpr float k_ledgeMoveAccel = 800.0f
 Acceleration pulling player toward ledge (u/s^2).
 
constexpr float k_ledgeMaxSpeed = 400.0f
 Max speed of pull toward ledge (u/s).
 
constexpr float k_ledgeJumpUpForce = 380.0f
 Upward velocity on ledge jump / mantle (u/s).
 
constexpr float k_ledgeJumpBackForce = 120.0f
 Backward velocity on ledge jump (u/s).
 
constexpr float k_ledgeExitTime = 0.5f
 Duration of "exiting ledge" flag (s).
 
constexpr float k_speedCap = 7000.0f
 Hard horizontal speed limit (u/s).
 
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_grappleMaxRange = 800.0f
 Max hook distance (~20 m in Quake units).
 
constexpr float k_grapplePullSpeed = 800.0f
 Direct velocity toward anchor (u/s). Overrides, not additive.
 
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 = 6.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).
 

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_climbCheckDist

constexpr float tms::k_climbCheckDist = 35.0f
constexpr

Forward sphere-cast distance (u).

◆ k_climbExitTime

constexpr float tms::k_climbExitTime = 0.5f
constexpr

Duration of "exiting climb" flag (s).

◆ k_climbJumpBackForce

constexpr float tms::k_climbJumpBackForce = 350.0f
constexpr

Backward velocity on climb jump (u/s).

◆ k_climbJumpUpForce

constexpr float tms::k_climbJumpUpForce = 320.0f
constexpr

Upward velocity on climb jump (u/s).

◆ k_climbKickoffDuration

constexpr float tms::k_climbKickoffDuration = 1.5f
constexpr

Max climb time on same wall (s).

◆ k_climbMaxSpeed

constexpr float tms::k_climbMaxSpeed = 280.0f
constexpr

Max upward climbing speed (u/s).

◆ k_climbMaxWallLookAngle

constexpr float tms::k_climbMaxWallLookAngle = 30.0f
constexpr

Max angle (degrees) between look dir and wall normal.

◆ k_climbMinGroundDist

constexpr float tms::k_climbMinGroundDist = 40.0f
constexpr

Min height above ground to start climbing (u).

◆ k_climbMinSpeed

constexpr float tms::k_climbMinSpeed = 180.0f
constexpr

Min climbing speed (after decay) (u/s).

◆ k_climbRegrabLowerHeight

constexpr float tms::k_climbRegrabLowerHeight = 400.0f
constexpr

Must be this much lower to regrab same wall (u).

◆ k_climbSidewaysMultiplier

constexpr float tms::k_climbSidewaysMultiplier = 0.1f
constexpr

Sideways movement reduction while climbing.

◆ k_climbSphereRadius

constexpr float tms::k_climbSphereRadius = 12.0f
constexpr

Sphere-cast radius for climb detection (u).

◆ k_coyoteTime

constexpr float tms::k_coyoteTime = 0.15f
constexpr

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

◆ k_crouchingHalfHeight

constexpr float tms::k_crouchingHalfHeight = 22.0f
constexpr

Crouching/sliding AABB half-height (u).

◆ k_crouchSpeed

constexpr float tms::k_crouchSpeed = 200.0f
constexpr

Max wish speed when crouching (u/s).

◆ k_doubleJumpCooldown

constexpr float tms::k_doubleJumpCooldown = 0.10f
constexpr

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

◆ k_doubleJumpSpeed

constexpr float tms::k_doubleJumpSpeed = 340.0f
constexpr

Upward velocity on air jump (u/s).

◆ k_enableJumpLurch

constexpr int tms::k_enableJumpLurch = 1
constexpr

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

◆ k_grappleCooldown

constexpr float tms::k_grappleCooldown = 6.0f
constexpr

Cooldown between grapples (s).

◆ k_grappleDetachDist

constexpr float tms::k_grappleDetachDist = 80.0f
constexpr

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

◆ k_grappleLaunchLookBias

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

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

◆ k_grappleLaunchSpeedMult

constexpr float tms::k_grappleLaunchSpeedMult = 1.15f
constexpr

Speed multiplier on launch (slight boost for momentum).

◆ k_grappleMaxDuration

constexpr float tms::k_grappleMaxDuration = 5.0f
constexpr

Safety timeout (s).

◆ k_grappleMaxRange

constexpr float tms::k_grappleMaxRange = 800.0f
constexpr

Max hook distance (~20 m in Quake units).

◆ k_grapplePullSpeed

constexpr float tms::k_grapplePullSpeed = 800.0f
constexpr

Direct velocity toward anchor (u/s). Overrides, not additive.

◆ k_jumpLurchBaseVelocity

constexpr float tms::k_jumpLurchBaseVelocity = 60.0f
constexpr

Base lurch velocity before scaling (u/s).

◆ k_jumpLurchGraceMax

constexpr float tms::k_jumpLurchGraceMax = 0.5f
constexpr

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

◆ k_jumpLurchGraceMin

constexpr float tms::k_jumpLurchGraceMin = 0.2f
constexpr

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

◆ k_jumpLurchMax

constexpr float tms::k_jumpLurchMax = 180.0f
constexpr

Maximum lurch velocity magnitude (u/s).

◆ k_jumpLurchMinGroundedTime

constexpr 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

constexpr float tms::k_jumpLurchSpeedLoss = 0.125f
constexpr

Fraction of speed lost on lurch (12.5%).

◆ k_jumpLurchStrength

constexpr float tms::k_jumpLurchStrength = 5.0f
constexpr

Multiplier for lurch intensity.

◆ k_jumpSpeed

constexpr float tms::k_jumpSpeed = 380.0f
constexpr

Upward velocity on ground jump (u/s).

◆ k_ledgeCheckDist

constexpr float tms::k_ledgeCheckDist = 35.0f
constexpr

Forward trace distance for ledge detection (u).

◆ k_ledgeExitTime

constexpr float tms::k_ledgeExitTime = 0.5f
constexpr

Duration of "exiting ledge" flag (s).

◆ k_ledgeJumpBackForce

constexpr float tms::k_ledgeJumpBackForce = 120.0f
constexpr

Backward velocity on ledge jump (u/s).

◆ k_ledgeJumpUpForce

constexpr float tms::k_ledgeJumpUpForce = 380.0f
constexpr

Upward velocity on ledge jump / mantle (u/s).

◆ k_ledgeMaxGrabDist

constexpr float tms::k_ledgeMaxGrabDist = 35.0f
constexpr

Max distance from ledge surface to grab (u).

◆ k_ledgeMaxSpeed

constexpr float tms::k_ledgeMaxSpeed = 400.0f
constexpr

Max speed of pull toward ledge (u/s).

◆ k_ledgeMinHoldTime

constexpr float tms::k_ledgeMinHoldTime = 0.5f
constexpr

Min time frozen on ledge before release (s).

◆ k_ledgeMoveAccel

constexpr float tms::k_ledgeMoveAccel = 800.0f
constexpr

Acceleration pulling player toward ledge (u/s^2).

◆ k_ledgeSphereRadius

constexpr float tms::k_ledgeSphereRadius = 12.0f
constexpr

Sphere-cast radius for ledge traces (u).

◆ k_slideBoostCooldown

constexpr float tms::k_slideBoostCooldown = 2.0f
constexpr

Cooldown between slide boosts (s).

◆ k_slideBoostMax

constexpr float tms::k_slideBoostMax = 200.0f
constexpr

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

◆ k_slideBoostMin

constexpr float tms::k_slideBoostMin = 80.0f
constexpr

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

◆ k_slideBrakingDecelMax

constexpr float tms::k_slideBrakingDecelMax = 400.0f
constexpr

Maximum braking deceleration (u/s^2).

◆ k_slideBrakingDecelMin

constexpr float tms::k_slideBrakingDecelMin = 200.0f
constexpr

Initial braking deceleration (u/s^2).

◆ k_slideBrakingRampTime

constexpr float tms::k_slideBrakingRampTime = 3.0f
constexpr

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

◆ k_slideFatigueDecayTicks

constexpr int tms::k_slideFatigueDecayTicks = 384
constexpr

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

◆ k_slideFatigueMax

constexpr int tms::k_slideFatigueMax = 4
constexpr

Max fatigue levels (boost fully killed at this).

◆ k_slideFloorInfluenceForce

constexpr float tms::k_slideFloorInfluenceForce = 400.0f
constexpr

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

◆ k_slidehopJumpSpeed

constexpr float tms::k_slidehopJumpSpeed = 280.0f
constexpr

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

◆ k_slideMinSpeed

constexpr float tms::k_slideMinSpeed = 100.0f
constexpr

Slide cancels below this speed (u/s).

◆ k_slideMinStartSpeed

constexpr float tms::k_slideMinStartSpeed = 400.0f
constexpr

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

◆ k_speedCap

constexpr float tms::k_speedCap = 7000.0f
constexpr

Hard horizontal speed limit (u/s).

◆ k_sprintSpeed

constexpr float tms::k_sprintSpeed = 530.0f
constexpr

Max wish speed when sprinting (u/s).

◆ k_standingHalfHeight

constexpr float tms::k_standingHalfHeight = 36.0f
constexpr

Standing AABB half-height (u).

◆ k_walkSpeed

constexpr float tms::k_walkSpeed = 320.0f
constexpr

Max wish speed when walking (u/s).

◆ k_wallJumpSideForce

constexpr float tms::k_wallJumpSideForce = 350.0f
constexpr

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

◆ k_wallJumpUpForce

constexpr float tms::k_wallJumpUpForce = 320.0f
constexpr

Upward velocity on wall jump (u/s).

◆ k_wallrunAccel

constexpr float tms::k_wallrunAccel = 800.0f
constexpr

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

◆ k_wallrunCameraTilt

constexpr float tms::k_wallrunCameraTilt = 7.5f
constexpr

Camera roll when wallrunning (degrees).

◆ k_wallrunCameraTiltSpeed

constexpr float tms::k_wallrunCameraTiltSpeed = 10.0f
constexpr

Interpolation speed for camera tilt.

◆ k_wallrunCheckDist

constexpr float tms::k_wallrunCheckDist = 35.0f
constexpr

Sphere-cast distance for side walls (u).

◆ k_wallrunExitTime

constexpr float tms::k_wallrunExitTime = 0.2f
constexpr

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

◆ k_wallrunGravityRampTime

constexpr float tms::k_wallrunGravityRampTime = 1.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

constexpr float tms::k_wallrunGripTime = 0.5f
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

constexpr float tms::k_wallrunIntentThreshold = 0.1f
constexpr

Min dot(wishDir, -wallNormal) to enter/maintain a wallrun.

Rotation-symmetric directional intent — the player's wish direction must have a component pointing into the wall. 0.1 ≈ 84° off-axis tolerance.

◆ k_wallrunKickoffDuration

constexpr float tms::k_wallrunKickoffDuration = 1.75f
constexpr

Max time on same wall before kickoff (s).

◆ k_wallrunMaxSpeed

constexpr float tms::k_wallrunMaxSpeed = 630.0f
constexpr

Max speed while wallrunning (u/s).

◆ k_wallrunMinGroundDist

constexpr float tms::k_wallrunMinGroundDist = 50.0f
constexpr

Min height above ground to wallrun (u).

◆ k_wallrunPushForce

constexpr float tms::k_wallrunPushForce = 300.0f
constexpr

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

◆ k_wallrunSpeedLossDelay

constexpr float tms::k_wallrunSpeedLossDelay = 0.1f
constexpr

Delay before clamping speed on wall (s).

◆ k_wallrunSphereRadius

constexpr float tms::k_wallrunSphereRadius = 12.0f
constexpr

Sphere-cast radius for wall detection (u).