Skip to content

Commit

Permalink
Fix another difficulty-specific value
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Sep 8, 2023
1 parent 4198e02 commit 6285175
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions osu.Game.Rulesets.Osu/Difficulty/OsuLegacyScoreSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ internal class OsuLegacyScoreSimulator : ILegacyScoreSimulator
private int combo;

private double scoreMultiplier;
private IBeatmap playableBeatmap = null!;

public LegacyScoreAttributes Simulate(IWorkingBeatmap workingBeatmap, IBeatmap playableBeatmap)
{
this.playableBeatmap = playableBeatmap;

IBeatmap baseBeatmap = workingBeatmap.Beatmap;

int countNormal = 0;
Expand Down Expand Up @@ -132,13 +129,16 @@ private void simulateHit(HitObject hitObject, ref LegacyScoreAttributes attribut
// The spinner object applies a lenience because gameplay mechanics differ from osu-stable.
// We'll redo the calculations to match osu-stable here...
const double maximum_rotations_per_second = 477.0 / 60;
double minimumRotationsPerSecond = IBeatmapDifficultyInfo.DifficultyRange(playableBeatmap.Difficulty.OverallDifficulty, 3, 5, 7.5);

// Normally, this value depends on the final overall difficulty. For simplicity, we'll only consider the worst case that maximises rotations.
const double minimum_rotations_per_second = 7.5;

double secondsDuration = spinner.Duration / 1000;

// The total amount of half spins possible for the entire spinner.
int totalHalfSpinsPossible = (int)(secondsDuration * maximum_rotations_per_second * 2);
// The amount of half spins that are required to successfully complete the spinner (i.e. get a 300).
int halfSpinsRequiredForCompletion = (int)(secondsDuration * minimumRotationsPerSecond);
int halfSpinsRequiredForCompletion = (int)(secondsDuration * minimum_rotations_per_second);
// To be able to receive bonus points, the spinner must be rotated another 1.5 times.
int halfSpinsRequiredBeforeBonus = halfSpinsRequiredForCompletion + 3;

Expand Down
10 changes: 5 additions & 5 deletions osu.Game.Rulesets.Taiko/Difficulty/TaikoLegacyScoreSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@ private void simulateHit(HitObject hitObject, ref LegacyScoreAttributes attribut
case Swell swell:
// The taiko swell generally does not match the osu-stable implementation in any way.
// We'll redo the calculations to match osu-stable here...
double minimumRotationsPerSecond = IBeatmapDifficultyInfo.DifficultyRange(playableBeatmap.Difficulty.OverallDifficulty, 3, 5, 7.5);
double secondsDuration = swell.Duration / 1000;

// The amount of half spins that are required to successfully complete the spinner (i.e. get a 300).
int halfSpinsRequiredForCompletion = (int)(secondsDuration * minimumRotationsPerSecond);
// Normally, this value depends on the final overall difficulty. For simplicity, we'll only consider the worst case that maximises rotations.
const double minimum_rotations_per_second = 7.5;

// The amount of half spins that are required to successfully complete the spinner (i.e. get a 300).
int halfSpinsRequiredForCompletion = (int)(swell.Duration / 1000 * minimum_rotations_per_second);
halfSpinsRequiredForCompletion = (int)Math.Max(1, halfSpinsRequiredForCompletion * 1.65f);

//
// Normally, this multiplier depends on the active mods (DT = 0.75, HT = 1.5). For simplicity, however, we'll only consider the worst case.
// Normally, this multiplier depends on the active mods (DT = 0.75, HT = 1.5). For simplicity, we'll only consider the worst case that maximises rotations.
// This way, scores remain beatable at the cost of the conversion being slightly inaccurate.
// - A perfect DT/NM score will have less than 1M total score (excluding bonus).
// - A perfect HT score will have 1M total score (excluding bonus).
Expand Down

0 comments on commit 6285175

Please sign in to comment.