Fix incorrect classic score formula

Upon closer inspection the classic score formula was subtly wrong. The
version given in the wiki is:

	Score = Hit Value + (Hit Value * ((Combo multiplier * Difficulty
	multiplier * Mod multiplier) / 25))

The code previously used:

	bonusScore + baseScore * ((1 + Math.Max(0, HighestCombo.Value - 1)
	* scoreMultiplier) / 25);

which is not equivalent to the version on the wiki. The error is in the 1
factor, as in the above version it is being divided by 25, while it should
be outside the division to keep parity with the previous formula.

The tests attached in the previous commit demonstrate that this change
causes a single hit without combo to increase total score by its exact
numeric value.
This commit is contained in:
Bartłomiej Dach 2020-04-14 00:56:37 +02:00
parent 3e48c26bc2
commit 13c81db0cf
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ private double getScore(ScoringMode mode)
case ScoringMode.Classic:
// should emulate osu-stable's scoring as closely as we can (https://osu.ppy.sh/help/wiki/Score/ScoreV1)
return bonusScore + baseScore * ((1 + Math.Max(0, HighestCombo.Value - 1) * scoreMultiplier) / 25);
return bonusScore + baseScore * (1 + Math.Max(0, HighestCombo.Value - 1) * scoreMultiplier / 25);
}
}