Increase bot difficulty range to 13

While I finally pushed to do this because of the epic Blue Sphere reference, I was kinda thinking about doing this for a while, because it gives more room for bots to level up during Hard GP.

I thought about just making the new level cap go up normally, but I decided on keeping the bots' passive buffs (like top speed & ring boosts) go up linearly, while rubberbanding range is kept the same.

I don't think I can properly explain it, but this basically means level 13s are a touch harder than old level 9s before, and new level 9s are touch easier than old level 9s. Basically think of it as more level range than actually making the bots harder.

The expanded range means that Hard GP can start off easier, but end harder. (And of course, Master is even more ridiculous c:)
This commit is contained in:
Sally Coolatta 2022-03-30 15:25:55 -04:00
parent cc76f4d052
commit b9f91cb7ec
5 changed files with 32 additions and 15 deletions

View file

@ -3413,7 +3413,7 @@ static void Got_AddBot(UINT8 **p, INT32 playernum)
{
INT16 newplayernum;
UINT8 skinnum = 0;
UINT8 difficulty = MAXBOTDIFFICULTY;
UINT8 difficulty = DIFFICULTBOT;
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
{

View file

@ -399,9 +399,13 @@ static CV_PossibleValue_t kartbot_cons_t[] = {
{7, "Lv.7"},
{8, "Lv.8"},
{9, "Lv.9"},
{10,"Lv.10"},
{11,"Lv.11"},
{12,"Lv.12"},
{13,"Lv.MAX"},
{0, NULL}
};
consvar_t cv_kartbot = CVAR_INIT ("kartbot", "0", CV_NETVAR|CV_CHEAT, kartbot_cons_t, NULL);
consvar_t cv_kartbot = CVAR_INIT ("kartbot", "0", CV_NETVAR, kartbot_cons_t, NULL);
consvar_t cv_karteliminatelast = CVAR_INIT ("karteliminatelast", "Yes", CV_NETVAR|CV_CHEAT|CV_CALL, CV_YesNo, KartEliminateLast_OnChange);

View file

@ -477,24 +477,34 @@ fixed_t K_BotRubberband(player_t *player)
if (wanteddist > player->distancetofinish)
{
// Whoa, you're too far ahead! Slow back down a little.
rubberband += (MAXBOTDIFFICULTY - player->botvars.difficulty) * (distdiff / 3);
rubberband += (DIFFICULTBOT - min(DIFFICULTBOT, player->botvars.difficulty)) * (distdiff / 3);
}
else
{
// Catch up to your position!
rubberband += (2*player->botvars.difficulty) * distdiff;
rubberband += player->botvars.difficulty * distdiff;
}
}
// Lv. 1: x1.0 max
// Lv. 5: x1.5 max
// Lv. 9: x2.0 max
#if 0
// Lv. 1: x1.0 max
// Lv. 5: x1.5 max
// Lv. 9: x2.0 max
// Lv. MAX: x2.5 max
max = FRACUNIT + ((FRACUNIT * (player->botvars.difficulty - 1)) / (DIFFICULTBOT - 1));
#else
// Lv. 1: x1.0 max
// Lv. 5: x1.333 max
// Lv. 9: x1.667 max
// Lv. MAX: x2.0 max
max = FRACUNIT + ((FRACUNIT * (player->botvars.difficulty - 1)) / (MAXBOTDIFFICULTY - 1));
#endif
// Lv. 1: x0.75 min
// Lv. 5: x0.875 min
// Lv. 9: x1.0 min
min = FRACUNIT - (((FRACUNIT/4) * (MAXBOTDIFFICULTY - player->botvars.difficulty)) / (MAXBOTDIFFICULTY - 1));
// Lv. 1: x0.75 min
// Lv. 5: x0.875 min
// Lv. 9: x1.0 min
// Lv. MAX: x1.0 min
min = FRACUNIT - (((FRACUNIT/4) * (DIFFICULTBOT - min(DIFFICULTBOT, player->botvars.difficulty))) / (DIFFICULTBOT - 1));
if (rubberband > max)
{
@ -851,7 +861,7 @@ static UINT8 K_TrySpindash(player_t *player)
{
INT32 boosthold = starttime - K_GetSpindashChargeTime(player);
boosthold -= (MAXBOTDIFFICULTY - player->botvars.difficulty) * difficultyModifier;
boosthold -= (DIFFICULTBOT - min(DIFFICULTBOT, player->botvars.difficulty)) * difficultyModifier;
if (leveltime >= (unsigned)boosthold)
{

View file

@ -18,7 +18,10 @@
#include "r_defs.h"
// Maximum value of botvars.difficulty
#define MAXBOTDIFFICULTY 9
#define MAXBOTDIFFICULTY 13
// Level of a "difficult" bot. The max bot level was increased, but this keeps all of the same calculations.
#define DIFFICULTBOT 9
// How many tics in a row do you need to turn in this direction before we'll let you turn.
// Made it as small as possible without making it look like the bots are twitching constantly.

View file

@ -2982,7 +2982,7 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
if (K_PlayerUsesBotMovement(player))
{
// Increase bot speed by 1-10% depending on difficulty
fixed_t add = (player->botvars.difficulty * (FRACUNIT/10)) / MAXBOTDIFFICULTY;
fixed_t add = (player->botvars.difficulty * (FRACUNIT/10)) / DIFFICULTBOT;
finalspeed = FixedMul(finalspeed, FRACUNIT + add);
if (player->botvars.rival == true)
@ -7849,7 +7849,7 @@ INT32 K_GetKartRingPower(player_t *player, boolean boosted)
if (boosted == true && K_PlayerUsesBotMovement(player))
{
// Double for Lv. 9
ringPower += (player->botvars.difficulty * ringPower) / MAXBOTDIFFICULTY;
ringPower += (player->botvars.difficulty * ringPower) / DIFFICULTBOT;
}
return ringPower;