Fix clockrate adjusted difficulty calculations bug in strain decay

When starting a new section, the starting strain value was calculated using the unadjusted timing value, meaning decay curves were essentially being stretched or squashed according to the clockrate.

This caused incorrect strain peaks for any section where the peak occurs at the start of the section (none of the objects in the section added enough strain after decay to exceed the starting strain).

This bug caused star ratings with clockrates above 1 to be lower than they should and below 1 to be higher than they should.
This commit is contained in:
Samuel Cattini-Schultz
2021-02-19 18:04:25 +11:00
parent 303c6bcda7
commit 442347df8e
4 changed files with 12 additions and 6 deletions

View File

@ -25,6 +25,11 @@ namespace osu.Game.Rulesets.Difficulty.Preprocessing
/// </summary>
public readonly double DeltaTime;
/// <summary>
/// Start time of <see cref="BaseObject"/>.
/// </summary>
public readonly double StartTime;
/// <summary>
/// Creates a new <see cref="DifficultyHitObject"/>.
/// </summary>
@ -36,6 +41,7 @@ namespace osu.Game.Rulesets.Difficulty.Preprocessing
BaseObject = hitObject;
LastObject = lastObject;
DeltaTime = (hitObject.StartTime - lastObject.StartTime) / clockRate;
StartTime = hitObject.StartTime / clockRate;
}
}
}