From 8479880d44c74c8a478151db63facb2d32fbde73 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 13:33:39 +0900 Subject: [PATCH 1/5] Move SliderVelocityAt into TimingInfo, fix xmldoc. --- osu.Game/Beatmaps/Beatmap.cs | 15 --------------- osu.Game/Beatmaps/Timing/TimingInfo.cs | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index fc8bb751f9..f80973a33c 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -43,21 +43,6 @@ namespace osu.Game.Beatmaps TimingInfo = original?.TimingInfo ?? TimingInfo; ComboColors = original?.ComboColors ?? ComboColors; } - - /// - /// Finds the slider velocity at a time. - /// - /// The time to find the slider velocity at. - /// The slider velocity in positional length units. - public double SliderVelocityAt(double time) - { - double scoringDistance = 100 * BeatmapInfo.Difficulty.SliderMultiplier; - double beatDistance = TimingInfo.BeatDistanceAt(time); - - if (beatDistance > 0) - return scoringDistance / beatDistance * 1000; - return scoringDistance; - } } /// diff --git a/osu.Game/Beatmaps/Timing/TimingInfo.cs b/osu.Game/Beatmaps/Timing/TimingInfo.cs index f245a6b1aa..0e47ba983b 100644 --- a/osu.Game/Beatmaps/Timing/TimingInfo.cs +++ b/osu.Game/Beatmaps/Timing/TimingInfo.cs @@ -102,5 +102,21 @@ namespace osu.Game.Beatmaps.Timing return timingPoint ?? ControlPoint.Default; } + + /// + /// Finds the slider velocity at a time. + /// + /// The time to find the slider velocity at. + /// The slider velocity in milliseconds. + public double SliderVelocityAt(double time) + { + const double base_scoring_distance = 100; + + double beatDistance = BeatDistanceAt(time); + + if (beatDistance > 0) + return base_scoring_distance / beatDistance * 1000; + return base_scoring_distance; + } } } \ No newline at end of file From 28240fb3b5f30ac5139a63f8b0e06a88b501a0ff Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 13:33:48 +0900 Subject: [PATCH 2/5] Rename TaikoBaseHit -> TaikoHitObject. --- osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs | 8 ++++---- osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs | 6 +++--- .../Objects/Drawable/DrawableTaikoHit.cs | 4 ++-- .../Objects/{TaikoBaseHit.cs => TaikoHitObject.cs} | 2 +- osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs | 4 ++-- osu.Game.Modes.Taiko/TaikoScoreProcessor.cs | 4 ++-- osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs | 10 +++++----- osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs | 2 +- osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) rename osu.Game.Modes.Taiko/Objects/{TaikoBaseHit.cs => TaikoHitObject.cs} (85%) diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index 3230010fda..d78c347f22 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -7,13 +7,13 @@ using System.Collections.Generic; namespace osu.Game.Modes.Taiko.Beatmaps { - internal class TaikoBeatmapConverter : IBeatmapConverter + internal class TaikoBeatmapConverter : IBeatmapConverter { - public Beatmap Convert(Beatmap original) + public Beatmap Convert(Beatmap original) { - return new Beatmap(original) + return new Beatmap(original) { - HitObjects = new List() // Todo: Implement + HitObjects = new List() // Todo: Implement }; } } diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs index 9a244cd23e..84bc470e55 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapProcessor.cs @@ -6,13 +6,13 @@ using osu.Game.Modes.Taiko.Objects; namespace osu.Game.Modes.Taiko.Beatmaps { - internal class TaikoBeatmapProcessor : IBeatmapProcessor + internal class TaikoBeatmapProcessor : IBeatmapProcessor { - public void SetDefaults(TaikoBaseHit hitObject, Beatmap beatmap) + public void SetDefaults(TaikoHitObject hitObject, Beatmap beatmap) { } - public void PostProcess(Beatmap beatmap) + public void PostProcess(Beatmap beatmap) { } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHit.cs index a54108afda..760977ef5b 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHit.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHit.cs @@ -12,9 +12,9 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable { internal class DrawableTaikoHit : Sprite { - private TaikoBaseHit h; + private TaikoHitObject h; - public DrawableTaikoHit(TaikoBaseHit h) + public DrawableTaikoHit(TaikoHitObject h) { this.h = h; diff --git a/osu.Game.Modes.Taiko/Objects/TaikoBaseHit.cs b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs similarity index 85% rename from osu.Game.Modes.Taiko/Objects/TaikoBaseHit.cs rename to osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs index 4077c1933a..a5f488e076 100644 --- a/osu.Game.Modes.Taiko/Objects/TaikoBaseHit.cs +++ b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs @@ -5,7 +5,7 @@ using osu.Game.Modes.Objects; namespace osu.Game.Modes.Taiko.Objects { - public class TaikoBaseHit : HitObject + public class TaikoHitObject : HitObject { public float Scale = 1; diff --git a/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs index 4a133ea896..93dfc3d651 100644 --- a/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Modes.Taiko/TaikoDifficultyCalculator.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; namespace osu.Game.Modes.Taiko { - public class TaikoDifficultyCalculator : DifficultyCalculator + public class TaikoDifficultyCalculator : DifficultyCalculator { public TaikoDifficultyCalculator(Beatmap beatmap) : base(beatmap) { @@ -19,6 +19,6 @@ namespace osu.Game.Modes.Taiko return 0; } - protected override IBeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(); + protected override IBeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(); } } \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/TaikoScoreProcessor.cs b/osu.Game.Modes.Taiko/TaikoScoreProcessor.cs index 1e5c70cd2e..849c0fa894 100644 --- a/osu.Game.Modes.Taiko/TaikoScoreProcessor.cs +++ b/osu.Game.Modes.Taiko/TaikoScoreProcessor.cs @@ -7,13 +7,13 @@ using osu.Game.Modes.UI; namespace osu.Game.Modes.Taiko { - internal class TaikoScoreProcessor : ScoreProcessor + internal class TaikoScoreProcessor : ScoreProcessor { public TaikoScoreProcessor() { } - public TaikoScoreProcessor(HitRenderer hitRenderer) + public TaikoScoreProcessor(HitRenderer hitRenderer) : base(hitRenderer) { } diff --git a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs index 385b0915f4..80e42cb976 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoHitRenderer.cs @@ -10,7 +10,7 @@ using osu.Game.Modes.UI; namespace osu.Game.Modes.Taiko.UI { - public class TaikoHitRenderer : HitRenderer + public class TaikoHitRenderer : HitRenderer { public TaikoHitRenderer(WorkingBeatmap beatmap) : base(beatmap) @@ -19,12 +19,12 @@ namespace osu.Game.Modes.Taiko.UI public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor(this); - protected override IBeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(); + protected override IBeatmapConverter CreateBeatmapConverter() => new TaikoBeatmapConverter(); - protected override IBeatmapProcessor CreateBeatmapProcessor() => new TaikoBeatmapProcessor(); + protected override IBeatmapProcessor CreateBeatmapProcessor() => new TaikoBeatmapProcessor(); - protected override Playfield CreatePlayfield() => new TaikoPlayfield(); + protected override Playfield CreatePlayfield() => new TaikoPlayfield(); - protected override DrawableHitObject GetVisualRepresentation(TaikoBaseHit h) => null; + protected override DrawableHitObject GetVisualRepresentation(TaikoHitObject h) => null; } } diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index d80aa94fa1..f3ae600501 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -13,7 +13,7 @@ using osu.Game.Modes.Taiko.Judgements; namespace osu.Game.Modes.Taiko.UI { - public class TaikoPlayfield : Playfield + public class TaikoPlayfield : Playfield { public TaikoPlayfield() { diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index bc38781b01..7ea6dfeadb 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -52,7 +52,7 @@ - + From b399c6adbb65dcf7a4a6442c2de5e49be8b9d18c Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 13:38:17 +0900 Subject: [PATCH 3/5] Implement TaikoHitObject. --- .../Objects/TaikoHitObject.cs | 73 +++++++++++++++++-- osu.Game.Modes.Taiko/Objects/TaikoHitType.cs | 21 ++++++ .../osu.Game.Modes.Taiko.csproj | 1 + 3 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 osu.Game.Modes.Taiko/Objects/TaikoHitType.cs diff --git a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs index a5f488e076..b46a633647 100644 --- a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs @@ -1,20 +1,77 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Beatmaps.Samples; +using osu.Game.Beatmaps.Timing; +using osu.Game.Database; using osu.Game.Modes.Objects; namespace osu.Game.Modes.Taiko.Objects { public class TaikoHitObject : HitObject { - public float Scale = 1; + /// + /// HitCircle radius. + /// + public const float CIRCLE_RADIUS = 64; - public TaikoColour Type; - } + /// + /// The hit window that results in a "GREAT" hit. + /// + public double HitWindowGreat = 35; - public enum TaikoColour - { - Red, - Blue + /// + /// The hit window that results in a "GOOD" hit. + /// + public double HitWindowGood = 80; + + /// + /// The hit window that results in a "MISS". + /// + public double HitWindowMiss = 95; + + /// + /// The time to scroll in the HitObject. + /// + public double PreEmpt; + + /// + /// Whether this HitObject is in Kiai time. + /// + public bool Kiai; + + /// + /// The type of HitObject. + /// + public virtual TaikoHitType Type + { + get + { + SampleType st = Sample?.Type ?? SampleType.None; + + return + // Centre/Rim + ((st & ~(SampleType.Finish | SampleType.Normal)) == 0 ? TaikoHitType.CentreHit : TaikoHitType.RimHit) + // Finisher + | ((st & SampleType.Finish) > 0 ? TaikoHitType.Finisher : TaikoHitType.None); + } + } + + public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty) + { + base.ApplyDefaults(timing, difficulty); + + PreEmpt = 600 / (timing.SliderVelocityAt(StartTime) * difficulty.SliderMultiplier) * 1000; + + ControlPoint overridePoint; + Kiai = timing.TimingPointAt(StartTime, out overridePoint).KiaiMode; + + if (overridePoint != null) + Kiai |= overridePoint.KiaiMode; + + HitWindowGreat = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 50, 35, 20); + HitWindowGood = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 120, 80, 50); + HitWindowMiss = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 135, 95, 70); + } } -} +} \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/Objects/TaikoHitType.cs b/osu.Game.Modes.Taiko/Objects/TaikoHitType.cs new file mode 100644 index 0000000000..adf3a67246 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/TaikoHitType.cs @@ -0,0 +1,21 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; + +namespace osu.Game.Modes.Taiko.Objects +{ + [Flags] + public enum TaikoHitType + { + None = 0, + CentreHit = 1 << 0, + RimHit = 1 << 1, + DrumRoll = 1 << 2, + DrumRollTick = 1 << 3, + Bash = 1 << 4, + Finisher = 1 << 5, + + Hit = CentreHit | RimHit + } +} \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 7ea6dfeadb..0e9e6a56b4 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -50,6 +50,7 @@ + From 4b3308fd1db21a5a4aad7f68258e00bd4ff8a641 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Sat, 18 Mar 2017 18:40:26 +0900 Subject: [PATCH 4/5] Remove TaikoHitObject Type, we won't be using this going forward. --- osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs index b46a633647..4c55839ef0 100644 --- a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs @@ -40,23 +40,6 @@ namespace osu.Game.Modes.Taiko.Objects /// public bool Kiai; - /// - /// The type of HitObject. - /// - public virtual TaikoHitType Type - { - get - { - SampleType st = Sample?.Type ?? SampleType.None; - - return - // Centre/Rim - ((st & ~(SampleType.Finish | SampleType.Normal)) == 0 ? TaikoHitType.CentreHit : TaikoHitType.RimHit) - // Finisher - | ((st & SampleType.Finish) > 0 ? TaikoHitType.Finisher : TaikoHitType.None); - } - } - public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty) { base.ApplyDefaults(timing, difficulty); From 73ffbf81423970358f210231bbd7e3ad66f92163 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 19 Mar 2017 11:52:16 +0900 Subject: [PATCH 5/5] Remove unnecessary using. --- osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs index 4c55839ef0..61d8ed5f01 100644 --- a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Beatmaps.Samples; using osu.Game.Beatmaps.Timing; using osu.Game.Database; using osu.Game.Modes.Objects;