Skip to content

Commit

Permalink
Merge branch 'master' into effective-miss-count
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Oct 16, 2021
2 parents ccaac97 + e925c41 commit 80827b7
Show file tree
Hide file tree
Showing 127 changed files with 2,426 additions and 776 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/report-nunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ jobs:
name: Test Results (${{matrix.os.prettyname}}, ${{matrix.threadingMode}})
path: "*.trx"
reporter: dotnet-trx
list-suites: 'failed'
list-tests: 'failed'
4 changes: 2 additions & 2 deletions osu.Android.props
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<Reference Include="Java.Interop" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.1004.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.1013.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.1015.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.1014.0" />
</ItemGroup>
<ItemGroup Label="Transitive Dependencies">
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->
Expand Down
3 changes: 1 addition & 2 deletions osu.Game.Rulesets.Catch/Objects/JuiceStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, I
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);

TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(StartTime);

double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * DifficultyControlPoint.SliderVelocity;

Velocity = scoringDistance / timingPoint.BeatLength;
TickDistance = scoringDistance / difficulty.SliderTickRate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Rulesets.Mania.Edit;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
Expand Down Expand Up @@ -101,27 +102,27 @@ public override SnapResult SnapScreenSpacePositionToValidPosition(Vector2 screen
throw new System.NotImplementedException();
}

public override float GetBeatSnapDistanceAt(double referenceTime)
public override float GetBeatSnapDistanceAt(HitObject referenceObject)
{
throw new System.NotImplementedException();
}

public override float DurationToDistance(double referenceTime, double duration)
public override float DurationToDistance(HitObject referenceObject, double duration)
{
throw new System.NotImplementedException();
}

public override double DistanceToDuration(double referenceTime, float distance)
public override double DistanceToDuration(HitObject referenceObject, float distance)
{
throw new System.NotImplementedException();
}

public override double GetSnappedDurationFromDistance(double referenceTime, float distance)
public override double GetSnappedDurationFromDistance(HitObject referenceObject, float distance)
{
throw new System.NotImplementedException();
}

public override float GetSnappedDistanceFromDistance(double referenceTime, float distance)
public override float GetSnappedDistanceFromDistance(HitObject referenceObject, float distance)
{
throw new System.NotImplementedException();
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Mania.Tests/TestSceneHoldNoteInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ private void performTest(List<ReplayFrame> frames, Beatmap<ManiaHitObject> beatm
},
};

beatmap.ControlPointInfo.Add(0, new DifficultyControlPoint { SpeedMultiplier = 0.1f });
beatmap.ControlPointInfo.Add(0, new EffectControlPoint { ScrollSpeed = 0.1f });
}

AddStep("load player", () =>
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Mania.Tests/TestSceneOutOfOrderHits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private void performTest(List<ManiaHitObject> hitObjects, List<ReplayFrame> fram
},
});

Beatmap.Value.Beatmap.ControlPointInfo.Add(0, new DifficultyControlPoint { SpeedMultiplier = 0.1f });
Beatmap.Value.Beatmap.ControlPointInfo.Add(0, new EffectControlPoint { ScrollSpeed = 0.1f });

var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ public DistanceObjectPatternGenerator(FastRandom random, HitObject hitObject, Ma
Debug.Assert(distanceData != null);

TimingControlPoint timingPoint = beatmap.ControlPointInfo.TimingPointAt(hitObject.StartTime);
DifficultyControlPoint difficultyPoint = beatmap.ControlPointInfo.DifficultyPointAt(hitObject.StartTime);
DifficultyControlPoint difficultyPoint = hitObject.DifficultyControlPoint;

double beatLength;
#pragma warning disable 618
if (difficultyPoint is LegacyBeatmapDecoder.LegacyDifficultyControlPoint legacyDifficultyPoint)
#pragma warning restore 618
beatLength = timingPoint.BeatLength * legacyDifficultyPoint.BpmMultiplier;
else
beatLength = timingPoint.BeatLength / difficultyPoint.SpeedMultiplier;
beatLength = timingPoint.BeatLength / difficultyPoint.SliderVelocity;

SpanCount = repeatsData?.SpanCount() ?? 1;
StartTime = (int)Math.Round(hitObject.StartTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SliderTickRate:1

[TimingPoints]
0,500,4,1,0,100,1,0
10000,-150,4,1,0,100,1,0

[HitObjects]
51,192,500,128,0,1500:1:0:0:0:
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private void load()

// For non-mania beatmap, speed changes should only happen through timing points
if (!isForCurrentRuleset)
p.DifficultyPoint = new DifficultyControlPoint();
p.EffectPoint = new EffectControlPoint();
}

BarLines.ForEach(Playfield.Add);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osu.Framework.Utils;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Beatmaps;
using osu.Game.Rulesets.Osu.Edit;
using osu.Game.Rulesets.Osu.Objects;
Expand Down Expand Up @@ -179,15 +180,15 @@ public SnapResult SnapScreenSpacePositionToValidPosition(Vector2 screenSpacePosi

public SnapResult SnapScreenSpacePositionToValidTime(Vector2 screenSpacePosition) => new SnapResult(screenSpacePosition, 0);

public float GetBeatSnapDistanceAt(double referenceTime) => (float)beat_length;
public float GetBeatSnapDistanceAt(HitObject referenceObject) => (float)beat_length;

public float DurationToDistance(double referenceTime, double duration) => (float)duration;
public float DurationToDistance(HitObject referenceObject, double duration) => (float)duration;

public double DistanceToDuration(double referenceTime, float distance) => distance;
public double DistanceToDuration(HitObject referenceObject, float distance) => distance;

public double GetSnappedDurationFromDistance(double referenceTime, float distance) => 0;
public double GetSnappedDurationFromDistance(HitObject referenceObject, float distance) => 0;

public float GetSnappedDistanceFromDistance(double referenceTime, float distance) => 0;
public float GetSnappedDistanceFromDistance(HitObject referenceObject, float distance) => 0;
}
}
}
8 changes: 5 additions & 3 deletions osu.Game.Rulesets.Osu.Tests/TestSceneGameplayCursor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public TestSceneGameplayCursor()
{
config.SetValue(OsuSetting.AutoCursorSize, true);
gameplayState.Beatmap.Difficulty.CircleSize = val;
Scheduler.AddOnce(() => loadContent(false));
Scheduler.AddOnce(loadContent);
});

AddStep("test cursor container", () => loadContent(false));
Expand All @@ -78,7 +78,7 @@ public void TestSizing(int circleSize, float userScale)
AddStep($"adjust cs to {circleSize}", () => gameplayState.Beatmap.Difficulty.CircleSize = circleSize);
AddStep("turn on autosizing", () => config.SetValue(OsuSetting.AutoCursorSize, true));

AddStep("load content", () => loadContent());
AddStep("load content", loadContent);

AddUntilStep("cursor size correct", () => lastContainer.ActiveCursor.Scale.X == OsuCursorContainer.GetScaleForCircleSize(circleSize) * userScale);

Expand All @@ -98,7 +98,9 @@ public void TestTopLeftOrigin()
AddStep("load content", () => loadContent(false, () => new SkinProvidingContainer(new TopLeftCursorSkin())));
}

private void loadContent(bool automated = true, Func<SkinProvidingContainer> skinProvider = null)
private void loadContent() => loadContent(false);

private void loadContent(bool automated, Func<SkinProvidingContainer> skinProvider = null)
{
SetContents(_ =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,6 @@ private void performTest(List<OsuHitObject> hitObjects, List<ReplayFrame> frames
},
});

Beatmap.Value.Beatmap.ControlPointInfo.Add(0, new DifficultyControlPoint { SpeedMultiplier = 0.1f });

SelectedMods.Value = new[] { new OsuModClassic() };

var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });
Expand Down Expand Up @@ -439,6 +437,8 @@ private class TestSlider : Slider
{
public TestSlider()
{
DifficultyControlPoint = new DifficultyControlPoint { SliderVelocity = 0.1f };

DefaultsApplied += _ =>
{
HeadCircle.HitWindows = new TestHitWindows();
Expand Down
11 changes: 8 additions & 3 deletions osu.Game.Rulesets.Osu.Tests/TestSceneSlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using osu.Game.Rulesets.Mods;
using System.Linq;
using NUnit.Framework;
using osu.Game.Beatmaps.Legacy;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Judgements;
Expand Down Expand Up @@ -328,10 +329,14 @@ private Drawable createCatmull(int repeats = 0)

private Drawable createDrawable(Slider slider, float circleSize, double speedMultiplier)
{
var cpi = new ControlPointInfo();
cpi.Add(0, new DifficultyControlPoint { SpeedMultiplier = speedMultiplier });
var cpi = new LegacyControlPointInfo();
cpi.Add(0, new DifficultyControlPoint { SliderVelocity = speedMultiplier });

slider.ApplyDefaults(cpi, new BeatmapDifficulty { CircleSize = circleSize, SliderTickRate = 3 });
slider.ApplyDefaults(cpi, new BeatmapDifficulty
{
CircleSize = circleSize,
SliderTickRate = 3
});

var drawable = CreateDrawableSlider(slider);

Expand Down
3 changes: 1 addition & 2 deletions osu.Game.Rulesets.Osu.Tests/TestSceneSliderInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ private void performTest(List<ReplayFrame> frames)
{
StartTime = time_slider_start,
Position = new Vector2(0, 0),
DifficultyControlPoint = new DifficultyControlPoint { SliderVelocity = 0.1f },
Path = new SliderPath(PathType.PerfectCurve, new[]
{
Vector2.Zero,
Expand All @@ -362,8 +363,6 @@ private void performTest(List<ReplayFrame> frames)
},
});

Beatmap.Value.Beatmap.ControlPointInfo.Add(0, new DifficultyControlPoint { SpeedMultiplier = 0.1f });

var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });

p.OnLoadComplete += _ =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,6 @@ private void performTest(List<OsuHitObject> hitObjects, List<ReplayFrame> frames
},
});

Beatmap.Value.Beatmap.ControlPointInfo.Add(0, new DifficultyControlPoint { SpeedMultiplier = 0.1f });

var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });

p.OnLoadComplete += _ =>
Expand Down Expand Up @@ -399,6 +397,8 @@ private class TestSlider : Slider
{
public TestSlider()
{
DifficultyControlPoint = new DifficultyControlPoint { SliderVelocity = 0.1f };

DefaultsApplied += _ =>
{
HeadCircle.HitWindows = new TestHitWindows();
Expand Down
3 changes: 2 additions & 1 deletion osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Threading;
using osu.Game.Rulesets.Osu.UI;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Game.Beatmaps.Legacy;

namespace osu.Game.Rulesets.Osu.Beatmaps
{
Expand Down Expand Up @@ -44,7 +45,7 @@ protected override IEnumerable<OsuHitObject> ConvertHitObject(HitObject original
LegacyLastTickOffset = (original as IHasLegacyLastTickOffset)?.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 <v8 maps for the same time duration.
TickDistanceMultiplier = beatmap.BeatmapInfo.BeatmapVersion < 8 ? 1f / beatmap.ControlPointInfo.DifficultyPointAt(original.StartTime).SpeedMultiplier : 1
TickDistanceMultiplier = beatmap.BeatmapInfo.BeatmapVersion < 8 ? 1f / ((LegacyControlPointInfo)beatmap.ControlPointInfo).DifficultyPointAt(original.StartTime).SliderVelocity : 1
}.Yield();

case IHasDuration endTimeData:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public OsuDifficultyHitObject(HitObject hitObject, HitObject lastLastObject, Hit

private void setDistances()
{
// We don't need to calculate either angle or distance when one of the last->curr objects is a spinner
if (BaseObject is Spinner || lastObject is Spinner)
return;

// We will scale distances by this factor, so we can assume a uniform CircleSize among beatmaps.
float scalingFactor = normalized_radius / (float)BaseObject.Radius;

Expand All @@ -71,11 +75,9 @@ private void setDistances()

Vector2 lastCursorPosition = getEndCursorPosition(lastObject);

// Don't need to jump to reach spinners
if (!(BaseObject is Spinner))
JumpDistance = (BaseObject.StackedPosition * scalingFactor - lastCursorPosition * scalingFactor).Length;
JumpDistance = (BaseObject.StackedPosition * scalingFactor - lastCursorPosition * scalingFactor).Length;

if (lastLastObject != null)
if (lastLastObject != null && !(lastLastObject is Spinner))
{
Vector2 lastLastCursorPosition = getEndCursorPosition(lastLastObject);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
using osu.Framework.Graphics;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components;
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components;
using osu.Game.Screens.Edit;
using osuTK;
using osuTK.Input;

Expand Down Expand Up @@ -67,6 +69,9 @@ protected override void LoadComplete()
inputManager = GetContainingInputManager();
}

[Resolved]
private EditorBeatmap editorBeatmap { get; set; }

public override void UpdateTimeAndPosition(SnapResult result)
{
base.UpdateTimeAndPosition(result);
Expand All @@ -75,6 +80,10 @@ public override void UpdateTimeAndPosition(SnapResult result)
{
case SliderPlacementState.Initial:
BeginPlacement();

var nearestDifficultyPoint = editorBeatmap.HitObjects.LastOrDefault(h => h.GetEndTime() < HitObject.StartTime)?.DifficultyControlPoint?.DeepClone() as DifficultyControlPoint;

HitObject.DifficultyControlPoint = nearestDifficultyPoint ?? new DifficultyControlPoint();
HitObject.Position = ToLocalSpace(result.ScreenSpacePosition);
break;

Expand Down Expand Up @@ -212,7 +221,7 @@ private bool canPlaceNewControlPoint([CanBeNull] out PathControlPoint lastPoint)

private void updateSlider()
{
HitObject.Path.ExpectedDistance.Value = composer?.GetSnappedDistanceFromDistance(HitObject.StartTime, (float)HitObject.Path.CalculatedDistance) ?? (float)HitObject.Path.CalculatedDistance;
HitObject.Path.ExpectedDistance.Value = composer?.GetSnappedDistanceFromDistance(HitObject, (float)HitObject.Path.CalculatedDistance) ?? (float)HitObject.Path.CalculatedDistance;

bodyPiece.UpdateFrom(HitObject);
headCirclePiece.UpdateFrom(HitObject.HeadCircle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private void removeControlPoints(List<PathControlPoint> toRemove)

private void updatePath()
{
HitObject.Path.ExpectedDistance.Value = composer?.GetSnappedDistanceFromDistance(HitObject.StartTime, (float)HitObject.Path.CalculatedDistance) ?? (float)HitObject.Path.CalculatedDistance;
HitObject.Path.ExpectedDistance.Value = composer?.GetSnappedDistanceFromDistance(HitObject, (float)HitObject.Path.CalculatedDistance) ?? (float)HitObject.Path.CalculatedDistance;
editorBeatmap?.Update(HitObject);
}

Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Osu/Edit/OsuDistanceSnapGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Osu.Edit
public class OsuDistanceSnapGrid : CircularDistanceSnapGrid
{
public OsuDistanceSnapGrid(OsuHitObject hitObject, [CanBeNull] OsuHitObject nextHitObject = null)
: base(hitObject.StackedEndPosition, hitObject.GetEndTime(), nextHitObject?.StartTime)
: base(hitObject, hitObject.StackedEndPosition, hitObject.GetEndTime(), nextHitObject?.StartTime)
{
Masking = true;
}
Expand Down
Loading

0 comments on commit 80827b7

Please sign in to comment.