mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 03:02:54 +08:00
Merge pull request #2567 from smoogipoo/fix-conversion-hitwindows
Fix converted beatmap hitwindows not working correctly
This commit is contained in:
commit
2582bf1440
@ -84,11 +84,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
|
|||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
foreach (ManiaHitObject obj in objects)
|
foreach (ManiaHitObject obj in objects)
|
||||||
{
|
|
||||||
obj.HitWindows = original.HitWindows;
|
|
||||||
yield return obj;
|
yield return obj;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private readonly List<double> prevNoteTimes = new List<double>(max_notes_for_density);
|
private readonly List<double> prevNoteTimes = new List<double>(max_notes_for_density);
|
||||||
private double density = int.MaxValue;
|
private double density = int.MaxValue;
|
||||||
|
@ -204,6 +204,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private class DrawableTailNote : DrawableNote
|
private class DrawableTailNote : DrawableNote
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Lenience of release hit windows. This is to make cases where the hold note release
|
||||||
|
/// is timed alongside presses of other hit objects less awkward.
|
||||||
|
/// Todo: This shouldn't exist for non-LegacyBeatmapDecoder beatmaps
|
||||||
|
/// </summary>
|
||||||
|
private const double release_window_lenience = 1.5;
|
||||||
|
|
||||||
private readonly DrawableHoldNote holdNote;
|
private readonly DrawableHoldNote holdNote;
|
||||||
|
|
||||||
public DrawableTailNote(DrawableHoldNote holdNote, ManiaAction action)
|
public DrawableTailNote(DrawableHoldNote holdNote, ManiaAction action)
|
||||||
@ -216,6 +223,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
|
|
||||||
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
|
// Factor in the release lenience
|
||||||
|
timeOffset /= release_window_lenience;
|
||||||
|
|
||||||
if (!userTriggered)
|
if (!userTriggered)
|
||||||
{
|
{
|
||||||
if (!HitObject.HitWindows.CanBeHit(timeOffset))
|
if (!HitObject.HitWindows.CanBeHit(timeOffset))
|
||||||
|
@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Mania.Objects
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The tail note of the hold.
|
/// The tail note of the hold.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly Note Tail = new TailNote();
|
public readonly Note Tail = new Note();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The time between ticks of this hold.
|
/// The time between ticks of this hold.
|
||||||
@ -94,25 +94,5 @@ namespace osu.Game.Rulesets.Mania.Objects
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The tail of the hold note.
|
|
||||||
/// </summary>
|
|
||||||
private class TailNote : Note
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Lenience of release hit windows. This is to make cases where the hold note release
|
|
||||||
/// is timed alongside presses of other hit objects less awkward.
|
|
||||||
/// Todo: This shouldn't exist for non-LegacyBeatmapDecoder beatmaps
|
|
||||||
/// </summary>
|
|
||||||
private const double release_window_lenience = 1.5;
|
|
||||||
|
|
||||||
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
|
||||||
{
|
|
||||||
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
|
||||||
|
|
||||||
HitWindows *= release_window_lenience;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
|
||||||
using osu.Game.Rulesets.Mania.Objects.Types;
|
using osu.Game.Rulesets.Mania.Objects.Types;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
|
|
||||||
@ -12,12 +10,6 @@ namespace osu.Game.Rulesets.Mania.Objects
|
|||||||
{
|
{
|
||||||
public virtual int Column { get; set; }
|
public virtual int Column { get; set; }
|
||||||
|
|
||||||
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
protected override HitWindows CreateHitWindows() => new ManiaHitWindows();
|
||||||
{
|
|
||||||
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
|
||||||
|
|
||||||
HitWindows.AllowsPerfect = true;
|
|
||||||
HitWindows.AllowsOk = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,12 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
namespace osu.Game.Rulesets.Mania.Objects
|
||||||
{
|
{
|
||||||
public class ConvertHitWindows : HitWindows
|
public class ManiaHitWindows : HitWindows
|
||||||
{
|
{
|
||||||
private static readonly IReadOnlyDictionary<HitResult, (double od0, double od5, double od10)> base_ranges = new Dictionary<HitResult, (double, double, double)>
|
private static readonly IReadOnlyDictionary<HitResult, (double od0, double od5, double od10)> base_ranges = new Dictionary<HitResult, (double, double, double)>
|
||||||
{
|
{
|
||||||
@ -21,6 +22,9 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
|||||||
|
|
||||||
public override void SetDifficulty(double difficulty)
|
public override void SetDifficulty(double difficulty)
|
||||||
{
|
{
|
||||||
|
AllowsPerfect = true;
|
||||||
|
AllowsOk = true;
|
||||||
|
|
||||||
Perfect = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Perfect]);
|
Perfect = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Perfect]);
|
||||||
Great = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Great]);
|
Great = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Great]);
|
||||||
Good = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Good]);
|
Good = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Good]);
|
@ -40,8 +40,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
RepeatSamples = curveData.RepeatSamples,
|
RepeatSamples = curveData.RepeatSamples,
|
||||||
RepeatCount = curveData.RepeatCount,
|
RepeatCount = curveData.RepeatCount,
|
||||||
Position = positionData?.Position ?? Vector2.Zero,
|
Position = positionData?.Position ?? Vector2.Zero,
|
||||||
NewCombo = comboData?.NewCombo ?? false,
|
NewCombo = comboData?.NewCombo ?? false
|
||||||
HitWindows = original.HitWindows
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if (endTimeData != null)
|
else if (endTimeData != null)
|
||||||
@ -51,8 +50,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
StartTime = original.StartTime,
|
StartTime = original.StartTime,
|
||||||
Samples = original.Samples,
|
Samples = original.Samples,
|
||||||
EndTime = endTimeData.EndTime,
|
EndTime = endTimeData.EndTime,
|
||||||
Position = positionData?.Position ?? OsuPlayfield.BASE_SIZE / 2,
|
Position = positionData?.Position ?? OsuPlayfield.BASE_SIZE / 2
|
||||||
HitWindows = original.HitWindows
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -62,8 +60,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
StartTime = original.StartTime,
|
StartTime = original.StartTime,
|
||||||
Samples = original.Samples,
|
Samples = original.Samples,
|
||||||
Position = positionData?.Position ?? Vector2.Zero,
|
Position = positionData?.Position ?? Vector2.Zero,
|
||||||
NewCombo = comboData?.NewCombo ?? false,
|
NewCombo = comboData?.NewCombo ?? false
|
||||||
HitWindows = original.HitWindows
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,5 +71,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OffsetPosition(Vector2 offset) => Position += offset;
|
public virtual void OffsetPosition(Vector2 offset) => Position += offset;
|
||||||
|
|
||||||
|
protected override HitWindows CreateHitWindows() => new OsuHitWindows();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,12 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
namespace osu.Game.Rulesets.Osu.Objects
|
||||||
{
|
{
|
||||||
public class ConvertHitWindows : HitWindows
|
public class OsuHitWindows : HitWindows
|
||||||
{
|
{
|
||||||
private static readonly IReadOnlyDictionary<HitResult, (double od0, double od5, double od10)> base_ranges = new Dictionary<HitResult, (double, double, double)>
|
private static readonly IReadOnlyDictionary<HitResult, (double od0, double od5, double od10)> base_ranges = new Dictionary<HitResult, (double, double, double)>
|
||||||
{
|
{
|
@ -132,8 +132,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
{
|
{
|
||||||
StartTime = j,
|
StartTime = j,
|
||||||
Samples = currentSamples,
|
Samples = currentSamples,
|
||||||
IsStrong = strong,
|
IsStrong = strong
|
||||||
HitWindows = obj.HitWindows
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -142,8 +141,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
{
|
{
|
||||||
StartTime = j,
|
StartTime = j,
|
||||||
Samples = currentSamples,
|
Samples = currentSamples,
|
||||||
IsStrong = strong,
|
IsStrong = strong
|
||||||
HitWindows = obj.HitWindows
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,8 +156,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
IsStrong = strong,
|
IsStrong = strong,
|
||||||
Duration = taikoDuration,
|
Duration = taikoDuration,
|
||||||
TickRate = beatmap.BeatmapInfo.BaseDifficulty.SliderTickRate == 3 ? 3 : 4,
|
TickRate = beatmap.BeatmapInfo.BaseDifficulty.SliderTickRate == 3 ? 3 : 4
|
||||||
HitWindows = obj.HitWindows
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -173,8 +170,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
IsStrong = strong,
|
IsStrong = strong,
|
||||||
Duration = endTimeData.Duration,
|
Duration = endTimeData.Duration,
|
||||||
RequiredHits = (int)Math.Max(1, endTimeData.Duration / 1000 * hitMultiplier),
|
RequiredHits = (int)Math.Max(1, endTimeData.Duration / 1000 * hitMultiplier)
|
||||||
HitWindows = obj.HitWindows
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -187,8 +183,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
{
|
{
|
||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
IsStrong = strong,
|
IsStrong = strong
|
||||||
HitWindows = obj.HitWindows
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -197,8 +192,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
{
|
{
|
||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
IsStrong = strong,
|
IsStrong = strong
|
||||||
HitWindows = obj.HitWindows
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,5 +27,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
|||||||
/// Strong hit objects give more points for hitting the hit object with both keys.
|
/// Strong hit objects give more points for hitting the hit object with both keys.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsStrong;
|
public bool IsStrong;
|
||||||
|
|
||||||
|
protected override HitWindows CreateHitWindows() => new TaikoHitWindows();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,12 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
namespace osu.Game.Rulesets.Taiko.Objects
|
||||||
{
|
{
|
||||||
public class ConvertHitWindows : HitWindows
|
public class TaikoHitWindows : HitWindows
|
||||||
{
|
{
|
||||||
private static readonly IReadOnlyDictionary<HitResult, (double od0, double od5, double od10)> base_ranges = new Dictionary<HitResult, (double, double, double)>
|
private static readonly IReadOnlyDictionary<HitResult, (double od0, double od5, double od10)> base_ranges = new Dictionary<HitResult, (double, double, double)>
|
||||||
{
|
{
|
@ -135,39 +135,5 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
/// <param name="timeOffset">The time offset.</param>
|
/// <param name="timeOffset">The time offset.</param>
|
||||||
/// <returns>Whether the <see cref="HitObject"/> can be hit at any point in the future from this time offset.</returns>
|
/// <returns>Whether the <see cref="HitObject"/> can be hit at any point in the future from this time offset.</returns>
|
||||||
public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(HitResult.Meh);
|
public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(HitResult.Meh);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Multiplies all hit windows by a value.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="windows">The hit windows to multiply.</param>
|
|
||||||
/// <param name="value">The value to multiply each hit window by.</param>
|
|
||||||
public static HitWindows operator *(HitWindows windows, double value)
|
|
||||||
{
|
|
||||||
windows.Perfect *= value;
|
|
||||||
windows.Great *= value;
|
|
||||||
windows.Good *= value;
|
|
||||||
windows.Ok *= value;
|
|
||||||
windows.Meh *= value;
|
|
||||||
windows.Miss *= value;
|
|
||||||
|
|
||||||
return windows;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Divides all hit windows by a value.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="windows">The hit windows to divide.</param>
|
|
||||||
/// <param name="value">The value to divide each hit window by.</param>
|
|
||||||
public static HitWindows operator /(HitWindows windows, double value)
|
|
||||||
{
|
|
||||||
windows.Perfect /= value;
|
|
||||||
windows.Great /= value;
|
|
||||||
windows.Good /= value;
|
|
||||||
windows.Ok /= value;
|
|
||||||
windows.Meh /= value;
|
|
||||||
windows.Miss /= value;
|
|
||||||
|
|
||||||
return windows;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
|||||||
|
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => new ConvertHitWindows();
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
|||||||
|
|
||||||
public double Duration => EndTime - StartTime;
|
public double Duration => EndTime - StartTime;
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => new ConvertHitWindows();
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
|||||||
|
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => new ConvertHitWindows();
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
|||||||
|
|
||||||
public float X { get; set; }
|
public float X { get; set; }
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => new ConvertHitWindows();
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
|||||||
|
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => new ConvertHitWindows();
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
|||||||
|
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => new ConvertHitWindows();
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
|||||||
|
|
||||||
public float Y => Position.Y;
|
public float Y => Position.Y;
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => new ConvertHitWindows();
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
|||||||
{
|
{
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => new ConvertHitWindows();
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
|||||||
{
|
{
|
||||||
public bool NewCombo { get; set; }
|
public bool NewCombo { get; set; }
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => new ConvertHitWindows();
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
|||||||
|
|
||||||
public double Duration => EndTime - StartTime;
|
public double Duration => EndTime - StartTime;
|
||||||
|
|
||||||
protected override HitWindows CreateHitWindows() => new ConvertHitWindows();
|
protected override HitWindows CreateHitWindows() => null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user