1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 22:27:46 +08:00

Fix up DT not affecting hitobject densities

This commit is contained in:
smoogipoo 2017-11-17 17:28:22 +09:00
parent bf44b3d0ef
commit 5d753427f6
5 changed files with 16 additions and 11 deletions

View File

@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty
public override double Calculate(Dictionary<string, string> categoryDifficulty = null)
{
OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Beatmap.HitObjects);
OsuDifficultyBeatmap beatmap = new OsuDifficultyBeatmap(Beatmap.HitObjects, TimeRate);
Skill[] skills =
{
new Aim(),
@ -57,7 +57,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty
}
foreach (Skill s in skills)
s.Process(h, TimeRate);
s.Process(h);
}
double aimRating = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier;

View File

@ -20,12 +20,12 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing
/// Creates an enumerator, which preprocesses a list of <see cref="OsuHitObject"/>s recieved as input, wrapping them as
/// <see cref="OsuDifficultyHitObject"/> which contains extra data required for difficulty calculation.
/// </summary>
public OsuDifficultyBeatmap(List<OsuHitObject> objects)
public OsuDifficultyBeatmap(List<OsuHitObject> objects, double timeRate)
{
// Sort OsuHitObjects by StartTime - they are not correctly ordered in some cases.
// This should probably happen before the objects reach the difficulty calculator.
objects.Sort((a, b) => a.StartTime.CompareTo(b.StartTime));
difficultyObjects = createDifficultyObjectEnumerator(objects);
difficultyObjects = createDifficultyObjectEnumerator(objects, timeRate);
}
/// <summary>
@ -67,7 +67,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
private IEnumerator<OsuDifficultyHitObject> createDifficultyObjectEnumerator(List<OsuHitObject> objects)
private IEnumerator<OsuDifficultyHitObject> createDifficultyObjectEnumerator(List<OsuHitObject> objects, double timeRate)
{
// We will process OsuHitObjects in groups of three to form a triangle, so we can calculate an angle for each object.
OsuHitObject[] triangle = new OsuHitObject[3];
@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing
triangle[1] = triangle[0];
triangle[0] = objects[i];
yield return new OsuDifficultyHitObject(triangle);
yield return new OsuDifficultyHitObject(triangle, timeRate);
}
}
}

View File

@ -33,13 +33,17 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing
private const int normalized_radius = 52;
private readonly double timeRate;
private readonly OsuHitObject[] t;
/// <summary>
/// Initializes the object calculating extra data required for difficulty calculation.
/// </summary>
public OsuDifficultyHitObject(OsuHitObject[] triangle)
public OsuDifficultyHitObject(OsuHitObject[] triangle, double timeRate)
{
this.timeRate = timeRate;
t = triangle;
BaseObject = t[0];
setDistances();
@ -63,7 +67,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing
private void setTimingValues()
{
// Every timing inverval is hard capped at the equivalent of 375 BPM streaming speed as a safety measure.
DeltaTime = Math.Max(40, t[0].StartTime - t[1].StartTime);
DeltaTime = Math.Max(40, t[0].StartTime - t[1].StartTime) / timeRate;
TimeUntilHit = 450; // BaseObject.PreEmpt;
}
}

View File

@ -38,9 +38,9 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Skills
/// <summary>
/// Process an <see cref="OsuDifficultyHitObject"/> and update current strain values accordingly.
/// </summary>
public void Process(OsuDifficultyHitObject current, double timeRate)
public void Process(OsuDifficultyHitObject current)
{
currentStrain *= strainDecay(current.DeltaTime / timeRate);
currentStrain *= strainDecay(current.DeltaTime);
if (!(current.BaseObject is Spinner))
currentStrain += StrainValueOf(current) * SkillMultiplier;

View File

@ -183,7 +183,8 @@ namespace osu.Game.Tests.Visual
this.osuGame = osuGame;
this.beatmaps = beatmaps;
text.Text = $"{beatmap.Metadata.Artist} - {beatmap.Metadata.Title} ({beatmap.Metadata.AuthorString}) [{beatmap.Version}]";
var working = beatmaps.GetWorkingBeatmap(beatmap);
text.Text = $"{working.Metadata.Artist} - {working.Metadata.Title} ({working.Metadata.AuthorString}) [{working.BeatmapInfo.Version}]";
osuGame.Beatmap.ValueChanged += beatmapChanged;
}