From 50ed30724a5b56e6b722e9d9ec020e2ad7168f2a Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Fri, 24 Nov 2023 17:07:07 +0100 Subject: [PATCH 1/5] Weigh slides more heavily in scoring --- .../Objects/SentakkiLanedHitObject.cs | 24 ++++++++++++------- .../Objects/SlideBody.cs | 2 ++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs b/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs index 3f18b841a..add558265 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs @@ -13,6 +13,8 @@ public abstract class SentakkiLanedHitObject : SentakkiHitObject public readonly BindableBool BreakBindable = new BindableBool(); + protected virtual int ScoreWeightingMultiplier => 1; + public bool Break { get => BreakBindable.Value; @@ -31,17 +33,23 @@ protected override void CreateNestedHitObjects(CancellationToken cancellationTok { base.CreateNestedHitObjects(cancellationToken); - if (Break) + for (int j = 0; j < ScoreWeightingMultiplier; ++j) { - for (int i = 0; i < 4; ++i) - AddNested(new ScorePaddingObject { StartTime = this.GetEndTime() }); + if (j > 0) + AddNested(new ScorePaddingObject { StartTime = this.GetEndTime() }); //Add more weight - // Add bonus for players hitting within the critical window - AddNested(new ScoreBonusObject + if (Break) { - StartTime = this.GetEndTime(), - HitWindows = HitWindows - }); + for (int i = 0; i < 4; ++i) + AddNested(new ScorePaddingObject { StartTime = this.GetEndTime() }); + + // Add bonus for players hitting within the critical window + AddNested(new ScoreBonusObject + { + StartTime = this.GetEndTime(), + HitWindows = HitWindows + }); + } } } diff --git a/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs b/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs index ae786876f..b7f4977bf 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs @@ -19,6 +19,8 @@ public class SlideBody : SentakkiLanedHitObject, IHasDuration { public override Color4 DefaultNoteColour => Color4.Aqua; + protected override int ScoreWeightingMultiplier => 3; + public double EndTime { get => StartTime + Duration; From d4a16a10bc8d2939d7a0f56d39a1e03dbae5f1a9 Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Fri, 24 Nov 2023 18:14:09 +0100 Subject: [PATCH 2/5] Don't weight break slides *that* high --- .../Objects/SentakkiHitObject.cs | 2 ++ .../Objects/SentakkiLanedHitObject.cs | 27 +++++++------------ .../Objects/SlideBody.cs | 3 ++- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs b/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs index 1c3efbd97..1a0364d03 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs @@ -25,6 +25,8 @@ protected SentakkiHitObject() public override Judgement CreateJudgement() => new SentakkiJudgement(); + public virtual int ScoreWeighting => 1; + [JsonIgnore] public Bindable ColourBindable = new Bindable(); diff --git a/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs b/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs index add558265..6ac9466d9 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs @@ -11,9 +11,9 @@ public abstract class SentakkiLanedHitObject : SentakkiHitObject { protected virtual bool NeedBreakSample => true; - public readonly BindableBool BreakBindable = new BindableBool(); + public override int ScoreWeighting => Break ? 5 : 1; - protected virtual int ScoreWeightingMultiplier => 1; + public readonly BindableBool BreakBindable = new BindableBool(); public bool Break { @@ -33,24 +33,15 @@ protected override void CreateNestedHitObjects(CancellationToken cancellationTok { base.CreateNestedHitObjects(cancellationToken); - for (int j = 0; j < ScoreWeightingMultiplier; ++j) - { - if (j > 0) - AddNested(new ScorePaddingObject { StartTime = this.GetEndTime() }); //Add more weight + for (int i = 1; i < ScoreWeighting; ++i) + AddNested(new ScorePaddingObject { StartTime = this.GetEndTime() }); - if (Break) + if (Break) + AddNested(new ScoreBonusObject { - for (int i = 0; i < 4; ++i) - AddNested(new ScorePaddingObject { StartTime = this.GetEndTime() }); - - // Add bonus for players hitting within the critical window - AddNested(new ScoreBonusObject - { - StartTime = this.GetEndTime(), - HitWindows = HitWindows - }); - } - } + StartTime = this.GetEndTime(), + HitWindows = HitWindows + }); } public override IList AuxiliarySamples => CreateBreakSample(); diff --git a/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs b/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs index b7f4977bf..5ec41df42 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SlideBody.cs @@ -19,7 +19,7 @@ public class SlideBody : SentakkiLanedHitObject, IHasDuration { public override Color4 DefaultNoteColour => Color4.Aqua; - protected override int ScoreWeightingMultiplier => 3; + public override int ScoreWeighting => Break ? 5 : 3; public double EndTime { @@ -44,6 +44,7 @@ public SlideBody(SlideBodyInfo slideBodyInfo) protected override void CreateNestedHitObjects(CancellationToken cancellationToken) { CreateSlideCheckpoints(); + if (NestedHitObjects.Any()) NestedHitObjects.First().Samples.Add(new SentakkiHitSampleInfo("slide", CreateHitSampleInfo().Volume)); From ccb79da074f62051e17295d1d0fd828772c5f673 Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Sun, 26 Nov 2023 13:14:07 +0100 Subject: [PATCH 3/5] ScoreMultiplier only applies to laned notes No need to put the property in the base object if it is not needed --- osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs | 2 -- osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs b/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs index 1a0364d03..1c3efbd97 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SentakkiHitObject.cs @@ -25,8 +25,6 @@ protected SentakkiHitObject() public override Judgement CreateJudgement() => new SentakkiJudgement(); - public virtual int ScoreWeighting => 1; - [JsonIgnore] public Bindable ColourBindable = new Bindable(); diff --git a/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs b/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs index 6ac9466d9..22ea1d32f 100644 --- a/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs +++ b/osu.Game.Rulesets.Sentakki/Objects/SentakkiLanedHitObject.cs @@ -11,7 +11,7 @@ public abstract class SentakkiLanedHitObject : SentakkiHitObject { protected virtual bool NeedBreakSample => true; - public override int ScoreWeighting => Break ? 5 : 1; + public virtual int ScoreWeighting => Break ? 5 : 1; public readonly BindableBool BreakBindable = new BindableBool(); From 7caff8417c00cc231d8efa74b1a4991aa562e580 Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Sun, 26 Nov 2023 16:08:46 +0100 Subject: [PATCH 4/5] Count slide taps properly in beatmap stats --- .../Beatmaps/SentakkiBeatmap.cs | 5 ++-- .../SentakkiDifficultyCalculator.cs | 25 +------------------ 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/osu.Game.Rulesets.Sentakki/Beatmaps/SentakkiBeatmap.cs b/osu.Game.Rulesets.Sentakki/Beatmaps/SentakkiBeatmap.cs index 2bdce41a1..035b7b403 100644 --- a/osu.Game.Rulesets.Sentakki/Beatmaps/SentakkiBeatmap.cs +++ b/osu.Game.Rulesets.Sentakki/Beatmaps/SentakkiBeatmap.cs @@ -5,7 +5,6 @@ using osu.Game.Graphics; using osu.Game.Rulesets.Sentakki.Localisation; using osu.Game.Rulesets.Sentakki.Objects; -using osu.Game.Rulesets.UI; using osuTK; namespace osu.Game.Rulesets.Sentakki.Beatmaps @@ -14,11 +13,11 @@ public class SentakkiBeatmap : Beatmap { public override IEnumerable GetStatistics() { - int taps = HitObjects.Count(b => b is Tap); + int taps = HitObjects.Count(b => b is Tap or Slide); int holds = HitObjects.Count(h => h is Hold); int touchHolds = HitObjects.Count(h => h is TouchHold); int touchs = HitObjects.Count(h => h is Touch); - int slides = HitObjects.Count(h => h is Slide); + int slides = HitObjects.OfType().Sum(h => h.SlideInfoList.Count); return new[] { diff --git a/osu.Game.Rulesets.Sentakki/Difficulty/SentakkiDifficultyCalculator.cs b/osu.Game.Rulesets.Sentakki/Difficulty/SentakkiDifficultyCalculator.cs index 3a79ee75a..8ff9f20b0 100644 --- a/osu.Game.Rulesets.Sentakki/Difficulty/SentakkiDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Sentakki/Difficulty/SentakkiDifficultyCalculator.cs @@ -5,7 +5,6 @@ using osu.Game.Rulesets.Difficulty.Preprocessing; using osu.Game.Rulesets.Difficulty.Skills; using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.Sentakki.Objects; namespace osu.Game.Rulesets.Sentakki.Difficulty { @@ -18,29 +17,7 @@ public SentakkiDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap beatma protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beatmap, Mod[] mods, Skill[] skills, double clockRate) { - int maxCombo = 0; - - foreach (SentakkiHitObject h in beatmap.HitObjects) - { - switch (h) - { - case Slide slide: - maxCombo += 1 + slide.SlideInfoList.Count + (slide.Break ? 4 : 0); - break; - - case Hold hold: - maxCombo += 2 + (hold.Break ? 8 : 0); - break; - - case Tap tap: - maxCombo += 1 + (tap.Break ? 4 : 0); - break; - - default: - ++maxCombo; - break; - } - } + int maxCombo = beatmap.GetMaxCombo(); return new DifficultyAttributes { From 4b2cf89daf343014c8710cd0d6d25d024520183a Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Thu, 30 Nov 2023 11:18:21 +0100 Subject: [PATCH 5/5] Fix tests --- .../Objects/TestSceneSlideFan.cs | 2 +- .../Objects/TestSceneSlideNote.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs index a52f5b546..a48fd0c4f 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideFan.cs @@ -76,7 +76,7 @@ private void testSingle(double duration, bool auto = false) foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects) { - foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects) + foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects.OfType()) nested2.Auto = auto; } } diff --git a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs index 5633f6e46..8e0ed20fe 100644 --- a/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs +++ b/osu.Game.Rulesets.Sentakki.Tests/Objects/TestSceneSlideNote.cs @@ -99,7 +99,7 @@ private void testSingle(double duration, bool auto = false) foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects) { - foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects) + foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects.OfType()) nested2.Auto = auto; } } @@ -140,7 +140,7 @@ private void testChain(double duration, bool auto = false) foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects) { - foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects) + foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects.OfType()) nested2.Auto = auto; } } @@ -182,7 +182,7 @@ private void testChainWithFan(double duration, bool auto = false) foreach (DrawableSentakkiHitObject nested in dSlide.NestedHitObjects) { - foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects) + foreach (DrawableSentakkiHitObject nested2 in nested.NestedHitObjects.OfType()) nested2.Auto = auto; } }