From 77ee717952dafd0dab928807e9ca46ae07e1f3da Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Wed, 6 Aug 2025 16:38:54 -0400 Subject: [PATCH] WIP: End distance EXP scaling --- src/k_bot.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/k_bot.cpp b/src/k_bot.cpp index 251f0f3c8..d8da81725 100644 --- a/src/k_bot.cpp +++ b/src/k_bot.cpp @@ -819,7 +819,13 @@ fixed_t K_BotRubberband(const player_t *player) scaled_dist = FixedDiv(scaled_dist, mapobjectscale); } - constexpr UINT32 END_DIST = 2048 * 14; + UINT32 END_DIST = 2048 * 14; + + if (K_EffectiveGradingFactor(player) <= FRACUNIT) + { + END_DIST = Easing_Linear((K_EffectiveGradingFactor(player) - MINGRADINGFACTOR) * 2, END_DIST * 2, END_DIST); + } + if (scaled_dist < END_DIST) { // At the end of tracks, start slowing down. @@ -837,7 +843,7 @@ fixed_t K_BotRubberband(const player_t *player) fixed_t K_UpdateRubberband(player_t *player) { fixed_t dest = K_BotRubberband(player); - + fixed_t deflect = player->botvars.recentDeflection; if (deflect > BOTMAXDEFLECTION) deflect = BOTMAXDEFLECTION; @@ -2160,7 +2166,7 @@ void K_UpdateBotGameplayVars(player_t *player) UINT32 smo = BOTANGLESAMPLES - 1; player->botvars.recentDeflection = (smo * player->botvars.recentDeflection / BOTANGLESAMPLES) + (dangle / BOTANGLESAMPLES); - + player->botvars.lastAngle = mangle; const botcontroller_t *botController = K_GetBotController(player->mo);