From 9d5327b1accc07234637f51f7903cacb2b9966ea Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 10 Mar 2020 15:00:23 +0900 Subject: [PATCH 1/2] Fix osu! shaking instead of missing for early hits --- .../TestSceneEarlyMissJudgement.cs | 70 +++++++++++++++++++ .../Scoring/OsuHitWindows.cs | 2 +- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Rulesets.Osu.Tests/TestSceneEarlyMissJudgement.cs diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneEarlyMissJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneEarlyMissJudgement.cs new file mode 100644 index 0000000000..27a32aa96e --- /dev/null +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneEarlyMissJudgement.cs @@ -0,0 +1,70 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using NUnit.Framework; +using osu.Game.Beatmaps; +using osu.Game.Replays; +using osu.Game.Rulesets.Osu.Beatmaps; +using osu.Game.Rulesets.Osu.Mods; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Replays; +using osu.Game.Rulesets.Scoring; +using osu.Game.Scoring; +using osu.Game.Tests.Visual; +using osu.Game.Users; +using osuTK; + +namespace osu.Game.Rulesets.Osu.Tests +{ + public class TestSceneEarlyMissJudgement : ModTestScene + { + public TestSceneEarlyMissJudgement() + : base(new OsuRuleset()) + { + } + + [Test] + public void TestHitCircleEarly() => CreateModTest(new ModTestData + { + Autoplay = false, + Mod = new TestAutoMod(), + Beatmap = new Beatmap + { + HitObjects = { new HitCircle { Position = new Vector2(256, 192) } } + }, + PassCondition = () => Player.Results.Count > 0 && Player.Results[0].TimeOffset < 0 && Player.Results[0].Type == HitResult.Miss + }); + + private class TestAutoMod : OsuModAutoplay + { + public override Score CreateReplayScore(IBeatmap beatmap) => new Score + { + ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } }, + Replay = new MissingAutoGenerator(beatmap).Generate() + }; + } + + private class MissingAutoGenerator : OsuAutoGeneratorBase + { + public new OsuBeatmap Beatmap => (OsuBeatmap)base.Beatmap; + + public MissingAutoGenerator(IBeatmap beatmap) + : base(beatmap) + { + } + + public override Replay Generate() + { + AddFrameToReplay(new OsuReplayFrame(-100000, new Vector2(256, 500))); + AddFrameToReplay(new OsuReplayFrame(Beatmap.HitObjects[0].StartTime - 1500, new Vector2(256, 500))); + AddFrameToReplay(new OsuReplayFrame(Beatmap.HitObjects[0].StartTime - 1500, new Vector2(256, 500))); + + AddFrameToReplay(new OsuReplayFrame(Beatmap.HitObjects[0].StartTime - 450, Beatmap.HitObjects[0].StackedPosition)); + AddFrameToReplay(new OsuReplayFrame(Beatmap.HitObjects[0].StartTime - 350, Beatmap.HitObjects[0].StackedPosition, OsuAction.LeftButton)); + AddFrameToReplay(new OsuReplayFrame(Beatmap.HitObjects[0].StartTime - 325, Beatmap.HitObjects[0].StackedPosition)); + + return Replay; + } + } + } +} diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs b/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs index a6491bb3f3..6f2998006f 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuHitWindows.cs @@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Osu.Scoring new DifficultyRange(HitResult.Great, 80, 50, 20), new DifficultyRange(HitResult.Good, 140, 100, 60), new DifficultyRange(HitResult.Meh, 200, 150, 100), - new DifficultyRange(HitResult.Miss, 200, 200, 200), + new DifficultyRange(HitResult.Miss, 400, 400, 400), }; public override bool IsHitResultAllowed(HitResult result) From 678f33eea36615c5a2ac2463ff13fc3c6f50a704 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 10 Mar 2020 15:45:21 +0900 Subject: [PATCH 2/2] Add late miss judgements --- ...cs => TestSceneMissHitWindowJudgements.cs} | 49 +++++++++++++++---- 1 file changed, 40 insertions(+), 9 deletions(-) rename osu.Game.Rulesets.Osu.Tests/{TestSceneEarlyMissJudgement.cs => TestSceneMissHitWindowJudgements.cs} (58%) diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneEarlyMissJudgement.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneMissHitWindowJudgements.cs similarity index 58% rename from osu.Game.Rulesets.Osu.Tests/TestSceneEarlyMissJudgement.cs rename to osu.Game.Rulesets.Osu.Tests/TestSceneMissHitWindowJudgements.cs index 27a32aa96e..5f3596976d 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneEarlyMissJudgement.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneMissHitWindowJudgements.cs @@ -8,6 +8,7 @@ using osu.Game.Rulesets.Osu.Beatmaps; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Replays; +using osu.Game.Rulesets.Osu.Scoring; using osu.Game.Rulesets.Scoring; using osu.Game.Scoring; using osu.Game.Tests.Visual; @@ -16,24 +17,54 @@ using osuTK; namespace osu.Game.Rulesets.Osu.Tests { - public class TestSceneEarlyMissJudgement : ModTestScene + public class TestSceneMissHitWindowJudgements : ModTestScene { - public TestSceneEarlyMissJudgement() + public TestSceneMissHitWindowJudgements() : base(new OsuRuleset()) { } [Test] - public void TestHitCircleEarly() => CreateModTest(new ModTestData + public void TestMissViaEarlyHit() { - Autoplay = false, - Mod = new TestAutoMod(), - Beatmap = new Beatmap + var beatmap = new Beatmap { HitObjects = { new HitCircle { Position = new Vector2(256, 192) } } - }, - PassCondition = () => Player.Results.Count > 0 && Player.Results[0].TimeOffset < 0 && Player.Results[0].Type == HitResult.Miss - }); + }; + + var hitWindows = new OsuHitWindows(); + hitWindows.SetDifficulty(beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty); + + CreateModTest(new ModTestData + { + Autoplay = false, + Mod = new TestAutoMod(), + Beatmap = new Beatmap + { + HitObjects = { new HitCircle { Position = new Vector2(256, 192) } } + }, + PassCondition = () => Player.Results.Count > 0 && Player.Results[0].TimeOffset < -hitWindows.WindowFor(HitResult.Meh) && Player.Results[0].Type == HitResult.Miss + }); + } + + [Test] + public void TestMissViaNotHitting() + { + var beatmap = new Beatmap + { + HitObjects = { new HitCircle { Position = new Vector2(256, 192) } } + }; + + var hitWindows = new OsuHitWindows(); + hitWindows.SetDifficulty(beatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty); + + CreateModTest(new ModTestData + { + Autoplay = false, + Beatmap = beatmap, + PassCondition = () => Player.Results.Count > 0 && Player.Results[0].TimeOffset >= hitWindows.WindowFor(HitResult.Meh) && Player.Results[0].Type == HitResult.Miss + }); + } private class TestAutoMod : OsuModAutoplay {