1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:07:23 +08:00

Fix TestSceneScoring and incorrect combo calculations

This commit is contained in:
Dan Balasescu 2023-05-19 14:09:19 +09:00
parent 9a1d749020
commit 7cbf48ffcf
6 changed files with 18 additions and 10 deletions

View File

@ -60,7 +60,7 @@ namespace osu.Game.Rulesets.Catch.Scoring
if (result.Type.IsBonus())
return (0, Judgement.ToNumericResult(result.Type), 0);
return (Judgement.ToNumericResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAtJudgement, combo_base)), Math.Log(combo_cap, combo_base)), 0, 0);
return (Judgement.ToNumericResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base)), 0, 0);
}
protected override void Reset(bool storeResults)

View File

@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Mania.Scoring
if (result.Type.IsBonus())
return (0, Judgement.ToNumericResult(result.Type));
return (Judgement.ToNumericResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAtJudgement, combo_base)), Math.Log(400, combo_base)), 0);
return (Judgement.ToNumericResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)), 0);
}
}
}

View File

@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring
if (result.Type.IsBonus())
return (0, hitValue);
return (hitValue * Math.Min(Math.Max(0.5, Math.Log(result.ComboAtJudgement, combo_base)), Math.Log(400, combo_base)), 0);
return (hitValue * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(400, combo_base)), 0);
}
}
}

View File

@ -22,6 +22,7 @@ using osu.Game.Rulesets.Osu.Beatmaps;
using osu.Game.Rulesets.Osu.Judgements;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring.Legacy;
using osuTK;
using osuTK.Graphics;
using osuTK.Input;
@ -124,8 +125,8 @@ namespace osu.Game.Tests.Visual.Gameplay
graphs.Clear();
legend.Clear();
runForProcessor("lazer-standardised", Color4.YellowGreen, new ScoreProcessor(new OsuRuleset()) { Mode = { Value = ScoringMode.Standardised } });
runForProcessor("lazer-classic", Color4.MediumPurple, new ScoreProcessor(new OsuRuleset()) { Mode = { Value = ScoringMode.Classic } });
runForProcessor("lazer-standardised", Color4.YellowGreen, new ScoreProcessor(new OsuRuleset()), ScoringMode.Standardised);
runForProcessor("lazer-classic", Color4.MediumPurple, new ScoreProcessor(new OsuRuleset()), ScoringMode.Classic);
runScoreV1();
runScoreV2();
@ -218,7 +219,7 @@ namespace osu.Game.Tests.Visual.Gameplay
});
}
private void runForProcessor(string name, Color4 colour, ScoreProcessor processor)
private void runForProcessor(string name, Color4 colour, ScoreProcessor processor, ScoringMode mode)
{
int maxCombo = sliderMaxCombo.Current.Value;
@ -232,10 +233,10 @@ namespace osu.Game.Tests.Visual.Gameplay
() => processor.ApplyResult(new OsuJudgementResult(new HitCircle(), new OsuJudgement()) { Type = HitResult.Great }),
() => processor.ApplyResult(new OsuJudgementResult(new HitCircle(), new OsuJudgement()) { Type = HitResult.Ok }),
() => processor.ApplyResult(new OsuJudgementResult(new HitCircle(), new OsuJudgement()) { Type = HitResult.Miss }),
() => (int)processor.TotalScore.Value);
() => processor.GetDisplayScore(mode));
}
private void runForAlgorithm(string name, Color4 colour, Action applyHit, Action applyNonPerfect, Action applyMiss, Func<int> getTotalScore)
private void runForAlgorithm(string name, Color4 colour, Action applyHit, Action applyNonPerfect, Action applyMiss, Func<long> getTotalScore)
{
int maxCombo = sliderMaxCombo.Current.Value;

View File

@ -64,6 +64,11 @@ namespace osu.Game.Rulesets.Judgements
/// </summary>
public int ComboAtJudgement { get; internal set; }
/// <summary>
/// The combo after this <see cref="JudgementResult"/> occurred.
/// </summary>
public int ComboAfterJudgement { get; internal set; }
/// <summary>
/// The highest combo achieved prior to this <see cref="JudgementResult"/> occurring.
/// </summary>

View File

@ -204,6 +204,8 @@ namespace osu.Game.Rulesets.Scoring
else if (result.Type.BreaksCombo())
Combo.Value = 0;
result.ComboAfterJudgement = Combo.Value;
if (result.Type.IsBasic())
CurrentBasicJudgements++;
@ -266,7 +268,7 @@ namespace osu.Game.Rulesets.Scoring
BonusPortion += Judgement.ToNumericResult(result.Type);
if (result.Type.AffectsCombo())
ComboPortion += Judgement.ToNumericResult(result.Type) * (1 + result.ComboAtJudgement / 10d);
ComboPortion += Judgement.ToNumericResult(result.Type) * (1 + result.ComboAfterJudgement / 10d);
}
protected virtual void RemoveScoreChange(JudgementResult result)
@ -275,7 +277,7 @@ namespace osu.Game.Rulesets.Scoring
BonusPortion -= Judgement.ToNumericResult(result.Type);
if (result.Type.AffectsCombo())
ComboPortion -= Judgement.ToNumericResult(result.Type) * (1 + result.ComboAtJudgement / 10d);
ComboPortion -= Judgement.ToNumericResult(result.Type) * (1 + result.ComboAfterJudgement / 10d);
}
private void updateScore()