@@ -120,8 +120,56 @@ 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+ // Juggernaut: 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+ // Then apply a uniform spare height budget gap of 7 units to all classes.
160+ // Formula: (Class Jump Height) + (Lift) - (Spare Gap)
161+ //
162+ // Precalculated bot crouch jump heights for use in bot locomotion/navigation checks:
163+ // ---
164+ // Recon: 54 + 18 - 7 = 65
165+ // Assault/VIP: 36 + 17 - 7 = 46
166+ // Support: 36 + 11 - 7 = 40
167+ // Juggernaut: 50.4 + 13 - 7 = 56.4 (rounded down to 56)
168+
123169#define NEO_RECON_CROUCH_JUMP_HEIGHT 65 .f
124- #define NEO_CROUCH_JUMP_HEIGHT 56 .f
170+ #define NEO_ASSAULT_CROUCH_JUMP_HEIGHT 46 .f
171+ #define NEO_SUPPORT_CROUCH_JUMP_HEIGHT 40 .f
172+ #define NEO_JUGGERNAUT_CROUCH_JUMP_HEIGHT 56 .f
125173
126174// END OF NEO MOVEMENT DEFINITIONS
127175// ////////////////////////////////////////////////////
0 commit comments