1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 23:12:56 +08:00

Separate travel distance from jump distance

This commit is contained in:
smoogipoo 2018-10-08 17:37:33 +09:00
parent 61e7ada977
commit 1ad5090ad6
3 changed files with 13 additions and 7 deletions

View File

@ -21,9 +21,14 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
public OsuHitObject BaseObject { get; } public OsuHitObject BaseObject { get; }
/// <summary> /// <summary>
/// Normalized distance from the <see cref="OsuHitObject.StackedPosition"/> of the previous <see cref="OsuDifficultyHitObject"/>. /// Normalized distance from the end position of the previous <see cref="OsuDifficultyHitObject"/>.
/// </summary> /// </summary>
public double Distance { get; private set; } public double JumpDistance { get; private set; }
/// <summary>
/// Normalized distance from the start position to the end position of the previous <see cref="OsuDifficultyHitObject"/>.
/// </summary>
public double TravelDistance { get; private set; }
/// <summary> /// <summary>
/// Milliseconds elapsed since the StartTime of the previous <see cref="OsuDifficultyHitObject"/>. /// Milliseconds elapsed since the StartTime of the previous <see cref="OsuDifficultyHitObject"/>.
@ -51,10 +56,10 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
private void setDistances() private void setDistances()
{ {
// We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps. // We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps.
double scalingFactor = normalized_radius / BaseObject.Radius; float scalingFactor = normalized_radius / (float)BaseObject.Radius;
if (BaseObject.Radius < 30) if (BaseObject.Radius < 30)
{ {
double smallCircleBonus = Math.Min(30 - BaseObject.Radius, 5) / 50; float smallCircleBonus = Math.Min(30 - (float)BaseObject.Radius, 5) / 50;
scalingFactor *= 1 + smallCircleBonus; scalingFactor *= 1 + smallCircleBonus;
} }
@ -69,7 +74,8 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
lastTravelDistance = lastSlider.LazyTravelDistance; lastTravelDistance = lastSlider.LazyTravelDistance;
} }
Distance = (lastTravelDistance + (BaseObject.StackedPosition - lastCursorPosition).Length) * scalingFactor; JumpDistance = (BaseObject.StackedPosition - lastCursorPosition).Length * scalingFactor;
TravelDistance = lastTravelDistance * scalingFactor;
} }
private void setTimingValues() private void setTimingValues()

View File

@ -14,6 +14,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
protected override double SkillMultiplier => 26.25; protected override double SkillMultiplier => 26.25;
protected override double StrainDecayBase => 0.15; protected override double StrainDecayBase => 0.15;
protected override double StrainValueOf(OsuDifficultyHitObject current) => Math.Pow(current.Distance, 0.99) / current.DeltaTime; protected override double StrainValueOf(OsuDifficultyHitObject current) => (Math.Pow(current.TravelDistance, 0.99) + Math.Pow(current.JumpDistance, 0.99)) / current.DeltaTime;
} }
} }

View File

@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
protected override double StrainValueOf(OsuDifficultyHitObject current) protected override double StrainValueOf(OsuDifficultyHitObject current)
{ {
double distance = current.Distance; double distance = current.TravelDistance + current.JumpDistance;
double speedValue; double speedValue;
if (distance > single_spacing_threshold) if (distance > single_spacing_threshold)