From 71e5654b645c07da60b7acbfbe60fe71021f9c45 Mon Sep 17 00:00:00 2001 From: Zyf Date: Fri, 24 Nov 2023 23:07:27 +0100 Subject: [PATCH] Account for legacyAccScore in score conversion --- .../Difficulty/CatchLegacyScoreSimulator.cs | 1 + .../Difficulty/TaikoLegacyScoreSimulator.cs | 1 + .../Database/StandardisedScoreMigrationTools.cs | 14 +++++++------- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs index 746f5713e4..ed27e11208 100644 --- a/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Catch/Difficulty/CatchLegacyScoreSimulator.cs @@ -74,6 +74,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty simulateHit(obj, ref attributes); attributes.BonusScoreRatio = legacyBonusScore == 0 ? 0 : (double)standardisedBonusScore / legacyBonusScore; + attributes.BonusScore = legacyBonusScore; return attributes; } diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs index 6a3eb68a22..1db44592b8 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs @@ -75,6 +75,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty simulateHit(obj, ref attributes); attributes.BonusScoreRatio = legacyBonusScore == 0 ? 0 : (double)standardisedBonusScore / legacyBonusScore; + attributes.BonusScore = legacyBonusScore; return attributes; } diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 457262a1de..6484500bcc 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -250,15 +250,14 @@ namespace osu.Game.Database long maximumLegacyComboScore = (long)Math.Round(attributes.ComboScore * legacyModMultiplier); double maximumLegacyBonusRatio = attributes.BonusScoreRatio; long maximumLegacyBonusScore = attributes.BonusScore; - int maximumLegacyCombo = attributes.MaxCombo; + double legacyAccScore = maximumLegacyAccuracyScore * score.Accuracy; + // We can not separate the ComboScore from the BonusScore, so we keep the bonus in the ratio. + double comboProportion = + ((double)score.LegacyTotalScore - legacyAccScore) / (maximumLegacyComboScore + maximumLegacyBonusScore); + + // We assume the bonus proportion only makes up the rest of the score that exceeds maximumLegacyBaseScore. long maximumLegacyBaseScore = maximumLegacyAccuracyScore + maximumLegacyComboScore; - long maximumLegacyTotalScore = maximumLegacyBaseScore + maximumLegacyBonusScore; - - // The combo proportion is calculated as a proportion of maximumLegacyTotalScore. - double comboProportion = (double)score.LegacyTotalScore / maximumLegacyTotalScore; - - // The bonus proportion makes up the rest of the score that exceeds maximumLegacyBaseScore. double bonusProportion = Math.Max(0, ((long)score.LegacyTotalScore - maximumLegacyBaseScore) * maximumLegacyBonusRatio); double modMultiplier = score.Mods.Select(m => m.ScoreMultiplier).Aggregate(1.0, (c, n) => c * n); @@ -288,6 +287,7 @@ namespace osu.Game.Database // this can be roughly represented by summing / integrating f(combo) = combo. // All mod- and beatmap-dependent multipliers and constants are not included here, // as we will only be using the magnitude of this to compute ratios. + int maximumLegacyCombo = attributes.MaxCombo; double maximumAchievableComboPortionInScoreV1 = Math.Pow(maximumLegacyCombo, 2); // Similarly, estimate the maximum magnitude of the combo portion in standardised score. // Roughly corresponds to integrating f(combo) = combo ^ COMBO_EXPONENT (omitting constants)