From 104fbbde9460d42c10fe5d4d60db2dbfc4218421 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 20 Dec 2023 18:35:45 +0900 Subject: [PATCH 1/7] Change mania scoring to match ScoreV2 --- .../Objects/Drawables/DrawableNote.cs | 40 ----------------- .../Drawables/DrawableNotePerfectBonus.cs | 26 ----------- .../Scoring/ManiaScoreProcessor.cs | 43 +++++++++++++++++-- osu.Game.Rulesets.Mania/UI/Column.cs | 1 - 4 files changed, 40 insertions(+), 70 deletions(-) delete mode 100644 osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNotePerfectBonus.cs diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index c70dfcb761..680009bc4c 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -13,8 +13,6 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Rulesets.Mania.Configuration; using osu.Game.Rulesets.Mania.Skinning.Default; -using osu.Game.Rulesets.Objects; -using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI.Scrolling; using osu.Game.Screens.Edit; @@ -40,8 +38,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables private Drawable headPiece; - private DrawableNotePerfectBonus perfectBonus; - public DrawableNote() : this(null) { @@ -93,10 +89,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables if (!userTriggered) { if (!HitObject.HitWindows.CanBeHit(timeOffset)) - { - perfectBonus.TriggerResult(false); ApplyResult(r => r.Type = r.Judgement.MinResult); - } return; } @@ -107,16 +100,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables result = GetCappedResult(result); - perfectBonus.TriggerResult(result == HitResult.Perfect); ApplyResult(r => r.Type = result); } - public override void MissForcefully() - { - perfectBonus.TriggerResult(false); - base.MissForcefully(); - } - /// /// Some objects in mania may want to limit the max result. /// @@ -137,32 +123,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { } - protected override void AddNestedHitObject(DrawableHitObject hitObject) - { - switch (hitObject) - { - case DrawableNotePerfectBonus bonus: - AddInternal(perfectBonus = bonus); - break; - } - } - - protected override void ClearNestedHitObjects() - { - RemoveInternal(perfectBonus, false); - } - - protected override DrawableHitObject CreateNestedHitObject(HitObject hitObject) - { - switch (hitObject) - { - case NotePerfectBonus bonus: - return new DrawableNotePerfectBonus(bonus); - } - - return base.CreateNestedHitObject(hitObject); - } - private void updateSnapColour() { if (beatmap == null || HitObject == null) return; diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNotePerfectBonus.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNotePerfectBonus.cs deleted file mode 100644 index 70ddb60296..0000000000 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNotePerfectBonus.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -namespace osu.Game.Rulesets.Mania.Objects.Drawables -{ - public partial class DrawableNotePerfectBonus : DrawableManiaHitObject - { - public override bool DisplayResult => false; - - public DrawableNotePerfectBonus() - : this(null!) - { - } - - public DrawableNotePerfectBonus(NotePerfectBonus hitObject) - : base(hitObject) - { - } - - /// - /// Apply a judgement result. - /// - /// Whether this tick was reached. - internal void TriggerResult(bool hit) => ApplyResult(r => r.Type = hit ? r.Judgement.MaxResult : r.Judgement.MinResult); - } -} diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index e5f9b33c6b..31435ddaad 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -26,13 +26,50 @@ namespace osu.Game.Rulesets.Mania.Scoring protected override double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion) { - return 10000 * comboProgress - + 990000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyProgress + return 200000 * comboProgress + + 800000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyProgress + bonusPortion; } + protected override double GetNumericResultFor(JudgementResult result) + { + switch (result.Type) + { + case HitResult.Perfect: + return 305; + } + + return base.GetNumericResultFor(result); + } + + protected override double GetMaxNumericResultFor(JudgementResult result) + { + switch (result.Judgement.MaxResult) + { + case HitResult.Perfect: + return 305; + } + + return base.GetMaxNumericResultFor(result); + } + protected override double GetComboScoreChange(JudgementResult result) - => GetNumericResultFor(result) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)); + { + double numericResult; + + switch (result.Type) + { + case HitResult.Perfect: + numericResult = 300; + break; + + default: + numericResult = GetNumericResultFor(result); + break; + } + + return numericResult * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)); + } private class JudgementOrderComparer : IComparer { diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 9489281176..6cd55bb099 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -109,7 +109,6 @@ namespace osu.Game.Rulesets.Mania.UI TopLevelContainer.Add(HitObjectArea.Explosions.CreateProxy()); RegisterPool(10, 50); - RegisterPool(10, 50); RegisterPool(10, 50); RegisterPool(10, 50); RegisterPool(10, 50); From 023bbda7dbb381255e66c84ac209c6510662380f Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 20 Dec 2023 18:43:06 +0900 Subject: [PATCH 2/7] Change mania to 85% acc / 15% combo --- osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 31435ddaad..d5191c880a 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -26,8 +26,8 @@ namespace osu.Game.Rulesets.Mania.Scoring protected override double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion) { - return 200000 * comboProgress - + 800000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyProgress + return 150000 * comboProgress + + 850000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyProgress + bonusPortion; } From e0c27510f23b71df4d13b78d7b4800135a3d16ee Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 19:47:36 +0900 Subject: [PATCH 3/7] Remove remaining usage of `NotePerfectBonus` --- osu.Game.Rulesets.Mania/Objects/Note.cs | 8 -------- .../Objects/NotePerfectBonus.cs | 20 ------------------- 2 files changed, 28 deletions(-) delete mode 100644 osu.Game.Rulesets.Mania/Objects/NotePerfectBonus.cs diff --git a/osu.Game.Rulesets.Mania/Objects/Note.cs b/osu.Game.Rulesets.Mania/Objects/Note.cs index 5914132624..0035960c63 100644 --- a/osu.Game.Rulesets.Mania/Objects/Note.cs +++ b/osu.Game.Rulesets.Mania/Objects/Note.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.Threading; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mania.Judgements; @@ -13,12 +12,5 @@ namespace osu.Game.Rulesets.Mania.Objects public class Note : ManiaHitObject { public override Judgement CreateJudgement() => new ManiaJudgement(); - - protected override void CreateNestedHitObjects(CancellationToken cancellationToken) - { - base.CreateNestedHitObjects(cancellationToken); - - AddNested(new NotePerfectBonus { StartTime = StartTime }); - } } } diff --git a/osu.Game.Rulesets.Mania/Objects/NotePerfectBonus.cs b/osu.Game.Rulesets.Mania/Objects/NotePerfectBonus.cs deleted file mode 100644 index def4c01268..0000000000 --- a/osu.Game.Rulesets.Mania/Objects/NotePerfectBonus.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Mania.Judgements; -using osu.Game.Rulesets.Scoring; - -namespace osu.Game.Rulesets.Mania.Objects -{ - public class NotePerfectBonus : ManiaHitObject - { - public override Judgement CreateJudgement() => new NotePerfectBonusJudgement(); - protected override HitWindows CreateHitWindows() => HitWindows.Empty; - - public class NotePerfectBonusJudgement : ManiaJudgement - { - public override HitResult MaxResult => HitResult.SmallBonus; - } - } -} From d417b156b25b9541ae88d1acc1d93aa571abbaf0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2023 19:57:42 +0900 Subject: [PATCH 4/7] Update test expectations --- .../Mods/TestSceneManiaModDoubleTime.cs | 7 ++++--- osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs | 6 +++--- osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModDoubleTime.cs b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModDoubleTime.cs index c717f03f51..975e43ec08 100644 --- a/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModDoubleTime.cs +++ b/osu.Game.Rulesets.Mania.Tests/Mods/TestSceneManiaModDoubleTime.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using NUnit.Framework; +using osu.Framework.Utils; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Mods; using osu.Game.Rulesets.Mania.Objects; @@ -25,8 +26,8 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods public void TestHitWindowWithoutDoubleTime() => CreateModTest(new ModTestData { PassCondition = () => Player.ScoreProcessor.JudgedHits > 0 - && Player.ScoreProcessor.Accuracy.Value == 1 - && Player.ScoreProcessor.TotalScore.Value == 1_000_000, + && Precision.AlmostEquals(Player.ScoreProcessor.Accuracy.Value, 0.9836, 0.01) + && Player.ScoreProcessor.TotalScore.Value == 946_049, Autoplay = false, Beatmap = new Beatmap { @@ -53,7 +54,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods Mod = doubleTime, PassCondition = () => Player.ScoreProcessor.JudgedHits > 0 && Player.ScoreProcessor.Accuracy.Value == 1 - && Player.ScoreProcessor.TotalScore.Value == (long)(1_000_010 * doubleTime.ScoreMultiplier), + && Player.ScoreProcessor.TotalScore.Value == (long)(1_000_000 * doubleTime.ScoreMultiplier), Autoplay = false, Beatmap = new Beatmap { diff --git a/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs b/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs index 044ce37832..d752c443cc 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs @@ -201,11 +201,11 @@ namespace osu.Game.Rulesets.Mania.Tests assertHeadJudgement(HitResult.Perfect); // judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult. - assertComboAtJudgement(1, 1); + assertComboAtJudgement(0, 1); assertTailJudgement(HitResult.Meh); - assertComboAtJudgement(2, 0); + assertComboAtJudgement(1, 0); // judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult. - assertComboAtJudgement(4, 1); + assertComboAtJudgement(3, 1); } /// diff --git a/osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs b/osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs index edf866952b..ee6d999932 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs @@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Mania.Tests AddAssert("all objects perfectly judged", () => judgementResults.Select(result => result.Type), () => Is.EquivalentTo(judgementResults.Select(result => result.Judgement.MaxResult))); - AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_030)); + AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_000)); } [Test] @@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Mania.Tests AddAssert("all objects perfectly judged", () => judgementResults.Select(result => result.Type), () => Is.EquivalentTo(judgementResults.Select(result => result.Judgement.MaxResult))); - AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_040)); + AddAssert("score is correct", () => currentPlayer.ScoreProcessor.TotalScore.Value, () => Is.EqualTo(1_000_000)); } private void performTest(List hitObjects, List frames) From 38d6b7f45b7d07bfb0b9e5bdac1163dda0dcc25b Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 20 Dec 2023 20:03:13 +0900 Subject: [PATCH 5/7] Update total score conversion --- osu.Game/Database/StandardisedScoreMigrationTools.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Database/StandardisedScoreMigrationTools.cs b/osu.Game/Database/StandardisedScoreMigrationTools.cs index 6484500bcc..a9225050b7 100644 --- a/osu.Game/Database/StandardisedScoreMigrationTools.cs +++ b/osu.Game/Database/StandardisedScoreMigrationTools.cs @@ -367,8 +367,8 @@ namespace osu.Game.Database case 3: return (long)Math.Round(( - 990000 * comboProportion - + 10000 * Math.Pow(score.Accuracy, 2 + 2 * score.Accuracy) + 850000 * comboProportion + + 150000 * Math.Pow(score.Accuracy, 2 + 2 * score.Accuracy) + bonusProportion) * modMultiplier); default: From b0da24176e5e2026173f25abb8a9e094f7d118ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 20 Dec 2023 15:44:02 +0100 Subject: [PATCH 6/7] Remove outdated inline comments --- osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs b/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs index d752c443cc..5f299f419d 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs @@ -200,11 +200,9 @@ namespace osu.Game.Rulesets.Mania.Tests }); assertHeadJudgement(HitResult.Perfect); - // judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult. assertComboAtJudgement(0, 1); assertTailJudgement(HitResult.Meh); assertComboAtJudgement(1, 0); - // judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult. assertComboAtJudgement(3, 1); } From 9515f7dbfa778a22eef7414e2ec68ff732befa7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Wed, 20 Dec 2023 15:58:26 +0100 Subject: [PATCH 7/7] Bump score version in order to recompute legacy scores --- osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs index 5c51e68d9f..fa930d77d3 100644 --- a/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs +++ b/osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs @@ -33,9 +33,10 @@ namespace osu.Game.Scoring.Legacy /// 30000004: Fixed mod multipliers during legacy score conversion. Reconvert all scores. /// 30000005: Introduce combo exponent in the osu! gamemode. Reconvert all scores. /// 30000006: Fix edge cases in conversion after combo exponent introduction that lead to NaNs. Reconvert all scores. + /// 30000007: Adjust osu!mania combo and accuracy portions and judgement scoring values. Reconvert all scores. /// /// - public const int LATEST_VERSION = 30000006; + public const int LATEST_VERSION = 30000007; /// /// The first stable-compatible YYYYMMDD format version given to lazer usage of replays.