Merge branch 'nerf-rank' into 'master'

Nerf per-level rank requirements

See merge request KartKrew/Kart!1648
This commit is contained in:
AJ Martinez 2023-11-20 06:47:33 +00:00
commit b8c18ce39f
2 changed files with 12 additions and 8 deletions

View file

@ -408,14 +408,14 @@ void gpRank_t::Update(void)
for (i = 0; i < numPlayers; i++) for (i = 0; i < numPlayers; i++)
{ {
if (playeringame[displayplayers[i]] == false if (playeringame[g_localplayers[i]] == false
|| players[displayplayers[i]].spectator == true || players[g_localplayers[i]].spectator == true
|| players[displayplayers[i]].bot == true) || players[g_localplayers[i]].bot == true)
{ {
continue; continue;
} }
const player_t *player = &players[displayplayers[i]]; // TODO: needs looked at for online GP const player_t *player = &players[g_localplayers[i]];
gpRank_level_perplayer_t *const dta = &lvl->perPlayer[i]; gpRank_level_perplayer_t *const dta = &lvl->perPlayer[i];
if (player->realtime < lvl->time) if (player->realtime < lvl->time)

View file

@ -197,7 +197,7 @@ INT32 level_tally_t::CalculateGrade(void)
} }
case TALLY_BONUS_SCORE: case TALLY_BONUS_SCORE:
{ {
bonusWeights[i] = 100; bonusWeights[i] = ((pointLimit != 0) ? 100 : 0);
break; break;
} }
case TALLY_BONUS_LAP: case TALLY_BONUS_LAP:
@ -215,7 +215,7 @@ INT32 level_tally_t::CalculateGrade(void)
} }
} }
const INT32 positionWeight = (position > 0 && numPlayers > 2) ? 100 : 0; const INT32 positionWeight = (position > 0 && numPlayers > 2) ? 50 : 0;
const INT32 total = positionWeight + bonusWeights[0] + bonusWeights[1]; const INT32 total = positionWeight + bonusWeights[0] + bonusWeights[1];
INT32 ours = 0; INT32 ours = 0;
@ -224,7 +224,7 @@ INT32 level_tally_t::CalculateGrade(void)
if (position > 0 && numPlayers > 2) if (position > 0 && numPlayers > 2)
{ {
const INT32 sc = (position - 1); const INT32 sc = (position - 1);
const INT32 loser = ((numPlayers + 1) / 2) - 1; // number of winner positions const INT32 loser = ((numPlayers + 1) / 2); // number of winner positions
ours += ((loser - sc) * positionWeight) / loser; ours += ((loser - sc) * positionWeight) / loser;
} }
@ -239,7 +239,11 @@ INT32 level_tally_t::CalculateGrade(void)
} }
case TALLY_BONUS_LAP: case TALLY_BONUS_LAP:
{ {
ours += (laps * bonusWeights[i]) / std::max(1, static_cast<int>(totalLaps)); // Use a special curve for this.
// The difference between 0 and 1 lap points is an important difference in skill,
// while the difference between 5 and 6 is not very notable.
const fixed_t frac = (laps * FRACUNIT) / std::max(1, static_cast<int>(totalLaps));
ours += Easing_OutSine(frac, 0, bonusWeights[i]);
break; break;
} }
case TALLY_BONUS_PRISON: case TALLY_BONUS_PRISON: