diff --git a/src/g_game.c b/src/g_game.c index 26a4249d1..cde802f76 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1759,7 +1759,7 @@ void G_Ticker(boolean run) { if (players[i].bot == true && grandprixinfo.gp == true && grandprixinfo.masterbots == false) { - const UINT8 bot_level_decrease = (grandprixinfo.gamespeed <= KARTSPEED_NORMAL) ? 3 : 2; + const UINT8 bot_level_decrease = (grandprixinfo.gamespeed == KARTSPEED_EASY) ? 3 : 2; if (players[i].botvars.difficulty <= bot_level_decrease) { diff --git a/src/k_grandprix.c b/src/k_grandprix.c index 994ec43bf..77841e3ae 100644 --- a/src/k_grandprix.c +++ b/src/k_grandprix.c @@ -604,11 +604,58 @@ void K_IncreaseBotDifficulty(player_t *bot) disruptDelta = abs(statusQuo - bot->position); increase = (beatenDelta + winnerDelta + disruptDelta - 2) / 3; - increase++; // At least +1 level up. + + INT8 rankNudge = 1; // Generally, we want bots to rank up at least once, but... + + // If humans are struggling, we want to back off, or even derank if it's dire. + // Average human ranks to determine general bot "rank inertia". + INT8 totalRank = 0; + INT8 humanPlayers = 0; + for (i = 0; i < MAXPLAYERS; i++) + { + player_t *human = NULL; + + if (playeringame[i] == false) + continue; + + human = &players[i]; + + if (human->spectator == true) + continue; + + if (human->bot == true) + continue; + + humanPlayers++; + + totalRank += human->tally.rank; + } + + INT8 averageRank = totalRank / humanPlayers; + + switch(averageRank) + { + case GRADE_E: + rankNudge = -2; + break; + case GRADE_D: + rankNudge = -1; + break; + case GRADE_C: + case GRADE_B: + rankNudge = 0; + break; + case GRADE_A: + rankNudge = 1; + } + + increase += rankNudge; + if (increase <= 0) { - // No increase... - return; + // TYRON: We want to allow SMALL bot rank downs if a player gets rolled but still squeaks by. + // (Think, like, dire E rank in 4th.) + // This is a deviation from SalCodeā„¢ and should be reexamined if bots get drowsy. } bot->botvars.diffincrease = increase;