mirror of
https://github.com/ppy/osu.git
synced 2025-02-25 21:02:59 +08:00
Fix incorrect implementation of old stacking algorithm (#5632)
Fix incorrect implementation of old stacking algorithm
This commit is contained in:
commit
73cd7b0cc2
@ -8,7 +8,6 @@ using osu.Framework.MathUtils;
|
|||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Osu.UI;
|
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Tests
|
namespace osu.Game.Rulesets.Osu.Tests
|
||||||
@ -23,6 +22,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
[TestCase("slider-ticks")]
|
[TestCase("slider-ticks")]
|
||||||
[TestCase("repeat-slider")]
|
[TestCase("repeat-slider")]
|
||||||
[TestCase("uneven-repeat-slider")]
|
[TestCase("uneven-repeat-slider")]
|
||||||
|
[TestCase("old-stacking")]
|
||||||
public void Test(string name) => base.Test(name);
|
public void Test(string name) => base.Test(name);
|
||||||
|
|
||||||
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
||||||
@ -31,22 +31,22 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
case Slider slider:
|
case Slider slider:
|
||||||
foreach (var nested in slider.NestedHitObjects)
|
foreach (var nested in slider.NestedHitObjects)
|
||||||
yield return createConvertValue(nested);
|
yield return createConvertValue((OsuHitObject)nested);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
yield return createConvertValue(hitObject);
|
yield return createConvertValue((OsuHitObject)hitObject);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConvertValue createConvertValue(HitObject obj) => new ConvertValue
|
ConvertValue createConvertValue(OsuHitObject obj) => new ConvertValue
|
||||||
{
|
{
|
||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
EndTime = (obj as IHasEndTime)?.EndTime ?? obj.StartTime,
|
EndTime = (obj as IHasEndTime)?.EndTime ?? obj.StartTime,
|
||||||
X = (obj as IHasPosition)?.X ?? OsuPlayfield.BASE_SIZE.X / 2,
|
X = obj.StackedPosition.X,
|
||||||
Y = (obj as IHasPosition)?.Y ?? OsuPlayfield.BASE_SIZE.Y / 2,
|
Y = obj.StackedPosition.Y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Beatmaps
|
namespace osu.Game.Rulesets.Osu.Beatmaps
|
||||||
{
|
{
|
||||||
@ -208,17 +209,22 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
|
|||||||
if (beatmap.HitObjects[j].StartTime - stackThreshold > startTime)
|
if (beatmap.HitObjects[j].StartTime - stackThreshold > startTime)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// The start position of the hitobject, or the position at the end of the path if the hitobject is a slider
|
||||||
|
Vector2 position2 = currHitObject is Slider currSlider
|
||||||
|
? currSlider.Position + currSlider.Path.PositionAt(1)
|
||||||
|
: currHitObject.Position;
|
||||||
|
|
||||||
if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, currHitObject.Position) < stack_distance)
|
if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, currHitObject.Position) < stack_distance)
|
||||||
{
|
{
|
||||||
currHitObject.StackHeight++;
|
currHitObject.StackHeight++;
|
||||||
startTime = (beatmap.HitObjects[j] as IHasEndTime)?.EndTime ?? beatmap.HitObjects[i].StartTime;
|
startTime = (beatmap.HitObjects[j] as IHasEndTime)?.EndTime ?? beatmap.HitObjects[j].StartTime;
|
||||||
}
|
}
|
||||||
else if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, currHitObject.EndPosition) < stack_distance)
|
else if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, position2) < stack_distance)
|
||||||
{
|
{
|
||||||
//Case for sliders - bump notes down and right, rather than up and left.
|
//Case for sliders - bump notes down and right, rather than up and left.
|
||||||
sliderStack++;
|
sliderStack++;
|
||||||
beatmap.HitObjects[j].StackHeight -= sliderStack;
|
beatmap.HitObjects[j].StackHeight -= sliderStack;
|
||||||
startTime = (beatmap.HitObjects[j] as IHasEndTime)?.EndTime ?? beatmap.HitObjects[i].StartTime;
|
startTime = (beatmap.HitObjects[j] as IHasEndTime)?.EndTime ?? beatmap.HitObjects[j].StartTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,278 @@
|
|||||||
|
{
|
||||||
|
"Mappings": [{
|
||||||
|
"StartTime": 32165,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 32165,
|
||||||
|
"EndTime": 32165,
|
||||||
|
"X": 32,
|
||||||
|
"Y": 320
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 32517,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 32517,
|
||||||
|
"EndTime": 32517,
|
||||||
|
"X": 246.396057,
|
||||||
|
"Y": 182.396057
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 32605,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 32605,
|
||||||
|
"EndTime": 32605,
|
||||||
|
"X": 249.597382,
|
||||||
|
"Y": 185.597382
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 32693,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 32693,
|
||||||
|
"EndTime": 32693,
|
||||||
|
"X": 252.798691,
|
||||||
|
"Y": 188.798691
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 32781,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 32781,
|
||||||
|
"EndTime": 32781,
|
||||||
|
"X": 256,
|
||||||
|
"Y": 192
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 33248,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 33248,
|
||||||
|
"EndTime": 33248,
|
||||||
|
"X": 39.3960648,
|
||||||
|
"Y": 76.3960648
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 33307,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 33307,
|
||||||
|
"EndTime": 33307,
|
||||||
|
"X": 42.5973778,
|
||||||
|
"Y": 79.597374
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 33383,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 33383,
|
||||||
|
"EndTime": 33383,
|
||||||
|
"X": 45.798687,
|
||||||
|
"Y": 82.79869
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 33459,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 33459,
|
||||||
|
"EndTime": 33459,
|
||||||
|
"X": 49,
|
||||||
|
"Y": 86
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 33635,
|
||||||
|
"EndTime": 33635,
|
||||||
|
"X": 123.847847,
|
||||||
|
"Y": 85.7988
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 33811,
|
||||||
|
"EndTime": 33811,
|
||||||
|
"X": 198.6957,
|
||||||
|
"Y": 85.5975952
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 33988,
|
||||||
|
"EndTime": 33988,
|
||||||
|
"X": 273.9688,
|
||||||
|
"Y": 85.39525
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 34164,
|
||||||
|
"EndTime": 34164,
|
||||||
|
"X": 348.816681,
|
||||||
|
"Y": 85.19404
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 34246,
|
||||||
|
"EndTime": 34246,
|
||||||
|
"X": 398.998718,
|
||||||
|
"Y": 85.05914
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 34341,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 34341,
|
||||||
|
"EndTime": 34341,
|
||||||
|
"X": 401.201324,
|
||||||
|
"Y": 88.20131
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 34400,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 34400,
|
||||||
|
"EndTime": 34400,
|
||||||
|
"X": 404.402618,
|
||||||
|
"Y": 91.402626
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 34459,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 34459,
|
||||||
|
"EndTime": 34459,
|
||||||
|
"X": 407.603943,
|
||||||
|
"Y": 94.6039352
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 34989,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 34989,
|
||||||
|
"EndTime": 34989,
|
||||||
|
"X": 163,
|
||||||
|
"Y": 138
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 35018,
|
||||||
|
"EndTime": 35018,
|
||||||
|
"X": 188,
|
||||||
|
"Y": 138
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 35106,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 35106,
|
||||||
|
"EndTime": 35106,
|
||||||
|
"X": 163,
|
||||||
|
"Y": 138
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 35135,
|
||||||
|
"EndTime": 35135,
|
||||||
|
"X": 188,
|
||||||
|
"Y": 138
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 35224,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 35224,
|
||||||
|
"EndTime": 35224,
|
||||||
|
"X": 163,
|
||||||
|
"Y": 138
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 35253,
|
||||||
|
"EndTime": 35253,
|
||||||
|
"X": 188,
|
||||||
|
"Y": 138
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 35695,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 35695,
|
||||||
|
"EndTime": 35695,
|
||||||
|
"X": 166,
|
||||||
|
"Y": 76
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 35871,
|
||||||
|
"EndTime": 35871,
|
||||||
|
"X": 240.99855,
|
||||||
|
"Y": 75.53417
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 36011,
|
||||||
|
"EndTime": 36011,
|
||||||
|
"X": 315.9971,
|
||||||
|
"Y": 75.0683441
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 36106,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 36106,
|
||||||
|
"EndTime": 36106,
|
||||||
|
"X": 315,
|
||||||
|
"Y": 75
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 36282,
|
||||||
|
"EndTime": 36282,
|
||||||
|
"X": 240.001526,
|
||||||
|
"Y": 75.47769
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 36422,
|
||||||
|
"EndTime": 36422,
|
||||||
|
"X": 165.003052,
|
||||||
|
"Y": 75.95539
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 36518,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 36518,
|
||||||
|
"EndTime": 36518,
|
||||||
|
"X": 166,
|
||||||
|
"Y": 76
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 36694,
|
||||||
|
"EndTime": 36694,
|
||||||
|
"X": 240.99855,
|
||||||
|
"Y": 75.53417
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 36834,
|
||||||
|
"EndTime": 36834,
|
||||||
|
"X": 315.9971,
|
||||||
|
"Y": 75.0683441
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 36929,
|
||||||
|
"Objects": [{
|
||||||
|
"StartTime": 36929,
|
||||||
|
"EndTime": 36929,
|
||||||
|
"X": 315,
|
||||||
|
"Y": 75
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 37105,
|
||||||
|
"EndTime": 37105,
|
||||||
|
"X": 240.001526,
|
||||||
|
"Y": 75.47769
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"StartTime": 37245,
|
||||||
|
"EndTime": 37245,
|
||||||
|
"X": 165.003052,
|
||||||
|
"Y": 75.95539
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
osu file format v3
|
||||||
|
|
||||||
|
[Difficulty]
|
||||||
|
HPDrainRate:3
|
||||||
|
CircleSize:5
|
||||||
|
OverallDifficulty:8
|
||||||
|
ApproachRate:8
|
||||||
|
SliderMultiplier:1.5
|
||||||
|
SliderTickRate:2
|
||||||
|
|
||||||
|
[TimingPoints]
|
||||||
|
48,352.941176470588,4,1,1,100,1,0
|
||||||
|
|
||||||
|
[HitObjects]
|
||||||
|
// Hit circles
|
||||||
|
32,320,32165,5,2,0:0:0:0:
|
||||||
|
256,192,32517,5,0,0:0:0:0:
|
||||||
|
256,192,32605,1,0,0:0:0:0:
|
||||||
|
256,192,32693,1,0,0:0:0:0:
|
||||||
|
256,192,32781,1,0,0:0:0:0:
|
||||||
|
|
||||||
|
// Hit circles on slider endpoints
|
||||||
|
49,86,33248,1,0,0:0:0:0:
|
||||||
|
49,86,33307,1,0,0:0:0:0:
|
||||||
|
49,86,33383,1,0,0:0:0:0:
|
||||||
|
49,86,33459,2,0,L|421:85,1,350
|
||||||
|
398,85,34341,1,0,0:0:0:0:
|
||||||
|
398,85,34400,1,0,0:0:0:0:
|
||||||
|
398,85,34459,1,0,0:0:0:0:
|
||||||
|
|
||||||
|
// Sliders
|
||||||
|
163,138,34989,2,0,L|196:138,1,25
|
||||||
|
163,138,35106,2,0,L|196:138,1,25
|
||||||
|
163,138,35224,2,0,L|196:138,1,25
|
||||||
|
|
||||||
|
// Reversed sliders
|
||||||
|
166,76,35695,2,0,L|327:75,1,150
|
||||||
|
315,75,36106,2,0,L|158:76,1,150
|
||||||
|
166,76,36518,2,0,L|327:75,1,150
|
||||||
|
315,75,36929,2,0,L|158:76,1,150
|
Loading…
Reference in New Issue
Block a user