@@ -120,8 +120,52 @@ COMPILE_TIME_ASSERT(NEO_RECON_CROUCH_SPEED > NEO_ASSAULT_CROUCH_SPEED);
120120COMPILE_TIME_ASSERT (NEO_ASSAULT_CROUCH_SPEED == NEO_SUPPORT_CROUCH_SPEED);
121121COMPILE_TIME_ASSERT (NEO_ASSAULT_CROUCH_SPEED == NEO_VIP_CROUCH_SPEED);
122122
123+ // NEO Jank: As an optimization, these constants are calculated for default gravity,
124+ // and bot climbing behavior may be odd if sv_gravity is changed.
125+ // See [MD]'s g_bMovementOptimizations for additional context.
126+ //
127+ // At time of comment, these constants were only used by neo_bot_locomotion.h
128+ // where these values determine if a bot will attempt to climb a ledge between NavAreas.
129+ // At time of analysis, NEO_RECON_CROUCH_JUMP_HEIGHT potentially was historically calculated based on
130+ // (GAMEMOVEMENT_JUMP_HEIGHT * class multiplier) + (Support Hull Crouch/Stand Difference),
131+ //
132+ // From this point on we will refer to (GAMEMOVEMENT_JUMP_HEIGHT * class multiplier) as "Class Jump Height".
133+ // For sake of consistency, we will use the precomputed jump heights assuming g_bMovementOptimizations = true.
134+ //
135+ // Class Jump Height: Derived from `sqrt(2 * gravity * jump_height)` from `gamemovement.cpp`.
136+ // But for simplicity we use the optimized values provided under the g_bMovementOptimizations = true case:
137+ // - Recon: 54.0 units
138+ // - Juggernaut: 50.4 units
139+ // - Others: 36.0 units
140+ //
141+ // Hull Crouch/Stand Difference (aka: "Lift"):
142+ // ---
143+ // Derived from neo_gamerules.cpp: Vector viewDelta = ( hullSizeNormal - hullSizeCrouch );
144+ // Variables are defined in shareddefs.h as VEC_HULL_MAX_SCALED and VEC_DUCK_HULL_MAX_SCALED.
145+ // Instead of deriving these values by hand, a breakpoint can be placed in CGameMovement::CanUnduck()
146+ // while configuring the bot class with the bot_class command, to log the variable values.
147+ //
148+ // Lift = VEC_HULL_MAX_SCALED.z - VEC_DUCK_HULL_MAX_SCALED.z
149+ // ---
150+ // Recon: 64 - 46 = 18
151+ // Assault: 65 - 48 = 17
152+ // Support: 70 - 59 = 11
153+ // VIP: 65 - 48 = 17
154+ //
155+ // Juggernaught: 88 - 75 = 13
156+ // (Base Hull Max = 70) + (NEO_JUGGERNAUT_MAXHULL_OFFSET.z = 18) = 88
157+ // (Base Hull Duck Max = 59) + (NEO_JUGGERNAUT_DUCK_MAXHULL_OFFSET.z = 16) = 75
158+ //
159+ // Proposed bot crouch jump heights:
160+ // ---
161+ // Recon: 54 + 11 = 65
162+ // Assault/VIP = 36 + 11 = 47
163+ // Support = 36 + 11 = 47
164+ // Juggernaut = 50.4 + 11 = 61.4 (rounded for simplicity)
165+
123166#define NEO_RECON_CROUCH_JUMP_HEIGHT 65 .f
124- #define NEO_CROUCH_JUMP_HEIGHT 56 .f
167+ #define NEO_CROUCH_JUMP_HEIGHT 47 .f
168+ #define NEO_JUGGERNAUT_CROUCH_JUMP_HEIGHT 62 .f
125169
126170// END OF NEO MOVEMENT DEFINITIONS
127171// ////////////////////////////////////////////////////
0 commit comments