This commit is contained in:
Antonio Martinez 2025-06-16 18:19:45 -04:00
parent e2122fa351
commit c5c413e2fe
3 changed files with 16 additions and 1 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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)))
{