From 11a719ced64c892732247ca011c4629cd2cbbdeb Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 19 Nov 2023 02:57:57 -0500 Subject: [PATCH] Nerf per-level rank requirements - Use ease-out sine curve for lap points. This means that the difference between 0 and 1 lap points is more drastic for your score than the difference between 5 and 6. (If this isn't strong enough, then a different curve can be used.) - Final position is weighted less heavily. - You now get 0 points at the best losing position, instead of 0 points at the worst winning position. This means less negative points. - Fix Battle ranking being wildly skewed when point limit is disabled. --- src/k_tally.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/k_tally.cpp b/src/k_tally.cpp index 7a52a862b..392209186 100644 --- a/src/k_tally.cpp +++ b/src/k_tally.cpp @@ -197,7 +197,7 @@ INT32 level_tally_t::CalculateGrade(void) } case TALLY_BONUS_SCORE: { - bonusWeights[i] = 100; + bonusWeights[i] = ((pointLimit != 0) ? 100 : 0); break; } 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]; INT32 ours = 0; @@ -224,7 +224,7 @@ INT32 level_tally_t::CalculateGrade(void) if (position > 0 && numPlayers > 2) { 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; } @@ -239,7 +239,11 @@ INT32 level_tally_t::CalculateGrade(void) } case TALLY_BONUS_LAP: { - ours += (laps * bonusWeights[i]) / std::max(1, static_cast(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(totalLaps)); + ours += Easing_OutSine(frac, 0, bonusWeights[i]); break; } case TALLY_BONUS_PRISON: