From 26b91c96fbfdc1568e79c39f1041d9b584914e1f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Oct 2018 12:25:42 +0900 Subject: [PATCH 1/6] Fix wrong number of ticks on some legacy beatmaps --- osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs | 3 ++- osu.Game.Rulesets.Osu/Objects/Slider.cs | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs index 9e0e649eb2..14245ec8ac 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -43,7 +43,8 @@ namespace osu.Game.Rulesets.Osu.Beatmaps Position = positionData?.Position ?? Vector2.Zero, NewCombo = comboData?.NewCombo ?? false, ComboOffset = comboData?.ComboOffset ?? 0, - LegacyLastTickOffset = legacyOffset?.LegacyLastTickOffset + LegacyLastTickOffset = legacyOffset?.LegacyLastTickOffset, + TickDistanceMultiplier = beatmap.BeatmapInfo.BeatmapVersion < 8 ? 1f / beatmap.ControlPointInfo.DifficultyPointAt(original.StartTime).SpeedMultiplier : 1 }; } else if (endTimeData != null) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 7a0dcc77a6..1901c852ed 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -95,6 +95,12 @@ namespace osu.Game.Rulesets.Osu.Objects public double Velocity; public double TickDistance; + /// + /// An extra multiplier that affects the number of ticks generated by this . + /// An increase in this value increases , which reduces the number of ticks generated. + /// + public double TickDistanceMultiplier = 1; + public HitCircle HeadCircle; public SliderTailCircle TailCircle; @@ -108,7 +114,7 @@ namespace osu.Game.Rulesets.Osu.Objects double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier; Velocity = scoringDistance / timingPoint.BeatLength; - TickDistance = scoringDistance / difficulty.SliderTickRate; + TickDistance = scoringDistance / difficulty.SliderTickRate * TickDistanceMultiplier; } protected override void CreateNestedHitObjects() From 2f943e77aa29440460dbc36237cbe8a88f21fdc3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Oct 2018 12:31:52 +0900 Subject: [PATCH 2/6] Make Velocity and TickDistance private set --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseHitObjectComposer.cs | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 1901c852ed..85c5d7a30a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -92,8 +92,8 @@ namespace osu.Game.Rulesets.Osu.Objects /// public double SpanDuration => Duration / this.SpanCount(); - public double Velocity; - public double TickDistance; + public double Velocity { get; private set; } + public double TickDistance { get; private set; } /// /// An extra multiplier that affects the number of ticks generated by this . diff --git a/osu.Game.Tests/Visual/TestCaseHitObjectComposer.cs b/osu.Game.Tests/Visual/TestCaseHitObjectComposer.cs index 5df371dd09..fe00821254 100644 --- a/osu.Game.Tests/Visual/TestCaseHitObjectComposer.cs +++ b/osu.Game.Tests/Visual/TestCaseHitObjectComposer.cs @@ -49,9 +49,7 @@ namespace osu.Game.Tests.Visual Vector2.Zero, new Vector2(216, 0), }, - Distance = 400, - Velocity = 1, - TickDistance = 100, + Distance = 216, Scale = 0.5f, } }, From 657bd5e37139dc10ac2b69015bb91c45d0f0b652 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Oct 2018 12:32:59 +0900 Subject: [PATCH 3/6] Add some xmldocs --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 85c5d7a30a..4fc0d76e2b 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -92,11 +92,18 @@ namespace osu.Game.Rulesets.Osu.Objects /// public double SpanDuration => Duration / this.SpanCount(); + /// + /// Velocity of this . + /// public double Velocity { get; private set; } + + /// + /// Spacing between s of this . + /// public double TickDistance { get; private set; } /// - /// An extra multiplier that affects the number of ticks generated by this . + /// An extra multiplier that affects the number of s generated by this . /// An increase in this value increases , which reduces the number of ticks generated. /// public double TickDistanceMultiplier = 1; From d284f29637b2afddfced8c1dbcb74dcd20814938 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Thu, 18 Oct 2018 14:16:46 +0900 Subject: [PATCH 4/6] Add comment describing the speed multiplier --- osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs index 14245ec8ac..b8aae1c28f 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -44,6 +44,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps NewCombo = comboData?.NewCombo ?? false, ComboOffset = comboData?.ComboOffset ?? 0, LegacyLastTickOffset = legacyOffset?.LegacyLastTickOffset, + // prior to v8, speed multipliers don't affect how many ticks are generated. TickDistanceMultiplier = beatmap.BeatmapInfo.BeatmapVersion < 8 ? 1f / beatmap.ControlPointInfo.DifficultyPointAt(original.StartTime).SpeedMultiplier : 1 }; } From 0952c20c84d3ea40c9835b03ba1a1fd2566174ec Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 20 Oct 2018 23:06:48 +0900 Subject: [PATCH 5/6] Adjust comment slightly --- osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs index b8aae1c28f..5b8a7acf58 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps NewCombo = comboData?.NewCombo ?? false, ComboOffset = comboData?.ComboOffset ?? 0, LegacyLastTickOffset = legacyOffset?.LegacyLastTickOffset, - // prior to v8, speed multipliers don't affect how many ticks are generated. + // prior to v8, speed multipliers don't adjust for how many ticks are generated over the same distance. TickDistanceMultiplier = beatmap.BeatmapInfo.BeatmapVersion < 8 ? 1f / beatmap.ControlPointInfo.DifficultyPointAt(original.StartTime).SpeedMultiplier : 1 }; } From f19cc98e6aa43a8b4d792bb1fedbefd7065da1f4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 20 Oct 2018 23:10:33 +0900 Subject: [PATCH 6/6] Add slightly more explanation --- osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs index 5b8a7acf58..b2914d4b82 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -45,6 +45,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps ComboOffset = comboData?.ComboOffset ?? 0, LegacyLastTickOffset = legacyOffset?.LegacyLastTickOffset, // prior to v8, speed multipliers don't adjust for how many ticks are generated over the same distance. + // this results in more (or less) ticks being generated in