group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
TitanfallConstants.hpp
Go to the documentation of this file.
1
3
4#pragma once
5
13namespace tms
14{
15
16// Ground movement speeds
17
18constexpr float k_walkSpeed =
19 550.0f;
20constexpr float k_sprintSpeed = 550.0f;
21constexpr float k_crouchSpeed = 350.0f;
22constexpr float k_adsSpeed = 280.0f;
25
26// Jumping
27
28constexpr float k_jumpSpeed = 660.0f;
29constexpr float k_doubleJumpSpeed = 600.0f;
30constexpr float k_slidehopJumpSpeed = 500.0f;
31constexpr float k_doubleJumpCooldown = 0.10f;
32constexpr float k_doubleJumpHorizBoost = 400.0f;
36constexpr float k_doubleJumpGroundedRefreshTime = 0.5f;
40
41// Coyote time
42
43constexpr float k_coyoteTime = 0.15f;
44
45// Jump lurch
46
47constexpr int k_enableJumpLurch = 1;
48constexpr float k_jumpLurchMinGroundedTime = 0.3f;
51constexpr float k_jumpLurchGraceMin = 0.2f;
52constexpr float k_jumpLurchGraceMax = 0.5f;
53constexpr float k_jumpLurchStrength = 5.0f;
54constexpr float k_jumpLurchMax = 400.0f;
55constexpr float k_jumpLurchBaseVelocity = 100.0f;
56constexpr float k_jumpLurchSpeedLoss = 0.125f;
57
58// Sliding
59
60constexpr float k_slideMinStartSpeed = 400.0f;
61constexpr float k_slideMinSpeed = 200.0f;
62constexpr float k_slideBoostMin = 180.0f;
63constexpr float k_slideBoostMax = 380.0f;
64constexpr float k_slideBoostCooldown = 1.5f;
65constexpr float k_slideBrakingDecelMin = 200.0f;
66constexpr float k_slideBrakingDecelMax = 400.0f;
67constexpr float k_slideBrakingRampTime = 3.0f;
68constexpr float k_slideFloorInfluenceForce = 400.0f;
69constexpr float k_slideSteerAccel = 200.0f;
73constexpr int k_slideFatigueDecayTicks = 200;
74constexpr int k_slideFatigueMax = 4;
75
76// Wallrunning
77
78constexpr float k_wallrunCheckDist = 35.0f;
79constexpr float k_wallrunSphereRadius = 12.0f;
80constexpr float k_wallrunMinGroundDist = 50.0f;
81constexpr float k_wallrunMinAttachSpeed = 200.0f;
82constexpr float k_wallrunMinStaySpeed = 100.0f;
83constexpr float k_wallrunSameWallReattachSpeed = 100.0f;
84constexpr float k_wallrunMaxSpeed = 800.0f;
85constexpr float k_wallrunAccel = 500.0f;
86constexpr float k_wallrunPushForce = 800.0f;
87constexpr float k_wallrunKickoffDuration = 1.75f;
88constexpr float k_wallrunSpeedLossDelay = 0.2f;
89constexpr float k_wallrunIntentThreshold = 0.1f;
91constexpr float k_wallrunDetachThreshold = -0.26f;
95constexpr float k_wallrunGripTime = 1.0f;
98constexpr float k_wallrunGravityRampTime = 2.0f;
101constexpr float k_wallJumpUpForce = 640.0f;
102constexpr float k_wallJumpSideForce = 350.0f;
103constexpr float k_wallrunExitTime = 0.2f;
104constexpr float k_wallrunCameraTilt = 7.5f;
105constexpr float k_wallrunCameraTiltSpeed = 10.0f;
106constexpr float k_wallrunEntryVerticalImpulse = 440.0f;
107constexpr float k_wallrunEntryVerticalCeiling = 640.0f;
108constexpr float k_wallrunEntryHorizSnap = 1.0f;
109constexpr float k_wallrunVerticalDecayTau = 0.45f;
110constexpr float k_wallrunMaxFaceRedirect = 1.57079632679f;
111
112// Speed cap
113
114constexpr float k_speedCap = 7000.0f;
115
116// Player dimensions
117//
118// The player's full collision shape is a capsule. `k_standingHalfHeight`
119// and `k_crouchingHalfHeight` are the AABB half-heights — i.e. the
120// capsule's full top-to-foot half-extent (`halfHeight + radius`). The
121// capsule's segment half-length (the `halfHeight` field on the shape)
122// is therefore the AABB half-height *minus* the capsule radius.
123//
124// Standing: total height 72u (2*36), capsule radius 16u, capsule
125// halfHeight 20u (= 36-16).
126// Crouching: total height 44u (2*22), capsule radius 16u, capsule
127// halfHeight 6u (= 22-16). Crouch keeps the radius constant —
128// modern KCCs rely on a fixed capsule radius to keep horizontal
129// collision continuity stable across stance transitions.
130
131constexpr float k_playerCapsuleRadius = 16.0f;
132constexpr float k_standingHalfHeight = 36.0f;
133constexpr float k_crouchingHalfHeight = 22.0f;
134
137
140
141// Grappling hook (Widowmaker-style: direct pull → look-biased launch)
142
143constexpr float k_grappleMaxRange = 4000.0f;
144constexpr float k_grapplePullSpeed = 4000.0f;
145constexpr float k_grappleDetachDist = 80.0f;
146constexpr float k_grappleMaxDuration = 5.0f;
147constexpr float k_grappleCooldown = 5.0f;
148constexpr float k_grappleLaunchLookBias =
149 0.6f;
150constexpr float k_grappleLaunchSpeedMult = 1.15f;
151
152// Grapple perch (hold-jump → arc lands you above the hook point).
153//
154// The trajectory is stateless — computed each tick from current pos +
155// grapplePoint only. Avoids the position jitter that a per-tick `t`
156// accumulator (in PlayerSimState) would cause during reconciliation
157// replay, since PlayerSimState is server-only and drifts on each apply.
158
159constexpr float k_grapplePerchFeetOffset = 50.0f;
162constexpr float k_grapplePerchVerticalGain = 8.0f;
164constexpr float k_grapplePerchRiseRange = 100.0f;
166constexpr float k_grapplePerchMinHorizFactor = 0.25f;
168
169} // namespace tms
Titanfall-inspired movement constants, adapted to Quake units.
Definition TitanfallConstants.hpp:14
constexpr float k_slideBoostMin
Min speed boost on slide entry (u/s).
Definition TitanfallConstants.hpp:62
constexpr float k_grapplePerchVerticalGain
Vertical-pull P-controller gain (1/s).
Definition TitanfallConstants.hpp:162
constexpr float k_grapplePerchRiseRange
Altitude diff (u) below target at which horizontal speed bottoms out — controls how steep the rise ph...
Definition TitanfallConstants.hpp:164
constexpr float k_coyoteTime
Grace period after leaving ground/wall to still jump (s).
Definition TitanfallConstants.hpp:43
constexpr float k_wallrunEntryHorizSnap
Horizontal speed retention on wallrun entry.
Definition TitanfallConstants.hpp:108
constexpr float k_wallrunDetachThreshold
Min dot(wishDir, -wallNormal) to STAY on the wall.
Definition TitanfallConstants.hpp:91
constexpr float k_jumpLurchStrength
Multiplier for lurch intensity.
Definition TitanfallConstants.hpp:53
constexpr float k_grappleMaxDuration
Safety timeout (s).
Definition TitanfallConstants.hpp:146
constexpr float k_jumpLurchBaseVelocity
Base lurch velocity before scaling (u/s).
Definition TitanfallConstants.hpp:55
constexpr float k_standingCapsuleHalfHeight
Capsule segment half-length when standing.
Definition TitanfallConstants.hpp:136
constexpr float k_slideFloorInfluenceForce
How much slope angle affects slide speed (u/s^2).
Definition TitanfallConstants.hpp:68
constexpr float k_wallrunCameraTilt
Camera roll when wallrunning (degrees).
Definition TitanfallConstants.hpp:104
constexpr float k_slideBoostMax
Max speed boost on slide entry (u/s).
Definition TitanfallConstants.hpp:63
constexpr float k_wallrunMinAttachSpeed
Min horizontal speed required to enter wallrun (u/s).
Definition TitanfallConstants.hpp:81
constexpr float k_wallrunMaxFaceRedirect
Max face-normal rotation accepted per tick (rad).
Definition TitanfallConstants.hpp:110
constexpr float k_doubleJumpGroundedRefreshTime
Continuous time grounded (s) needed to refresh DJ.
Definition TitanfallConstants.hpp:36
constexpr float k_slideBoostCooldown
Cooldown between slide boosts (s).
Definition TitanfallConstants.hpp:64
constexpr float k_crouchingHalfHeight
Crouching/sliding AABB half-height (u).
Definition TitanfallConstants.hpp:133
constexpr float k_slideMinSpeed
Slide cancels below this speed (u/s).
Definition TitanfallConstants.hpp:61
constexpr float k_wallrunKickoffDuration
Max time on same wall before kickoff (s).
Definition TitanfallConstants.hpp:87
constexpr float k_grapplePerchFeetOffset
Feet height above the hook point in perch mode (u).
Definition TitanfallConstants.hpp:159
constexpr float k_wallrunSphereRadius
Sphere-cast radius for wall detection (u).
Definition TitanfallConstants.hpp:79
constexpr float k_grappleLaunchLookBias
Look-direction weight on detach launch (0 = pure grapple dir, 1 = pure look).
Definition TitanfallConstants.hpp:148
constexpr float k_slideMinStartSpeed
Min horizontal speed to enter slide (u/s).
Definition TitanfallConstants.hpp:60
constexpr float k_wallJumpUpForce
Upward velocity on wall jump (u/s).
Definition TitanfallConstants.hpp:101
constexpr float k_wallrunAccel
Forward acceleration along wall (u/s^2).
Definition TitanfallConstants.hpp:85
constexpr float k_grappleDetachDist
Auto-detach when this close to anchor (~2 m).
Definition TitanfallConstants.hpp:145
constexpr float k_adsSpeed
Max wish speed while ADS-ing a precision (charge) weapon (u/s).
Definition TitanfallConstants.hpp:22
constexpr float k_slideBrakingDecelMax
Maximum braking deceleration (u/s^2).
Definition TitanfallConstants.hpp:66
constexpr float k_doubleJumpHorizBoost
Horizontal velocity (u/s) toward WASD wishDir on double jump.
Definition TitanfallConstants.hpp:32
constexpr float k_wallrunEntryVerticalCeiling
Maximum vertical speed after the entry kick (u/s).
Definition TitanfallConstants.hpp:107
constexpr float k_wallJumpSideForce
Sideways velocity on wall jump (away from wall) (u/s).
Definition TitanfallConstants.hpp:102
constexpr int k_enableJumpLurch
Master enable for jump lurch (1 = enabled, 0 = disabled).
Definition TitanfallConstants.hpp:47
constexpr float k_wallrunMinGroundDist
Min height above ground to wallrun (u).
Definition TitanfallConstants.hpp:80
constexpr float k_jumpLurchMinGroundedTime
Min continuous grounded time before a ground jump re-arms lurch (s).
Definition TitanfallConstants.hpp:48
constexpr float k_jumpLurchGraceMax
Time after jump where lurch is disabled entirely (s).
Definition TitanfallConstants.hpp:52
constexpr float k_grappleCooldown
Cooldown between grapples (s).
Definition TitanfallConstants.hpp:147
constexpr int k_slideFatigueDecayTicks
Ticks (at 128Hz = 3s) to reset one fatigue level.
Definition TitanfallConstants.hpp:73
constexpr float k_slideBrakingRampTime
Time to ramp from min to max braking (s).
Definition TitanfallConstants.hpp:67
constexpr float k_jumpLurchSpeedLoss
Fraction of speed lost on lurch (12.5%).
Definition TitanfallConstants.hpp:56
constexpr float k_crouchingCapsuleHalfHeight
Capsule segment half-length when crouching.
Definition TitanfallConstants.hpp:139
constexpr float k_playerCapsuleRadius
Capsule cross-section radius (u), fixed across stances.
Definition TitanfallConstants.hpp:131
constexpr float k_wallrunCheckDist
Sphere-cast distance for side walls (u).
Definition TitanfallConstants.hpp:78
constexpr float k_crouchSpeed
Max wish speed when crouching (u/s).
Definition TitanfallConstants.hpp:21
constexpr float k_wallrunSpeedLossDelay
Delay before clamping speed on wall (s).
Definition TitanfallConstants.hpp:88
constexpr float k_wallrunVerticalDecayTau
Exponential vertical decay while attached (s).
Definition TitanfallConstants.hpp:109
constexpr float k_grappleMaxRange
Max hook distance (~20 m in Quake units).
Definition TitanfallConstants.hpp:143
constexpr float k_slidehopJumpSpeed
Upward velocity when jumping during slide (u/s).
Definition TitanfallConstants.hpp:30
constexpr float k_speedCap
Hard horizontal speed limit (u/s).
Definition TitanfallConstants.hpp:114
constexpr float k_wallrunExitTime
Duration of "exiting wall" flag after leaving (s).
Definition TitanfallConstants.hpp:103
constexpr float k_wallrunCameraTiltSpeed
Interpolation speed for camera tilt.
Definition TitanfallConstants.hpp:105
constexpr float k_doubleJumpCooldown
Min time after first jump before double jump is allowed (s).
Definition TitanfallConstants.hpp:31
constexpr float k_grappleLaunchSpeedMult
Speed multiplier on launch (slight boost for momentum).
Definition TitanfallConstants.hpp:150
constexpr float k_walkSpeed
Max wish speed when walking (u/s). Sprint removed; this is the only base speed.
Definition TitanfallConstants.hpp:18
constexpr float k_wallrunGravityRampTime
Time to ramp gravity 0 → full after grip ends (s).
Definition TitanfallConstants.hpp:98
constexpr float k_wallrunSameWallReattachSpeed
Min inward speed to reattach a blacklisted wall (u/s).
Definition TitanfallConstants.hpp:83
constexpr float k_jumpLurchMax
Maximum lurch velocity magnitude (u/s).
Definition TitanfallConstants.hpp:54
constexpr float k_slideSteerAccel
Sideways accel from WASD while sliding (u/s^2).
Definition TitanfallConstants.hpp:69
constexpr float k_doubleJumpSpeed
Upward velocity on air jump (u/s).
Definition TitanfallConstants.hpp:29
constexpr float k_wallrunEntryVerticalImpulse
Lucio-style upward kick when attaching (u/s).
Definition TitanfallConstants.hpp:106
constexpr float k_wallrunMaxSpeed
Max speed while wallrunning (u/s).
Definition TitanfallConstants.hpp:84
constexpr int k_slideFatigueMax
Max fatigue levels (boost fully killed at this).
Definition TitanfallConstants.hpp:74
constexpr float k_jumpLurchGraceMin
Time after jump where lurch is at max strength (s).
Definition TitanfallConstants.hpp:51
constexpr float k_sprintSpeed
Deprecated: sprint removed. Kept equal to k_walkSpeed for safety.
Definition TitanfallConstants.hpp:20
constexpr float k_wallrunIntentThreshold
Min dot(wishDir, -wallNormal) to ENTER a wallrun.
Definition TitanfallConstants.hpp:89
constexpr float k_grapplePullSpeed
Direct velocity toward anchor (u/s). Overrides, not additive.
Definition TitanfallConstants.hpp:144
constexpr float k_jumpSpeed
Upward velocity on ground jump (u/s). Must mirror physics::k_jumpSpeed.
Definition TitanfallConstants.hpp:28
constexpr float k_slideBrakingDecelMin
Initial braking deceleration (u/s^2).
Definition TitanfallConstants.hpp:65
constexpr float k_wallrunGripTime
Initial zero-gravity "grip" phase on a wall (s).
Definition TitanfallConstants.hpp:95
constexpr float k_wallrunPushForce
Force pushing player toward wall (u/s^2).
Definition TitanfallConstants.hpp:86
constexpr float k_standingHalfHeight
Standing AABB half-height (u).
Definition TitanfallConstants.hpp:132
constexpr float k_wallrunMinStaySpeed
Drop wallrun below this horizontal speed (u/s).
Definition TitanfallConstants.hpp:82
constexpr float k_grapplePerchMinHorizFactor
Floor on horizontal-speed throttle while below target.
Definition TitanfallConstants.hpp:166