mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'yet-fewer-bot-maintenance' into 'master'
Yet fewer bot maintenance Closes #966, #899, #875, and #818 See merge request KartKrew/Kart!2102
This commit is contained in:
commit
d0d948e451
3 changed files with 21 additions and 7 deletions
|
|
@ -654,6 +654,18 @@ fixed_t K_BotRubberband(const player_t *player)
|
||||||
|
|
||||||
rubberband = FixedDiv(distdiff + spacing, spacing * 2);
|
rubberband = FixedDiv(distdiff + spacing, spacing * 2);
|
||||||
|
|
||||||
|
if (player->boostpower < FRACUNIT)
|
||||||
|
{
|
||||||
|
// Do not let bots cheese offroad as much.
|
||||||
|
rubberband = FixedMul(rubberband, player->boostpower);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (P_MobjWasRemoved(player->mo) == false && player->mo->movefactor < FRACUNIT)
|
||||||
|
{
|
||||||
|
// Do not let bots speed up on ice too much.
|
||||||
|
rubberband = FixedMul(rubberband, player->mo->movefactor);
|
||||||
|
}
|
||||||
|
|
||||||
if (rubberband > FRACUNIT)
|
if (rubberband > FRACUNIT)
|
||||||
{
|
{
|
||||||
rubberband = FRACUNIT;
|
rubberband = FRACUNIT;
|
||||||
|
|
@ -1657,7 +1669,7 @@ static void K_BuildBotTiccmdNormal(const player_t *player, ticcmd_t *cmd)
|
||||||
|
|
||||||
if (P_IsObjectOnGround(player->mo) == false)
|
if (P_IsObjectOnGround(player->mo) == false)
|
||||||
{
|
{
|
||||||
if (player->fastfall == 0)
|
if (player->fastfall == 0 && player->respawn.state == RESPAWNST_NONE)
|
||||||
{
|
{
|
||||||
if (botController != nullptr && (botController->flags & TMBOT_FASTFALL) == TMBOT_FASTFALL)
|
if (botController != nullptr && (botController->flags & TMBOT_FASTFALL) == TMBOT_FASTFALL)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1448,7 +1448,7 @@ static void K_BotItemRings(const player_t *player, ticcmd_t *cmd)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->speed < K_GetKartSpeed(player, false, true) / 2 // Being slowed down too much
|
if (player->speed < (K_GetKartSpeed(player, false, true) * 9) / 10 // Being slowed down too much
|
||||||
|| player->speedboost > (FRACUNIT/5)) // Have another type of boost (tethering)
|
|| player->speedboost > (FRACUNIT/5)) // Have another type of boost (tethering)
|
||||||
{
|
{
|
||||||
saferingsval -= 5;
|
saferingsval -= 5;
|
||||||
|
|
|
||||||
12
src/k_kart.c
12
src/k_kart.c
|
|
@ -11758,17 +11758,19 @@ fixed_t K_PlayerBaseFriction(const player_t *player, fixed_t original)
|
||||||
}
|
}
|
||||||
else if (K_PlayerUsesBotMovement(player) == true)
|
else if (K_PlayerUsesBotMovement(player) == true)
|
||||||
{
|
{
|
||||||
|
const fixed_t speedPercent = min(FRACUNIT, FixedDiv(player->speed, K_GetKartSpeed(player, false, false)));
|
||||||
|
const fixed_t extraFriction = FixedMul(FixedMul(FRACUNIT >> 5, factor), speedPercent);
|
||||||
|
|
||||||
// A bit extra friction to help them without drifting.
|
// A bit extra friction to help them without drifting.
|
||||||
// Remove this line once they can drift.
|
// Remove this line once they can drift.
|
||||||
frict -= FixedMul(FRACUNIT >> 5, factor);
|
frict -= extraFriction;
|
||||||
|
|
||||||
// Bots gain more traction as they rubberband.
|
// Bots gain more traction as they rubberband.
|
||||||
fixed_t traction_value = FixedMul(player->botvars.rubberband, max(FRACUNIT, K_BotMapModifier()));
|
const fixed_t traction_value = FixedMul(player->botvars.rubberband, max(FRACUNIT, K_BotMapModifier()));
|
||||||
if (traction_value > FRACUNIT)
|
if (traction_value > FRACUNIT)
|
||||||
{
|
{
|
||||||
const fixed_t extraFriction = FixedMul(FRACUNIT >> 5, factor);
|
const fixed_t traction_mul = traction_value - FRACUNIT;
|
||||||
const fixed_t mul = traction_value - FRACUNIT;
|
frict -= FixedMul(extraFriction, traction_mul);
|
||||||
frict -= FixedMul(extraFriction, mul);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue