From c5c413e2fe6a6f8f6f48f7885a162099d21596f6 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Mon, 16 Jun 2025 18:19:45 -0400 Subject: [PATCH] Bot WTF --- src/k_bot.cpp | 3 +++ src/k_kart.c | 9 ++++++++- src/p_user.c | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/k_bot.cpp b/src/k_bot.cpp index c775efbfb..44ea1b448 100644 --- a/src/k_bot.cpp +++ b/src/k_bot.cpp @@ -580,6 +580,9 @@ const botcontroller_t *K_GetBotController(const mobj_t *mobj) --------------------------------------------------*/ fixed_t K_BotMapModifier(void) { + // fuck it we ball + return 60*FRACUNIT/100; + constexpr INT32 complexity_scale = 10000; fixed_t modifier_max = (9 * FRACUNIT / 10) - FRACUNIT; fixed_t modifier_min = (5 * FRACUNIT / 10) - FRACUNIT; diff --git a/src/k_kart.c b/src/k_kart.c index d516f8c07..606677c1f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -13257,10 +13257,17 @@ fixed_t K_PlayerBaseFriction(const player_t *player, fixed_t original) } errorfrict = min(errorfrict, frict/4); + + if (player->mo && !P_MobjWasRemoved(player->mo) && player->mo->movefactor < FRACUNIT) + { + // Reduce error friction on low-friction surfaces + errorfrict = FixedMul(errorfrict, player->mo->movefactor); + } + frict -= errorfrict; // Bots gain more traction as they rubberband. - const fixed_t traction_value = FixedMul(player->botvars.rubberband, max(FRACUNIT, K_BotMapModifier())); + const fixed_t traction_value = FixedMul(player->botvars.rubberband, K_BotMapModifier()); if (traction_value > FRACUNIT) { const fixed_t traction_mul = traction_value - FRACUNIT; diff --git a/src/p_user.c b/src/p_user.c index 5859aa916..cea834a94 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2326,6 +2326,11 @@ static void P_UpdatePlayerAngle(player_t *player) // But the "angle" field of this ticcmd stores your prediction error, // which we use to apply friction. Transfer it! player->botvars.predictionError = player->cmd.angle << TICCMD_REDUCE; + if (player->botvars.predictionError >= ANGLE_45) + { + // Also slow bots down if they're about to do a weird 90. + player->botvars.bumpslow = TICRATE/2; + } } else if ((!(player->cmd.flags & TICCMD_RECEIVED)) && (!!(player->oldcmd.flags && TICCMD_RECEIVED))) {