Skip to content

Commit

Permalink
Merge pull request #25945 from smoogipoo/mania-scorev2-values
Browse files Browse the repository at this point in the history
Adjust mania scoring to be more in line with ScoreV2 + 85% acc / 15% combo
  • Loading branch information
peppy authored Dec 20, 2023
2 parents c5fb4d0 + 9515f7d commit c23dd1f
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -25,8 +26,8 @@ public partial class TestSceneManiaModDoubleTime : ModTestScene
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
{
Expand All @@ -53,7 +54,7 @@ public void TestHitWindowWithDoubleTime()
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
{
Expand Down
8 changes: 3 additions & 5 deletions osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,10 @@ public void TestPressAtStartThenReleaseAndImmediatelyRepress()
});

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);
// judgement combo offset by perfect bonus judgement. see logic in DrawableNote.CheckForResult.
assertComboAtJudgement(4, 1);
assertComboAtJudgement(1, 0);
assertComboAtJudgement(3, 1);
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Mania.Tests/TestSceneMaximumScore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void TestSimultaneousTickAndNote()
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]
Expand Down Expand Up @@ -87,7 +87,7 @@ public void TestSimultaneousLongNotes()
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<ManiaHitObject> hitObjects, List<ReplayFrame> frames)
Expand Down
40 changes: 0 additions & 40 deletions osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
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;
Expand All @@ -40,8 +38,6 @@ public partial class DrawableNote : DrawableManiaHitObject<Note>, IKeyBindingHan

private Drawable headPiece;

private DrawableNotePerfectBonus perfectBonus;

public DrawableNote()
: this(null)
{
Expand Down Expand Up @@ -93,10 +89,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
if (!userTriggered)
{
if (!HitObject.HitWindows.CanBeHit(timeOffset))
{
perfectBonus.TriggerResult(false);
ApplyResult(r => r.Type = r.Judgement.MinResult);
}

return;
}
Expand All @@ -107,16 +100,9 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)

result = GetCappedResult(result);

perfectBonus.TriggerResult(result == HitResult.Perfect);
ApplyResult(r => r.Type = result);
}

public override void MissForcefully()
{
perfectBonus.TriggerResult(false);
base.MissForcefully();
}

/// <summary>
/// Some objects in mania may want to limit the max result.
/// </summary>
Expand All @@ -137,32 +123,6 @@ public virtual void OnReleased(KeyBindingReleaseEvent<ManiaAction> e)
{
}

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;
Expand Down

This file was deleted.

8 changes: 0 additions & 8 deletions osu.Game.Rulesets.Mania/Objects/Note.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. 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;

Expand All @@ -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 });
}
}
}
20 changes: 0 additions & 20 deletions osu.Game.Rulesets.Mania/Objects/NotePerfectBonus.cs

This file was deleted.

43 changes: 40 additions & 3 deletions osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,50 @@ protected override IEnumerable<HitObject> EnumerateHitObjects(IBeatmap beatmap)

protected override double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion)
{
return 10000 * comboProgress
+ 990000 * Math.Pow(Accuracy.Value, 2 + 2 * Accuracy.Value) * accuracyProgress
return 150000 * comboProgress
+ 850000 * 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<HitObject>
{
Expand Down
1 change: 0 additions & 1 deletion osu.Game.Rulesets.Mania/UI/Column.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ private void load(GameHost host)
TopLevelContainer.Add(HitObjectArea.Explosions.CreateProxy());

RegisterPool<Note, DrawableNote>(10, 50);
RegisterPool<NotePerfectBonus, DrawableNotePerfectBonus>(10, 50);
RegisterPool<HoldNote, DrawableHoldNote>(10, 50);
RegisterPool<HeadNote, DrawableHoldNoteHead>(10, 50);
RegisterPool<TailNote, DrawableHoldNoteTail>(10, 50);
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Database/StandardisedScoreMigrationTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ double lowerEstimateOfComboPortionInStandardisedScore

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:
Expand Down
3 changes: 2 additions & 1 deletion osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ public class LegacyScoreEncoder
/// <item><description>30000004: Fixed mod multipliers during legacy score conversion. Reconvert all scores.</description></item>
/// <item><description>30000005: Introduce combo exponent in the osu! gamemode. Reconvert all scores.</description></item>
/// <item><description>30000006: Fix edge cases in conversion after combo exponent introduction that lead to NaNs. Reconvert all scores.</description></item>
/// <item><description>30000007: Adjust osu!mania combo and accuracy portions and judgement scoring values. Reconvert all scores.</description></item>
/// </list>
/// </remarks>
public const int LATEST_VERSION = 30000006;
public const int LATEST_VERSION = 30000007;

/// <summary>
/// The first stable-compatible YYYYMMDD format version given to lazer usage of replays.
Expand Down

0 comments on commit c23dd1f

Please sign in to comment.