1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Move combo exponent to shared constant

This commit is contained in:
Dean Herbert 2023-08-24 14:55:24 +09:00
parent 5dee43815c
commit 5ddb10281b
2 changed files with 14 additions and 8 deletions

View File

@ -270,14 +270,12 @@ namespace osu.Game.Database
switch (score.Ruleset.OnlineID) switch (score.Ruleset.OnlineID)
{ {
case 0: case 0:
if(score.MaxCombo == 0 || score.Accuracy == 0) if (score.MaxCombo == 0 || score.Accuracy == 0)
return (long)Math.Round(( return (long)Math.Round((
0 0
+ 300000 * Math.Pow(score.Accuracy, 8) + 300000 * Math.Pow(score.Accuracy, 8)
+ bonusProportion) * modMultiplier); + bonusProportion) * modMultiplier);
double v3exp = 0.5; // Scorev3 combo exponent
// Assumption : // Assumption :
// - sliders and slider-ticks are uniformly spread arround the beatmap // - sliders and slider-ticks are uniformly spread arround the beatmap
// thus we can ignore them without losing much precision (consider a map of hit-circles only !) // thus we can ignore them without losing much precision (consider a map of hit-circles only !)
@ -287,12 +285,12 @@ namespace osu.Game.Database
// This is the ComboScore of v1/v3 were we remove all (map-)constant multipliers and accuracy multipliers (including hit results), // This is the ComboScore of v1/v3 were we remove all (map-)constant multipliers and accuracy multipliers (including hit results),
// based on the previous assumptions. For Scorev1, this is basically the sum of squared combos (because without sliders: object_count == combo). // based on the previous assumptions. For Scorev1, this is basically the sum of squared combos (because without sliders: object_count == combo).
double maxStrippedV1 = Math.Pow(maximumLegacyCombo, 2); double maxStrippedV1 = Math.Pow(maximumLegacyCombo, 2);
double maxStrippedV3 = Math.Pow(maximumLegacyCombo, 1 + v3exp); double maxStrippedV3 = Math.Pow(maximumLegacyCombo, 1 + ScoreProcessor.COMBO_EXPONENT);
double strippedV1 = maxStrippedV1 * comboProportion / score.Accuracy; double strippedV1 = maxStrippedV1 * comboProportion / score.Accuracy;
double strippedV1FromMaxCombo = Math.Pow(score.MaxCombo, 2); double strippedV1FromMaxCombo = Math.Pow(score.MaxCombo, 2);
double strippedV3FromMaxCombo = Math.Pow(score.MaxCombo, 1 + v3exp); double strippedV3FromMaxCombo = Math.Pow(score.MaxCombo, 1 + ScoreProcessor.COMBO_EXPONENT);
// Compute approximate lower estimate scorev3 for that play // Compute approximate lower estimate scorev3 for that play
// That is, a play were we made biggest amount of big combos (Repeat MaxCombo + 1 remaining big combo) // That is, a play were we made biggest amount of big combos (Repeat MaxCombo + 1 remaining big combo)
@ -301,7 +299,7 @@ namespace osu.Game.Database
double strippedV1FromMaxComboRepeat = possibleMaxComboRepeat * strippedV1FromMaxCombo; double strippedV1FromMaxComboRepeat = possibleMaxComboRepeat * strippedV1FromMaxCombo;
double remainingStrippedV1 = strippedV1 - strippedV1FromMaxComboRepeat; double remainingStrippedV1 = strippedV1 - strippedV1FromMaxComboRepeat;
double remainingCombo = Math.Sqrt(remainingStrippedV1); double remainingCombo = Math.Sqrt(remainingStrippedV1);
double remainingStrippedV3 = Math.Pow(remainingCombo, 1 + v3exp); double remainingStrippedV3 = Math.Pow(remainingCombo, 1 + ScoreProcessor.COMBO_EXPONENT);
double newLowerStrippedV3 = (possibleMaxComboRepeat * strippedV3FromMaxCombo) + remainingStrippedV3; double newLowerStrippedV3 = (possibleMaxComboRepeat * strippedV3FromMaxCombo) + remainingStrippedV3;
@ -310,7 +308,7 @@ namespace osu.Game.Database
remainingStrippedV1 = strippedV1 - strippedV1FromMaxCombo; remainingStrippedV1 = strippedV1 - strippedV1FromMaxCombo;
double remainingComboObjects = maximumLegacyCombo - score.MaxCombo - score.Statistics[HitResult.Miss]; double remainingComboObjects = maximumLegacyCombo - score.MaxCombo - score.Statistics[HitResult.Miss];
double remainingAverageCombo = remainingComboObjects > 0 ? remainingStrippedV1 / remainingComboObjects : 0; double remainingAverageCombo = remainingComboObjects > 0 ? remainingStrippedV1 / remainingComboObjects : 0;
remainingStrippedV3 = remainingComboObjects * Math.Pow(remainingAverageCombo, v3exp); remainingStrippedV3 = remainingComboObjects * Math.Pow(remainingAverageCombo, ScoreProcessor.COMBO_EXPONENT);
double newUpperStrippedV3 = strippedV3FromMaxCombo + remainingStrippedV3; double newUpperStrippedV3 = strippedV3FromMaxCombo + remainingStrippedV3;

View File

@ -21,6 +21,14 @@ namespace osu.Game.Rulesets.Scoring
{ {
public partial class ScoreProcessor : JudgementProcessor public partial class ScoreProcessor : JudgementProcessor
{ {
/// <summary>
/// The exponent applied to combo in the default implementation of <see cref="GetComboScoreChange"/>.
/// </summary>
/// <remarks>
/// If a custom implementation overrides <see cref="GetComboScoreChange"/> this may not be relevant.
/// </remarks>
public const double COMBO_EXPONENT = 0.5;
public const double MAX_SCORE = 1000000; public const double MAX_SCORE = 1000000;
private const double accuracy_cutoff_x = 1; private const double accuracy_cutoff_x = 1;
@ -293,7 +301,7 @@ namespace osu.Game.Rulesets.Scoring
protected virtual double GetBonusScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type); protected virtual double GetBonusScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type);
protected virtual double GetComboScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type) * Math.Pow(result.ComboAfterJudgement, 0.5); protected virtual double GetComboScoreChange(JudgementResult result) => Judgement.ToNumericResult(result.Type) * Math.Pow(result.ComboAfterJudgement, COMBO_EXPONENT);
protected virtual void ApplyScoreChange(JudgementResult result) protected virtual void ApplyScoreChange(JudgementResult result)
{ {