From e9ec544bf65b929450c4bcd18a4ad63fe14207cb Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 3 Apr 2018 02:04:40 +0900 Subject: [PATCH 1/9] Implement joystick keybindings --- osu-framework | 2 +- osu.Game/Overlays/KeyBinding/KeyBindingRow.cs | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 85b3494117..3388ae24ba 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 85b3494117ccef1b396b70957e1cffaba06e2b54 +Subproject commit 3388ae24ba5cc75fc966ab1531f44701e74588a9 diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs index 379d25313e..81f24d2661 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs @@ -223,6 +223,26 @@ namespace osu.Game.Overlays.KeyBinding return true; } + protected override bool OnJoystickPress(InputState state, JoystickPressEventArgs args) + { + if (!HasFocus) + return false; + + bindTarget.UpdateKeyCombination(KeyCombination.FromInputState(state)); + finalise(); + + return true; + } + + protected override bool OnJoystickRelease(InputState state, JoystickReleaseEventArgs args) + { + if (!HasFocus) + return base.OnJoystickRelease(state, args); + + finalise(); + return true; + } + private void finalise() { if (bindTarget != null) From c39fb9a200712423e0656ba2ac2170748819ec4b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 3 Apr 2018 20:10:26 +0900 Subject: [PATCH 2/9] Update with framework changes --- osu.Game/Overlays/KeyBinding/KeyBindingRow.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs index 81f24d2661..9cf43c2bde 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs @@ -223,7 +223,7 @@ namespace osu.Game.Overlays.KeyBinding return true; } - protected override bool OnJoystickPress(InputState state, JoystickPressEventArgs args) + protected override bool OnJoystickPress(InputState state, Framework.Input.JoystickEventArgs args) { if (!HasFocus) return false; @@ -234,7 +234,7 @@ namespace osu.Game.Overlays.KeyBinding return true; } - protected override bool OnJoystickRelease(InputState state, JoystickReleaseEventArgs args) + protected override bool OnJoystickRelease(InputState state, Framework.Input.JoystickEventArgs args) { if (!HasFocus) return base.OnJoystickRelease(state, args); From 8ca67f63ece8c3469557ebe6278f67e22d6f5a57 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 11 May 2018 20:31:57 +0900 Subject: [PATCH 3/9] Fix score statistics not being read --- .../Scoring/Legacy/LegacyScoreParser.cs | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreParser.cs b/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreParser.cs index d5ab856697..1cc30afe7b 100644 --- a/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreParser.cs +++ b/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreParser.cs @@ -49,18 +49,21 @@ namespace osu.Game.Rulesets.Scoring.Legacy score.User = new User { Username = sr.ReadString() }; /* var localScoreChecksum = */ sr.ReadString(); - /* score.Count300 = */ - sr.ReadUInt16(); - /* score.Count100 = */ - sr.ReadUInt16(); - /* score.Count50 = */ - sr.ReadUInt16(); - /* score.CountGeki = */ - sr.ReadUInt16(); - /* score.CountKatu = */ - sr.ReadUInt16(); - /* score.CountMiss = */ - sr.ReadUInt16(); + + var count300 = sr.ReadUInt16(); + var count100 = sr.ReadUInt16(); + var count50 = sr.ReadUInt16(); + var countGeki = sr.ReadUInt16(); + var countKatu = sr.ReadUInt16(); + var countMiss = sr.ReadUInt16(); + + score.Statistics[HitResult.Great] = count300; + score.Statistics[HitResult.Good] = count100; + score.Statistics[HitResult.Meh] = count50; + score.Statistics[HitResult.Perfect] = countGeki; + score.Statistics[HitResult.Ok] = countKatu; + score.Statistics[HitResult.Miss] = countMiss; + score.TotalScore = sr.ReadInt32(); score.MaxCombo = sr.ReadUInt16(); /* score.Perfect = */ From 7e7a5f8964972a045cf4f6ef2f47332937a49f82 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 11 May 2018 20:32:06 +0900 Subject: [PATCH 4/9] Fix score accuracy not being populated --- .../Scoring/Legacy/LegacyScoreParser.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreParser.cs b/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreParser.cs index 1cc30afe7b..38873c4df1 100644 --- a/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreParser.cs +++ b/osu.Game/Rulesets/Scoring/Legacy/LegacyScoreParser.cs @@ -84,6 +84,34 @@ namespace osu.Game.Rulesets.Scoring.Legacy /*OnlineId =*/ sr.ReadInt32(); + switch (score.Ruleset.ID) + { + case 0: + { + int totalHits = count50 + count100 + count300 + countMiss; + score.Accuracy = totalHits > 0 ? (double)(count50 * 50 + count100 * 100 + count300 * 300) / (totalHits * 300) : 1; + break; + } + case 1: + { + int totalHits = count50 + count100 + count300 + countMiss; + score.Accuracy = totalHits > 0 ? (double)(count100 * 150 + count300 * 300) / (totalHits * 300) : 1; + break; + } + case 2: + { + int totalHits = count50 + count100 + count300 + countMiss + countKatu; + score.Accuracy = totalHits > 0 ? (double)(count50 + count100 + count300 ) / totalHits : 1; + break; + } + case 3: + { + int totalHits = count50 + count100 + count300 + countMiss + countGeki + countKatu; + score.Accuracy = totalHits > 0 ? (double)(count50 * 50 + count100 * 100 + countKatu * 200 + (count300 + countGeki) * 300) / (totalHits * 300) : 1; + break; + } + } + using (var replayInStream = new MemoryStream(compressedReplay)) { byte[] properties = new byte[5]; From 224f1a0810f75b6d292ee49fa0d0a0c02be60579 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 11 May 2018 21:48:10 +0900 Subject: [PATCH 5/9] Fix incorrect osu! difficulty calculator combo count --- osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs index 6b9214d9dc..103fdeadea 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs @@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Osu.Scoring countHitCircles = Beatmap.HitObjects.Count(h => h is HitCircle); beatmapMaxCombo = Beatmap.HitObjects.Count(); - beatmapMaxCombo += Beatmap.HitObjects.OfType().Sum(s => s.NestedHitObjects.Count) + 1; + beatmapMaxCombo += Beatmap.HitObjects.OfType().Count(); } public override double Calculate(Dictionary categoryRatings = null) From a33724899973bd46204dfa981d6bc82ba66f0526 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 11 May 2018 22:06:16 +0900 Subject: [PATCH 6/9] Fix incorrect count --- osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs index 103fdeadea..b4324c77fc 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs @@ -32,7 +32,8 @@ namespace osu.Game.Rulesets.Osu.Scoring countHitCircles = Beatmap.HitObjects.Count(h => h is HitCircle); beatmapMaxCombo = Beatmap.HitObjects.Count(); - beatmapMaxCombo += Beatmap.HitObjects.OfType().Count(); + // Add the ticks + tail of the slider. 1 is subtracted because the "headcircle" would be counted twice (once for the slider itself in the line above) + beatmapMaxCombo += Beatmap.HitObjects.OfType().Sum(s => s.NestedHitObjects.Count - 1); } public override double Calculate(Dictionary categoryRatings = null) From 6ebe9f88e78b1c222fcecb6ba4b3ec5f0e003eed Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 12 May 2018 11:11:09 +0900 Subject: [PATCH 7/9] Update framework with upstream fixes --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 8c4f232694..f807997301 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8c4f23269447d9ce21a5dbd3a0fd4f6caae9ab38 +Subproject commit f8079973011b54e84e5c0e677fe2b56e55947666 From 416ed725977527718f4c5fe744e0a60181c0cd8e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 12 May 2018 15:46:25 +0900 Subject: [PATCH 8/9] Port osu-performance changes into OsuPerformanceCalculator --- osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs index 6b9214d9dc..a06e71e20c 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs @@ -121,7 +121,7 @@ namespace osu.Game.Rulesets.Osu.Scoring aimValue *= approachRateFactor; if (mods.Any(h => h is OsuModHidden)) - aimValue *= 1.18f; + aimValue *= 1.03f; if (mods.Any(h => h is OsuModFlashlight)) { @@ -152,6 +152,9 @@ namespace osu.Game.Rulesets.Osu.Scoring if (beatmapMaxCombo > 0) speedValue *= Math.Min(Math.Pow(scoreMaxCombo, 0.8f) / Math.Pow(beatmapMaxCombo, 0.8f), 1.0f); + if (mods.Any(m => m is OsuModHidden)) + speedValue *= 1.18f; + // Scale the speed value with accuracy _slightly_ speedValue *= 0.5f + accuracy / 2.0f; // It is important to also consider accuracy difficulty when doing that From df43fc6ff8defe26d52b002f19ebd20bb8515a90 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 13 May 2018 01:31:17 +0900 Subject: [PATCH 9/9] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index eaa640972c..fac688633b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit eaa640972ca9c67f0ea15a942035b5b3a78f1570 +Subproject commit fac688633b8fcf34ae5d0514c26b03e217161eb4