1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 19:27:24 +08:00

Rename slider multiplier variable back for now

This commit is contained in:
Dean Herbert 2023-05-09 16:58:19 +09:00
parent 8c44d528e9
commit 944da06c10
33 changed files with 51 additions and 51 deletions

View File

@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Catch.Tests.Editor
{
var playable = base.GetPlayableBeatmap();
playable.Difficulty.SliderTickRate = 5;
playable.Difficulty.BaseSliderVelocity = velocity_factor * 10;
playable.Difficulty.SliderMultiplier = velocity_factor * 10;
return playable;
}

View File

@ -210,7 +210,7 @@ namespace osu.Game.Rulesets.Catch.Tests.Editor
X = x,
Path = sliderPath,
};
EditorBeatmap.Difficulty.BaseSliderVelocity = velocity;
EditorBeatmap.Difficulty.SliderMultiplier = velocity;
EditorBeatmap.Add(hitObject);
EditorBeatmap.Update(hitObject);
Assert.That(hitObject.Velocity, Is.EqualTo(velocity));

View File

@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Catch.Tests
{
BeatmapInfo = new BeatmapInfo
{
Difficulty = new BeatmapDifficulty { CircleSize = 6, BaseSliderVelocity = 3 },
Difficulty = new BeatmapDifficulty { CircleSize = 6, SliderMultiplier = 3 },
Ruleset = ruleset
}
};

View File

@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Catch.Tests
{
BeatmapInfo = new BeatmapInfo
{
Difficulty = new BeatmapDifficulty { CircleSize = 5, BaseSliderVelocity = 2 },
Difficulty = new BeatmapDifficulty { CircleSize = 5, SliderMultiplier = 2 },
Ruleset = ruleset
},
HitObjects = new List<HitObject>

View File

@ -64,8 +64,8 @@ namespace osu.Game.Rulesets.Catch.Objects
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
velocityFactor = base_scoring_distance * difficulty.BaseSliderVelocity / timingPoint.BeatLength;
tickDistanceFactor = base_scoring_distance * difficulty.BaseSliderVelocity / difficulty.SliderTickRate;
velocityFactor = base_scoring_distance * difficulty.SliderMultiplier / timingPoint.BeatLength;
tickDistanceFactor = base_scoring_distance * difficulty.SliderMultiplier / difficulty.SliderTickRate;
}
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)

View File

@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
StartTime = (int)Math.Round(hitObject.StartTime);
// This matches stable's calculation.
EndTime = (int)Math.Floor(StartTime + distanceData.Distance * beatLength * SpanCount * 0.01 / beatmap.Difficulty.BaseSliderVelocity);
EndTime = (int)Math.Floor(StartTime + distanceData.Distance * beatLength * SpanCount * 0.01 / beatmap.Difficulty.SliderMultiplier);
SegmentDuration = (EndTime - StartTime) / SpanCount;
}

View File

@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Mania.UI
{
// Mania doesn't care about global velocity
p.Velocity = 1;
p.BaseBeatLength *= Beatmap.Difficulty.BaseSliderVelocity;
p.BaseBeatLength *= Beatmap.Difficulty.SliderMultiplier;
// For non-mania beatmap, speed changes should only happen through timing points
if (!isForCurrentRuleset)

View File

@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
[SetUp]
public void Setup() => Schedule(() =>
{
editorBeatmap.Difficulty.BaseSliderVelocity = 1;
editorBeatmap.Difficulty.SliderMultiplier = 1;
editorBeatmap.ControlPointInfo.Clear();
editorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = beat_length });
snapProvider.DistanceSpacingMultiplier.Value = 1;

View File

@ -162,7 +162,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
AddStep("change to these specific circumstances", () =>
{
EditorBeatmap.Difficulty.BaseSliderVelocity = 1;
EditorBeatmap.Difficulty.SliderMultiplier = 1;
var timingPoint = EditorBeatmap.ControlPointInfo.TimingPointAt(slider.StartTime);
timingPoint.BeatLength = 352.941176470588;
slider.Path.ControlPoints[^1].Position = new Vector2(-110, 16);

View File

@ -167,7 +167,7 @@ namespace osu.Game.Rulesets.Osu.Objects
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
double scoringDistance = BASE_SCORING_DISTANCE * difficulty.BaseSliderVelocity * SliderVelocity;
double scoringDistance = BASE_SCORING_DISTANCE * difficulty.SliderMultiplier * SliderVelocity;
Velocity = scoringDistance / timingPoint.BeatLength;
TickDistance = GenerateTicks ? (scoringDistance / difficulty.SliderTickRate * TickDistanceMultiplier) : double.PositiveInfinity;

View File

@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Editor
[Test]
public void TestTaikoSliderMultiplier()
{
AddStep("Set slider multiplier", () => EditorBeatmap.Difficulty.BaseSliderVelocity = 2);
AddStep("Set slider multiplier", () => EditorBeatmap.Difficulty.SliderMultiplier = 2);
SaveEditor();
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Editor
// therefore, ensure that we have that difficulty type by calling .CopyFrom(), which is a no-op if the type is already correct.
var taikoDifficulty = new TaikoBeatmapConverter.TaikoMultiplierAppliedDifficulty();
taikoDifficulty.CopyFrom(EditorBeatmap.Difficulty);
return Precision.AlmostEquals(taikoDifficulty.BaseSliderVelocity, 2);
return Precision.AlmostEquals(taikoDifficulty.SliderMultiplier, 2);
}
}
}

View File

@ -189,7 +189,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
else
beatLength = timingPoint.BeatLength;
double sliderScoringPointDistance = osu_base_scoring_distance * beatmap.Difficulty.BaseSliderVelocity / beatmap.Difficulty.SliderTickRate;
double sliderScoringPointDistance = osu_base_scoring_distance * beatmap.Difficulty.SliderMultiplier / beatmap.Difficulty.SliderTickRate;
// The velocity and duration of the taiko hit object - calculated as the velocity of a drum roll.
double taikoVelocity = sliderScoringPointDistance * beatmap.Difficulty.SliderTickRate;
@ -239,14 +239,14 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
{
base.CopyTo(other);
if (!(other is TaikoMultiplierAppliedDifficulty))
other.BaseSliderVelocity /= LegacyBeatmapEncoder.LEGACY_TAIKO_VELOCITY_MULTIPLIER;
other.SliderMultiplier /= LegacyBeatmapEncoder.LEGACY_TAIKO_VELOCITY_MULTIPLIER;
}
public override void CopyFrom(IBeatmapDifficultyInfo other)
{
base.CopyFrom(other);
if (!(other is TaikoMultiplierAppliedDifficulty))
BaseSliderVelocity *= LegacyBeatmapEncoder.LEGACY_TAIKO_VELOCITY_MULTIPLIER;
SliderMultiplier *= LegacyBeatmapEncoder.LEGACY_TAIKO_VELOCITY_MULTIPLIER;
}
#endregion

View File

@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
{
base.ApplySettings(difficulty);
if (ScrollSpeed.Value != null) difficulty.BaseSliderVelocity *= ScrollSpeed.Value.Value;
if (ScrollSpeed.Value != null) difficulty.SliderMultiplier *= ScrollSpeed.Value.Value;
}
}
}

View File

@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
public override void ApplyToDifficulty(BeatmapDifficulty difficulty)
{
base.ApplyToDifficulty(difficulty);
difficulty.BaseSliderVelocity *= slider_multiplier;
difficulty.SliderMultiplier *= slider_multiplier;
}
}
}

View File

@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
public override void ApplyToDifficulty(BeatmapDifficulty difficulty)
{
base.ApplyToDifficulty(difficulty);
difficulty.BaseSliderVelocity *= slider_multiplier;
difficulty.SliderMultiplier *= slider_multiplier;
}
}
}

View File

@ -68,7 +68,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
double scoringDistance = base_distance * difficulty.BaseSliderVelocity * SliderVelocity;
double scoringDistance = base_distance * difficulty.SliderMultiplier * SliderVelocity;
Velocity = scoringDistance / timingPoint.BeatLength;
tickSpacing = timingPoint.BeatLength / TickRate;

View File

@ -136,7 +136,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
Assert.AreEqual(4, difficulty.CircleSize);
Assert.AreEqual(8, difficulty.OverallDifficulty);
Assert.AreEqual(9, difficulty.ApproachRate);
Assert.AreEqual(1.8, difficulty.BaseSliderVelocity);
Assert.AreEqual(1.8, difficulty.SliderMultiplier);
Assert.AreEqual(2, difficulty.SliderTickRate);
}
}

View File

@ -91,7 +91,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
Assert.AreEqual(4, difficulty.CircleSize);
Assert.AreEqual(8, difficulty.OverallDifficulty);
Assert.AreEqual(9, difficulty.ApproachRate);
Assert.AreEqual(1.8, difficulty.BaseSliderVelocity);
Assert.AreEqual(1.8, difficulty.SliderMultiplier);
Assert.AreEqual(2, difficulty.SliderTickRate);
}

View File

@ -57,7 +57,7 @@ namespace osu.Game.Tests.Editing
BeatDivisor.Value = 1;
composer.EditorBeatmap.Difficulty.BaseSliderVelocity = 1;
composer.EditorBeatmap.Difficulty.SliderMultiplier = 1;
composer.EditorBeatmap.ControlPointInfo.Clear();
composer.EditorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 1000 });
});
@ -66,7 +66,7 @@ namespace osu.Game.Tests.Editing
[TestCase(2)]
public void TestSliderMultiplier(float multiplier)
{
AddStep($"set slider multiplier = {multiplier}", () => composer.EditorBeatmap.Difficulty.BaseSliderVelocity = multiplier);
AddStep($"set slider multiplier = {multiplier}", () => composer.EditorBeatmap.Difficulty.SliderMultiplier = multiplier);
assertSnapDistance(100 * multiplier, null, true);
}
@ -128,7 +128,7 @@ namespace osu.Game.Tests.Editing
assertDurationToDistance(500, 50);
assertDurationToDistance(1000, 100);
AddStep("set slider multiplier = 2", () => composer.EditorBeatmap.Difficulty.BaseSliderVelocity = 2);
AddStep("set slider multiplier = 2", () => composer.EditorBeatmap.Difficulty.SliderMultiplier = 2);
assertDurationToDistance(500, 100);
assertDurationToDistance(1000, 200);
@ -149,7 +149,7 @@ namespace osu.Game.Tests.Editing
assertDistanceToDuration(50, 500);
assertDistanceToDuration(100, 1000);
AddStep("set slider multiplier = 2", () => composer.EditorBeatmap.Difficulty.BaseSliderVelocity = 2);
AddStep("set slider multiplier = 2", () => composer.EditorBeatmap.Difficulty.SliderMultiplier = 2);
assertDistanceToDuration(100, 500);
assertDistanceToDuration(200, 1000);
@ -174,7 +174,7 @@ namespace osu.Game.Tests.Editing
assertSnappedDuration(200, 2000);
assertSnappedDuration(250, 3000);
AddStep("set slider multiplier = 2", () => composer.EditorBeatmap.Difficulty.BaseSliderVelocity = 2);
AddStep("set slider multiplier = 2", () => composer.EditorBeatmap.Difficulty.SliderMultiplier = 2);
assertSnappedDuration(0, 0);
assertSnappedDuration(50, 0);
@ -206,7 +206,7 @@ namespace osu.Game.Tests.Editing
assertSnappedDistance(200, 200);
assertSnappedDistance(250, 200);
AddStep("set slider multiplier = 2", () => composer.EditorBeatmap.Difficulty.BaseSliderVelocity = 2);
AddStep("set slider multiplier = 2", () => composer.EditorBeatmap.Difficulty.SliderMultiplier = 2);
assertSnappedDistance(50, 0);
assertSnappedDistance(100, 0);

View File

@ -45,7 +45,7 @@ namespace osu.Game.Tests.Visual.Editing
}
});
editorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = beat_length });
editorBeatmap.Difficulty.BaseSliderVelocity = 1;
editorBeatmap.Difficulty.SliderMultiplier = 1;
}
[SetUp]

View File

@ -184,7 +184,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{
var beatmap = createBeatmap();
beatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = time_range });
beatmap.Difficulty.BaseSliderVelocity = 2;
beatmap.Difficulty.SliderMultiplier = 2;
createTest(beatmap, d => d.RelativeScaleBeatLengthsOverride = true);
AddStep("adjust time range", () => drawableRuleset.TimeRange.Value = 5000);
@ -198,7 +198,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{
var beatmap = createBeatmap();
beatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = time_range });
beatmap.Difficulty.BaseSliderVelocity = 2;
beatmap.Difficulty.SliderMultiplier = 2;
createTest(beatmap);
AddStep("adjust time range", () => drawableRuleset.TimeRange.Value = 2000);

View File

@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{
BeatmapInfo = new BeatmapInfo
{
Difficulty = new BeatmapDifficulty { CircleSize = 6, BaseSliderVelocity = 3 },
Difficulty = new BeatmapDifficulty { CircleSize = 6, SliderMultiplier = 3 },
Ruleset = ruleset
},
ControlPointInfo = controlPointInfo

View File

@ -11,7 +11,7 @@ namespace osu.Game.Beatmaps
public class BeatmapDifficulty : EmbeddedObject, IBeatmapDifficultyInfo
{
/// <summary>
/// The default value used for all difficulty settings except <see cref="BaseSliderVelocity"/> and <see cref="SliderTickRate"/>.
/// The default value used for all difficulty settings except <see cref="SliderMultiplier"/> and <see cref="SliderTickRate"/>.
/// </summary>
public const float DEFAULT_DIFFICULTY = 5;
@ -20,7 +20,7 @@ namespace osu.Game.Beatmaps
public float OverallDifficulty { get; set; } = IBeatmapDifficultyInfo.DEFAULT_DIFFICULTY;
public float ApproachRate { get; set; } = IBeatmapDifficultyInfo.DEFAULT_DIFFICULTY;
public double BaseSliderVelocity { get; set; } = 1;
public double SliderMultiplier { get; set; } = 1;
public double SliderTickRate { get; set; } = 1;
public BeatmapDifficulty()
@ -44,7 +44,7 @@ namespace osu.Game.Beatmaps
difficulty.CircleSize = CircleSize;
difficulty.OverallDifficulty = OverallDifficulty;
difficulty.BaseSliderVelocity = BaseSliderVelocity;
difficulty.SliderMultiplier = SliderMultiplier;
difficulty.SliderTickRate = SliderTickRate;
}
@ -55,7 +55,7 @@ namespace osu.Game.Beatmaps
CircleSize = other.CircleSize;
OverallDifficulty = other.OverallDifficulty;
BaseSliderVelocity = other.BaseSliderVelocity;
SliderMultiplier = other.SliderMultiplier;
SliderTickRate = other.SliderTickRate;
}
}

View File

@ -353,7 +353,7 @@ namespace osu.Game.Beatmaps
CircleSize = decodedDifficulty.CircleSize,
OverallDifficulty = decodedDifficulty.OverallDifficulty,
ApproachRate = decodedDifficulty.ApproachRate,
BaseSliderVelocity = decodedDifficulty.BaseSliderVelocity,
SliderMultiplier = decodedDifficulty.SliderMultiplier,
SliderTickRate = decodedDifficulty.SliderTickRate,
};

View File

@ -384,7 +384,7 @@ namespace osu.Game.Beatmaps.Formats
break;
case @"SliderMultiplier":
difficulty.BaseSliderVelocity = Parsing.ParseDouble(pair.Value);
difficulty.SliderMultiplier = Parsing.ParseDouble(pair.Value);
break;
case @"SliderTickRate":

View File

@ -155,8 +155,8 @@ namespace osu.Game.Beatmaps.Formats
// Taiko adjusts the slider multiplier (see: LEGACY_TAIKO_VELOCITY_MULTIPLIER)
writer.WriteLine(onlineRulesetID == 1
? FormattableString.Invariant($"SliderMultiplier: {beatmap.Difficulty.BaseSliderVelocity / LEGACY_TAIKO_VELOCITY_MULTIPLIER}")
: FormattableString.Invariant($"SliderMultiplier: {beatmap.Difficulty.BaseSliderVelocity}"));
? FormattableString.Invariant($"SliderMultiplier: {beatmap.Difficulty.SliderMultiplier / LEGACY_TAIKO_VELOCITY_MULTIPLIER}")
: FormattableString.Invariant($"SliderMultiplier: {beatmap.Difficulty.SliderMultiplier}"));
writer.WriteLine(FormattableString.Invariant($"SliderTickRate: {beatmap.Difficulty.SliderTickRate}"));
}

View File

@ -9,7 +9,7 @@ namespace osu.Game.Beatmaps
public interface IBeatmapDifficultyInfo
{
/// <summary>
/// The default value used for all difficulty settings except <see cref="BaseSliderVelocity"/> and <see cref="SliderTickRate"/>.
/// The default value used for all difficulty settings except <see cref="SliderMultiplier"/> and <see cref="SliderTickRate"/>.
/// </summary>
const float DEFAULT_DIFFICULTY = 5;
@ -37,7 +37,7 @@ namespace osu.Game.Beatmaps
/// The base slider velocity of the associated beatmap.
/// This was known as "SliderMultiplier" in the .osu format and stable editor.
/// </summary>
double BaseSliderVelocity { get; }
double SliderMultiplier { get; }
/// <summary>
/// The slider tick rate of the associated beatmap.

View File

@ -240,7 +240,7 @@ namespace osu.Game.Rulesets.Edit
public virtual float GetBeatSnapDistanceAt(HitObject referenceObject, bool useReferenceSliderVelocity = true)
{
return (float)(100 * (useReferenceSliderVelocity && referenceObject is IHasSliderVelocity hasSliderVelocity ? hasSliderVelocity.SliderVelocity : 1) * EditorBeatmap.Difficulty.BaseSliderVelocity * 1
return (float)(100 * (useReferenceSliderVelocity && referenceObject is IHasSliderVelocity hasSliderVelocity ? hasSliderVelocity.SliderVelocity : 1) * EditorBeatmap.Difficulty.SliderMultiplier * 1
/ BeatSnapProvider.BeatDivisor);
}

View File

@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
double scoringDistance = base_scoring_distance * difficulty.BaseSliderVelocity * SliderVelocity;
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * SliderVelocity;
Velocity = scoringDistance / timingPoint.BeatLength;
}

View File

@ -123,7 +123,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
// The slider multiplier is post-multiplied to determine the final velocity, but for relative scale beat lengths
// the multiplier should not affect the effective timing point (the longest in the beatmap), so it is factored out here
baseBeatLength /= Beatmap.Difficulty.BaseSliderVelocity;
baseBeatLength /= Beatmap.Difficulty.SliderMultiplier;
}
// Merge sequences of timing and difficulty control points to create the aggregate "multiplier" control point
@ -150,7 +150,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
return new MultiplierControlPoint(c.Time)
{
Velocity = Beatmap.Difficulty.BaseSliderVelocity,
Velocity = Beatmap.Difficulty.SliderMultiplier,
BaseBeatLength = baseBeatLength,
TimingPoint = lastTimingPoint,
EffectPoint = lastEffectPoint
@ -167,7 +167,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
ControlPoints.AddRange(timingChanges);
if (ControlPoints.Count == 0)
ControlPoints.Add(new MultiplierControlPoint { Velocity = Beatmap.Difficulty.BaseSliderVelocity });
ControlPoints.Add(new MultiplierControlPoint { Velocity = Beatmap.Difficulty.SliderMultiplier });
}
protected override void LoadComplete()

View File

@ -73,7 +73,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
if (selected is IHasSliderVelocity sliderVelocity)
{
AddHeader("Slider Velocity");
AddValue($"{sliderVelocity.SliderVelocity:#,0.00}x ({sliderVelocity.SliderVelocity * EditorBeatmap.Difficulty.BaseSliderVelocity:#,0.00}x)");
AddValue($"{sliderVelocity.SliderVelocity:#,0.00}x ({sliderVelocity.SliderVelocity * EditorBeatmap.Difficulty.SliderMultiplier:#,0.00}x)");
}
if (selected is IHasRepeats repeats)

View File

@ -165,7 +165,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
private void updateInspectorText()
{
double beatmapVelocity = EditorBeatmap.Difficulty.BaseSliderVelocity;
double beatmapVelocity = EditorBeatmap.Difficulty.SliderMultiplier;
InspectorText.Clear();

View File

@ -85,7 +85,7 @@ namespace osu.Game.Screens.Edit.Setup
Label = EditorSetupStrings.BaseVelocity,
FixedLabelWidth = LABEL_WIDTH,
Description = EditorSetupStrings.BaseVelocityDescription,
Current = new BindableDouble(Beatmap.Difficulty.BaseSliderVelocity)
Current = new BindableDouble(Beatmap.Difficulty.SliderMultiplier)
{
Default = 1,
MinValue = 0.4,
@ -110,7 +110,7 @@ namespace osu.Game.Screens.Edit.Setup
Beatmap.Difficulty.DrainRate = healthDrainSlider.Current.Value;
Beatmap.Difficulty.ApproachRate = approachRateSlider.Current.Value;
Beatmap.Difficulty.OverallDifficulty = overallDifficultySlider.Current.Value;
Beatmap.Difficulty.BaseSliderVelocity = baseVelocitySlider.Current.Value;
Beatmap.Difficulty.SliderMultiplier = baseVelocitySlider.Current.Value;
Beatmap.UpdateAllHitObjects();
Beatmap.SaveState();