Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
1beb3f5
Add failing test coverage of fast streams not working in editor
peppy Jan 4, 2024
65c29b4
Make editor remain frame stable during normal playback
peppy Jan 4, 2024
3419c59
Fix failing tests due to frame stable seeks taking longer
peppy Jan 4, 2024
adac3b6
Fix beatmap carousel not preloading panels when off-screen
peppy Jan 4, 2024
81c6fd5
Load items closer to the centre of the screen as a priority
peppy Jan 4, 2024
9b734ba
Allow track control after intro screen finishes.
zacwm Jan 4, 2024
91bb3f6
Cache argon character glyph lookups to reduce string allocations
peppy Jan 4, 2024
5b55ca6
Cache legacy skin character glyph lookups to reduce string allocations
peppy Jan 4, 2024
e9289cf
Reduce precision of audio balance adjustments during slider sliding
peppy Jan 4, 2024
0912416
Make IntroScreen set `AllowTrackControl` to false instead
zacwm Jan 5, 2024
8295ad1
Change catch scoring to match score V2
bdach Jan 2, 2024
ea7078f
Implement approximate score conversion algorithm matching score V2
bdach Jan 3, 2024
e2769db
Attempt at creating a test.
zacwm Jan 6, 2024
14a4337
Fix overall ranking text overlapping at some aspect ratios
peppy Jan 6, 2024
d3710f0
Remove scores from song select leaderboard when leaving the screen
peppy Jan 6, 2024
b809d4c
Remove delegate overhead from argon health display's animation updates
peppy Jan 4, 2024
9d9e6fc
Remove LINQ calls in hot paths
peppy Jan 4, 2024
35eff63
Remove unnecessary second iteration over `NestedHitObjects`
peppy Jan 4, 2024
5cc4a58
Avoid iteration over `NestedHitObjects` in silder's `Update` unless n…
peppy Jan 4, 2024
16ea7f9
Avoid completely unnecessary string allocations in `ArgonCounterTextC…
peppy Jan 7, 2024
dc31c66
Return null on font lookup failure instead of asserting
peppy Jan 7, 2024
962c8ba
Reset child anchor position cache on hitobject position change
peppy Jan 7, 2024
7b663a2
Fix score conversion incorrectly assuming zero combo score in certain…
bdach Jan 8, 2024
991c6d2
Merge pull request #26410 from peppy/ranking-leaderboard-whiz
bdach Jan 8, 2024
3e9d222
Merge pull request #26409 from peppy/overall-ranking-overlap
bdach Jan 8, 2024
50eba9e
Reduce code duplication in test
bdach Jan 8, 2024
b869be2
Fix typo
bdach Jan 8, 2024
b6ce57b
Use override that was intended to steer global track control rather t…
bdach Jan 8, 2024
5337d99
Merge branch 'master' into disable-intro-track-pause
bdach Jan 8, 2024
bd4b20c
Merge pull request #26411 from zacwm/disable-intro-track-pause
bdach Jan 8, 2024
8c82bb0
Fix mania score conversion using score V1 accuracy
bdach Jan 8, 2024
e77d203
Refactor delayed load logic to hopefully read better
peppy Jan 8, 2024
51bd32b
Restore comment regarding usage of `MinBy`
peppy Jan 8, 2024
70ba5dd
Merge pull request #26385 from peppy/carousel-thing
bdach Jan 8, 2024
c4ac530
Remove loop in combo score loss estimation calculation
bdach Jan 8, 2024
8a87301
Add test for crashing scenario
bdach Jan 8, 2024
58db39e
Fix crash when clicking osu! logo in song select immediately after ex…
bdach Jan 8, 2024
67df7b3
Add failing test coverage for not attempting to upgrade custom rulese…
bdach Jan 8, 2024
388f659
Add failing test for not attempting to upgrade non-legacy scores
bdach Jan 8, 2024
aa83b84
Fix Cinema mod being compatible with mods that can force failure
bdach Jan 8, 2024
4f7dcb3
Do not attempt to recalculate non-legacy scores or scores set on cust…
bdach Jan 8, 2024
58619f1
Fix wiki main page not displaying custom layout
Joehuu Jan 8, 2024
d6ba7a9
Centralise `INDEX_PATH` to `WikiOverlay`
Joehuu Jan 8, 2024
b03813d
Update casing of hardcoded "Main_page" string in tests
Joehuu Jan 8, 2024
55eebf6
Merge pull request #26438 from bdach/mod-fail-condition-cinema
peppy Jan 9, 2024
06447e9
Merge pull request #26439 from bdach/do-not-attempt-score-upgrade-for…
peppy Jan 9, 2024
7d57a66
Use main page constant in more places
peppy Jan 9, 2024
172fe53
Use better method of ignore case comparison
peppy Jan 9, 2024
3cdc3b5
Merge branch 'master' into fix-wiki-main-page-layout
peppy Jan 9, 2024
743411d
Merge pull request #26440 from bdach/incorrect-combo-proportion
peppy Jan 9, 2024
6f8a3e1
Merge pull request #26382 from peppy/editor-more-frame-stable
peppy Jan 9, 2024
3f5899d
Fix incorrect implementation of wireframe digits
peppy Jan 9, 2024
765d41f
Change second occurrence of debug.assert with early return for fallba…
peppy Jan 9, 2024
5970a68
Use invalidation based logic for child anchor position updpates in `D…
peppy Jan 9, 2024
79ff767
Remove unused using
peppy Jan 9, 2024
f376bb5
Merge pull request #26441 from Joehuu/fix-wiki-main-page-layout
peppy Jan 9, 2024
19d1fff
Use native query to avoid huge overheads when cleaning up realm files
peppy Jan 9, 2024
1837b31
Remove usage of `HealthDisplay.BindValueChanged`
peppy Jan 9, 2024
d83b8db
Refactor `ArgonHealthDisplay` to user interpolation and less bindable…
peppy Jan 9, 2024
f1b4c30
Change skinnable health test scene to drain
peppy Jan 9, 2024
b3533d2
Remove delegate overhead of `HealthBarValue`/`GlowBarValue`
peppy Jan 9, 2024
12a59eb
Remove vertex update overheads
peppy Jan 9, 2024
b6505ba
Reduce colour tween overhead and mark other calls of concern
peppy Jan 9, 2024
80892f3
Fix misses not displaying properly
peppy Jan 9, 2024
9c7e555
Fix initial animation not playing correctly
peppy Jan 9, 2024
6ac1c79
Fix `SettingsToolboxGroup` allocating excessively due to missing cach…
peppy Jan 9, 2024
66b3945
Move current screen check to better place
bdach Jan 9, 2024
cac0b0d
Remove unused using directive
bdach Jan 9, 2024
8324b75
Merge pull request #26437 from bdach/song-select-logo-crash
peppy Jan 9, 2024
a8a70be
Reference property via `nameof` rather than hardcoding
bdach Jan 9, 2024
4110adc
Fix missing wireframe on argon combo counter
peppy Jan 9, 2024
393d101
Merge branch 'master' into realm-cleanup-overheads-fix
bdach Jan 9, 2024
77bf6e3
Fix missing wireframe behind "x" sign on combo counter display
bdach Jan 9, 2024
92ba770
Fix missing wireframe behind percent sign on accuracy counter
bdach Jan 9, 2024
0069460
Merge pull request #26451 from peppy/realm-cleanup-overheads-fix
bdach Jan 9, 2024
8110c99
Merge branch 'master' into allocs-off-the-charts
bdach Jan 9, 2024
a252235
Merge pull request #26456 from peppy/fix-missing-validation
bdach Jan 9, 2024
eec9b68
Merge pull request #26434 from bdach/mania-conversion-accuracy
peppy Jan 9, 2024
00a4c05
Merge branch 'master' into catch-scoring
bdach Jan 9, 2024
8e133ed
Merge pull request #26422 from peppy/allocs-off-the-charts
bdach Jan 9, 2024
a4c9e9f
Merge pull request #26405 from bdach/catch-scoring
peppy Jan 9, 2024
f912a1b
Merge branch 'master' into health-less-value-changed
peppy Jan 10, 2024
9167715
Update framework
peppy Jan 10, 2024
49d13cd
Fix failing test by setting health on source of truth
peppy Jan 10, 2024
7d5e8ff
Merge pull request #26467 from peppy/update-framework
bdach Jan 10, 2024
c2706ca
Also show drain on argon health display test
peppy Jan 10, 2024
5d6f767
Reduce excessive `Color4` allocations during path colour updates
peppy Jan 10, 2024
861080d
Move simulated drain to separate test case
bdach Jan 11, 2024
600e4b6
Adjust skinnable health display test scene for usability
bdach Jan 11, 2024
b65d3ba
Merge branch 'master' into health-less-value-changed
bdach Jan 11, 2024
da29faf
Merge pull request #26455 from peppy/health-less-value-changed
bdach Jan 11, 2024
16ec602
add log1p, erf, erfinv and nelder mead simplex methods to remove math…
tsunyoku Jan 11, 2024
9353f0d
add `NormalPdf` to `StatUtils`
tsunyoku Jan 11, 2024
dbb1512
add MathNet license where necessary
tsunyoku Jan 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osu.Android.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework.Android" Version="2023.1227.1" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2024.110.0" />
</ItemGroup>
<PropertyGroup>
<!-- Fody does not handle Android build well, and warns when unchanged.
Expand Down
60 changes: 57 additions & 3 deletions osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Collections.Generic;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
Expand All @@ -20,20 +21,73 @@ public partial class CatchScoreProcessor : ScoreProcessor
private const int combo_cap = 200;
private const double combo_base = 4;

private double fruitTinyScale;

public CatchScoreProcessor()
: base(new CatchRuleset())
{
}

protected override void Reset(bool storeResults)
{
base.Reset(storeResults);

// large ticks are *purposefully* not counted to match stable
int fruitTinyScaleDivisor = MaximumResultCounts.GetValueOrDefault(HitResult.SmallTickHit) + MaximumResultCounts.GetValueOrDefault(HitResult.Great);
fruitTinyScale = fruitTinyScaleDivisor == 0
? 0
: (double)MaximumResultCounts.GetValueOrDefault(HitResult.SmallTickHit) / fruitTinyScaleDivisor;
}

protected override double ComputeTotalScore(double comboProgress, double accuracyProgress, double bonusPortion)
{
return 600000 * comboProgress
+ 400000 * Accuracy.Value * accuracyProgress
const int max_tiny_droplets_portion = 400000;

double comboPortion = 1000000 - max_tiny_droplets_portion + max_tiny_droplets_portion * (1 - fruitTinyScale);
double dropletsPortion = max_tiny_droplets_portion * fruitTinyScale;
double dropletsHit = MaximumResultCounts.GetValueOrDefault(HitResult.SmallTickHit) == 0
? 0
: (double)ScoreResultCounts.GetValueOrDefault(HitResult.SmallTickHit) / MaximumResultCounts.GetValueOrDefault(HitResult.SmallTickHit);

return comboPortion * comboProgress
+ dropletsPortion * dropletsHit
+ bonusPortion;
}

public override int GetBaseScoreForResult(HitResult result)
{
switch (result)
{
// dirty hack to emulate accuracy on stable weighting every object equally in accuracy portion
case HitResult.Great:
case HitResult.LargeTickHit:
case HitResult.SmallTickHit:
return 300;

case HitResult.LargeBonus:
return 200;
}

return base.GetBaseScoreForResult(result);
}

protected override double GetComboScoreChange(JudgementResult result)
=> GetBaseScoreForResult(result.Type) * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base));
{
double baseIncrease = 0;

switch (result.Type)
{
case HitResult.Great:
baseIncrease = 300;
break;

case HitResult.LargeTickHit:
baseIncrease = 100;
break;
}

return baseIncrease * Math.Min(Math.Max(0.5, Math.Log(result.ComboAfterJudgement, combo_base)), Math.Log(combo_cap, combo_base));
}

public override ScoreRank RankFromAccuracy(double accuracy)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using NUnit.Framework;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Tests.Beatmaps;
using osu.Game.Tests.Visual;

namespace osu.Game.Rulesets.Osu.Tests.Editor
{
/// <summary>
/// This test covers autoplay working correctly in the editor on fast streams.
/// Might seem like a weird test, but frame stability being toggled can cause autoplay to operation incorrectly.
/// This is clearly a bug with the autoplay algorithm, but is worked around at an editor level for now.
/// </summary>
public partial class TestSceneEditorAutoplayFastStreams : EditorTestScene
{
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset)
{
var testBeatmap = new TestBeatmap(ruleset, false);
testBeatmap.HitObjects.AddRange(new[]
{
new HitCircle { StartTime = 500 },
new HitCircle { StartTime = 530 },
new HitCircle { StartTime = 560 },
new HitCircle { StartTime = 590 },
new HitCircle { StartTime = 620 },
});

return testBeatmap;
}

protected override Ruleset CreateEditorRuleset() => new OsuRuleset();

[Test]
public void TestAllHit()
{
AddStep("start playback", () => EditorClock.Start());
AddUntilStep("wait for all hit", () =>
{
DrawableHitCircle[] hitCircles = Editor.ChildrenOfType<DrawableHitCircle>().OrderBy(s => s.HitObject.StartTime).ToArray();

return hitCircles.Length == 5 && hitCircles.All(h => h.IsHit);
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ public void TestSelectAfterFadedOut()
moveMouseToObject(() => slider);

AddStep("seek after end", () => EditorClock.Seek(750));
AddUntilStep("wait for seek", () => !EditorClock.IsSeeking);
AddStep("left click", () => InputManager.Click(MouseButton.Left));
AddAssert("slider not selected", () => EditorBeatmap.SelectedHitObjects.Count == 0);

AddStep("seek to visible", () => EditorClock.Seek(650));
AddUntilStep("wait for seek", () => !EditorClock.IsSeeking);
AddStep("left click", () => InputManager.Click(MouseButton.Left));
AddUntilStep("slider selected", () => EditorBeatmap.SelectedHitObjects.Single() == slider);
}
Expand Down
21 changes: 12 additions & 9 deletions osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Layout;
using osu.Game.Audio;
using osu.Game.Graphics.Containers;
using osu.Game.Rulesets.Objects;
Expand Down Expand Up @@ -66,6 +67,8 @@ public partial class DrawableSlider : DrawableOsuHitObject
private Container<DrawableSliderRepeat> repeatContainer;
private PausableSkinnableSound slidingSample;

private readonly LayoutValue drawSizeLayout;

public DrawableSlider()
: this(null)
{
Expand All @@ -82,6 +85,7 @@ public DrawableSlider([CanBeNull] Slider s = null)
AlwaysPresent = true,
Alpha = 0
};
AddLayout(drawSizeLayout = new LayoutValue(Invalidation.DrawSize | Invalidation.MiscGeometry));
}

[BackgroundDependencyLoader]
Expand Down Expand Up @@ -246,21 +250,20 @@ protected override void Update()
Ball.UpdateProgress(completionProgress);
SliderBody?.UpdateProgress(HeadCircle.IsHit ? completionProgress : 0);

foreach (DrawableHitObject hitObject in NestedHitObjects)
{
if (hitObject is ITrackSnaking s)
s.UpdateSnakingPosition(HitObject.Path.PositionAt(SliderBody?.SnakedStart ?? 0), HitObject.Path.PositionAt(SliderBody?.SnakedEnd ?? 0));
}
foreach (DrawableSliderRepeat repeat in repeatContainer)
repeat.UpdateSnakingPosition(HitObject.Path.PositionAt(SliderBody?.SnakedStart ?? 0), HitObject.Path.PositionAt(SliderBody?.SnakedEnd ?? 0));

Size = SliderBody?.Size ?? Vector2.Zero;
OriginPosition = SliderBody?.PathOffset ?? Vector2.Zero;

if (DrawSize != Vector2.Zero)
if (!drawSizeLayout.IsValid)
{
var childAnchorPosition = Vector2.Divide(OriginPosition, DrawSize);
Vector2 pos = Vector2.Divide(OriginPosition, DrawSize);
foreach (var obj in NestedHitObjects)
obj.RelativeAnchorPosition = childAnchorPosition;
Ball.RelativeAnchorPosition = childAnchorPosition;
obj.RelativeAnchorPosition = pos;
Ball.RelativeAnchorPosition = pos;

drawSizeLayout.Validate();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
public partial class DrawableSliderRepeat : DrawableOsuHitObject, ITrackSnaking
public partial class DrawableSliderRepeat : DrawableOsuHitObject
{
public new SliderRepeat HitObject => (SliderRepeat)base.HitObject;

Expand Down
15 changes: 0 additions & 15 deletions osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs

This file was deleted.

55 changes: 55 additions & 0 deletions osu.Game.Tests/Database/BackgroundDataStoreProcessorTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
Expand Down Expand Up @@ -182,9 +183,63 @@ public void TestScoreUpgradeFailed()
AddAssert("Score version not upgraded", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.TotalScoreVersion), () => Is.EqualTo(30000002));
}

[Test]
public void TestCustomRulesetScoreNotSubjectToUpgrades([Values] bool available)
{
RulesetInfo rulesetInfo = null!;
ScoreInfo scoreInfo = null!;
TestBackgroundDataStoreProcessor processor = null!;

AddStep("Add unavailable ruleset", () => Realm.Write(r => r.Add(rulesetInfo = new RulesetInfo
{
ShortName = Guid.NewGuid().ToString(),
Available = available
})));

AddStep("Add score for unavailable ruleset", () => Realm.Write(r => r.Add(scoreInfo = new ScoreInfo(
ruleset: rulesetInfo,
beatmap: r.All<BeatmapInfo>().First())
{
TotalScoreVersion = 30000001
})));

AddStep("Run background processor", () => Add(processor = new TestBackgroundDataStoreProcessor()));
AddUntilStep("Wait for completion", () => processor.Completed);

AddAssert("Score not marked as failed", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.BackgroundReprocessingFailed), () => Is.False);
AddAssert("Score version not upgraded", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.TotalScoreVersion), () => Is.EqualTo(30000001));
}

[Test]
public void TestNonLegacyScoreNotSubjectToUpgrades()
{
ScoreInfo scoreInfo = null!;
TestBackgroundDataStoreProcessor processor = null!;

AddStep("Add score which requires upgrade (and has beatmap)", () =>
{
Realm.Write(r =>
{
r.Add(scoreInfo = new ScoreInfo(ruleset: r.All<RulesetInfo>().First(), beatmap: r.All<BeatmapInfo>().First())
{
TotalScoreVersion = 30000005,
LegacyTotalScore = 123456,
});
});
});

AddStep("Run background processor", () => Add(processor = new TestBackgroundDataStoreProcessor()));
AddUntilStep("Wait for completion", () => processor.Completed);

AddAssert("Score not marked as failed", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.BackgroundReprocessingFailed), () => Is.False);
AddAssert("Score version not upgraded", () => Realm.Run(r => r.Find<ScoreInfo>(scoreInfo.ID)!.TotalScoreVersion), () => Is.EqualTo(30000005));
}

public partial class TestBackgroundDataStoreProcessor : BackgroundDataStoreProcessor
{
protected override int TimeToSleepDuringGameplay => 10;

public bool Completed => ProcessingTask.IsCompleted;
}
}
}
11 changes: 11 additions & 0 deletions osu.Game.Tests/Visual/Gameplay/TestSceneArgonHealthDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Testing;
using osu.Framework.Threading;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Judgements;
Expand Down Expand Up @@ -159,5 +160,15 @@ private void applyPerfectHit()
Type = HitResult.Perfect
});
}

[Test]
public void TestSimulateDrain()
{
ScheduledDelegate del = null!;

AddStep("simulate drain", () => del = Scheduler.AddDelayed(() => healthProcessor.Health.Value -= 0.00025f * Time.Elapsed, 0, true));
AddUntilStep("wait until zero", () => healthProcessor.Health.Value == 0);
AddStep("cancel drain", () => del.Cancel());
}
}
}
Loading