From 43a7923199fa4a4ff8b49b5a191ab90f131f7b01 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 26 May 2017 19:22:17 +0900 Subject: [PATCH 01/14] Implement base mania judgement score. --- .../Judgements/ManiaJudgement.cs | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs index 6e69da3da7..33083ca0f5 100644 --- a/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs +++ b/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs @@ -2,11 +2,37 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Objects.Drawables; namespace osu.Game.Rulesets.Mania.Judgements { public class ManiaJudgement : Judgement { + /// + /// The maximum possible hit result. + /// + public const ManiaHitResult MAX_HIT_RESULT = ManiaHitResult.Perfect; + + /// + /// The result value for the combo portion of the score. + /// + public int ResultValueForScore => Result == HitResult.Miss ? 0 : NumericResultForScore(ManiaResult); + + /// + /// The result value for the accuracy portion of the score. + /// + public int ResultValueForAccuracy => Result == HitResult.Miss ? 0 : NumericResultForAccuracy(ManiaResult); + + /// + /// The maximum result value for the combo portion of the score. + /// + public int MaxResultValueForScore => NumericResultForScore(MAX_HIT_RESULT); + + /// + /// The maximum result value for the accuracy portion of the score. + /// + public int MaxResultValueForAccuracy => NumericResultForAccuracy(MAX_HIT_RESULT); + public override string ResultString => string.Empty; public override string MaxResultString => string.Empty; @@ -15,5 +41,42 @@ namespace osu.Game.Rulesets.Mania.Judgements /// The hit result. /// public ManiaHitResult ManiaResult; + + public virtual int NumericResultForScore(ManiaHitResult result) + { + switch (result) + { + default: + return 0; + case ManiaHitResult.Bad: + return 50; + case ManiaHitResult.Ok: + return 100; + case ManiaHitResult.Good: + return 200; + case ManiaHitResult.Great: + case ManiaHitResult.Perfect: + return 300; + } + } + + public virtual int NumericResultForAccuracy(ManiaHitResult result) + { + switch (result) + { + default: + return 0; + case ManiaHitResult.Bad: + return 50; + case ManiaHitResult.Ok: + return 100; + case ManiaHitResult.Good: + return 200; + case ManiaHitResult.Great: + return 300; + case ManiaHitResult.Perfect: + return 305; + } + } } } From 4c67c13410f0b7567944672ac1ba29f66d91b84a Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 26 May 2017 19:28:14 +0900 Subject: [PATCH 02/14] Add hold note tail judgement. --- .../Judgements/HoldNoteTailJudgement.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs index df2f7e9e63..d5cf57a5da 100644 --- a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs +++ b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs @@ -9,5 +9,29 @@ namespace osu.Game.Rulesets.Mania.Judgements /// Whether the hold note has been released too early and shouldn't give full score for the release. /// public bool HasBroken; + + public override int NumericResultForScore(ManiaHitResult result) + { + switch (result) + { + default: + return base.NumericResultForScore(result); + case ManiaHitResult.Great: + case ManiaHitResult.Perfect: + return base.NumericResultForScore(HasBroken ? ManiaHitResult.Good : result); + } + } + + public override int NumericResultForAccuracy(ManiaHitResult result) + { + switch (result) + { + default: + return base.NumericResultForAccuracy(result); + case ManiaHitResult.Great: + case ManiaHitResult.Perfect: + return base.NumericResultForAccuracy(HasBroken ? ManiaHitResult.Good : result); + } + } } } \ No newline at end of file From 02f582a3f80993177dc06dbbc322679e23f99bd3 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 26 May 2017 19:29:47 +0900 Subject: [PATCH 03/14] Add hold note tick judgement. --- osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs index bead455c13..d6a72c825a 100644 --- a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs +++ b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs @@ -5,5 +5,7 @@ namespace osu.Game.Rulesets.Mania.Judgements { public class HoldNoteTickJudgement : ManiaJudgement { + public override int NumericResultForScore(ManiaHitResult result) => 20; + public override int NumericResultForAccuracy(ManiaHitResult result) => 0; // Don't count ticks into accuracy } } \ No newline at end of file From 9ec6e0b692cf14b31e07079264aeceb736025d49 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 26 May 2017 19:56:27 +0900 Subject: [PATCH 04/14] Fix hold note ticks changing combo. --- osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs index d6a72c825a..852f97b3f2 100644 --- a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs +++ b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs @@ -5,6 +5,8 @@ namespace osu.Game.Rulesets.Mania.Judgements { public class HoldNoteTickJudgement : ManiaJudgement { + public override bool AffectsCombo => false; + public override int NumericResultForScore(ManiaHitResult result) => 20; public override int NumericResultForAccuracy(ManiaHitResult result) => 0; // Don't count ticks into accuracy } From ab5e1bfc891e01f7a05c851591dae1cf4f9978e0 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 26 May 2017 19:56:50 +0900 Subject: [PATCH 05/14] Add basic score calculations. --- osu.Game.Rulesets.Mania/Objects/HoldNote.cs | 6 + .../Scoring/ManiaScoreProcessor.cs | 148 ++++++++++++++++++ 2 files changed, 154 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs index c241c4cf41..3550d561c1 100644 --- a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Linq; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Database; using osu.Game.Rulesets.Objects.Types; @@ -60,6 +61,11 @@ namespace osu.Game.Rulesets.Mania.Objects tickSpacing = timingPoint.BeatLength / difficulty.SliderTickRate; } + /// + /// Total number of hold note ticks. + /// + public int TotalTicks => Ticks.Count(); + /// /// The scoring scoring ticks of the hold note. /// diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 7a9572a0c7..2f4ce075c3 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -1,8 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; @@ -10,6 +13,52 @@ namespace osu.Game.Rulesets.Mania.Scoring { internal class ManiaScoreProcessor : ScoreProcessor { + /// + /// The maximum score achievable. + /// Does _not_ include bonus score - for bonus score see . + /// + private const int max_score = 1000000; + + /// + /// The amount of the score attributed to combo. + /// + private const double combo_portion_max = max_score * 0.2; + + /// + /// The amount of the score attributed to accuracy. + /// + private const double accuracy_portion_max = max_score * 0.8; + + /// + /// The cumulative combo portion of the score. + /// + private double comboScore => combo_portion_max * comboPortion / maxComboPortion; + + /// + /// The cumulative accuracy portion of the score. + /// + private double accuracyScore => accuracy_portion_max * Math.Pow(Accuracy, 4) * totalHits / maxTotalHits; + + /// + /// The cumulative bonus score. + /// This is added on top of , thus the total score can exceed . + /// + private double bonusScore; + + private double maxComboPortion; + private double comboPortion; + private int maxTotalHits; + private int totalHits; + + private double hpIncreaseBad; + private double hpIncreaseOk; + private double hpIncreaseGood; + private double hpIncreaseGreat; + private double hpIncreasePerfect; + private double hpIncreaseTick; + private double hpIncreaseTickMiss; + private double hpIncreaseMiss; + public ManiaScoreProcessor() { } @@ -19,8 +68,107 @@ namespace osu.Game.Rulesets.Mania.Scoring { } + protected override void ComputeTargets(Beatmap beatmap) + { + foreach (var obj in beatmap.HitObjects) + { + if (obj is Note) + { + AddJudgement(new ManiaJudgement + { + Result = HitResult.Hit, + ManiaResult = ManiaHitResult.Perfect + }); + } + else if (obj is HoldNote) + { + // Head + AddJudgement(new ManiaJudgement + { + Result = HitResult.Hit, + ManiaResult = ManiaJudgement.MAX_HIT_RESULT + }); + + // Ticks + for (int i = 0; i < ((HoldNote)obj).TotalTicks; i++) + { + AddJudgement(new HoldNoteTickJudgement + { + Result = HitResult.Hit, + ManiaResult = ManiaJudgement.MAX_HIT_RESULT, + }); + } + + AddJudgement(new HoldNoteTailJudgement + { + Result = HitResult.Hit, + ManiaResult = ManiaJudgement.MAX_HIT_RESULT + }); + } + } + + maxTotalHits = totalHits; + maxComboPortion = comboPortion; + } + protected override void OnNewJudgement(ManiaJudgement judgement) { + bool isTick = judgement is HoldNoteTickJudgement; + + if (!isTick) + totalHits++; + + switch (judgement.Result) + { + case HitResult.Miss: + if (isTick) + Health.Value += hpIncreaseTickMiss; + else + Health.Value += hpIncreaseMiss; + break; + case HitResult.Hit: + if (isTick) + { + Health.Value += hpIncreaseTick; + bonusScore += judgement.ResultValueForScore; + } + else + { + switch (judgement.ManiaResult) + { + case ManiaHitResult.Bad: + Health.Value += hpIncreaseBad; + break; + case ManiaHitResult.Ok: + Health.Value += hpIncreaseOk; + break; + case ManiaHitResult.Good: + Health.Value += hpIncreaseGood; + break; + case ManiaHitResult.Great: + Health.Value += hpIncreaseGreat; + break; + case ManiaHitResult.Perfect: + Health.Value += hpIncreasePerfect; + break; + } + + comboPortion += judgement.ResultValueForScore; + } + break; + } + + int scoreForAccuracy = 0; + int maxScoreForAccuracy = 0; + + foreach (var j in Judgements) + { + scoreForAccuracy += j.ResultValueForAccuracy; + maxScoreForAccuracy += j.MaxResultValueForAccuracy; + } + + Accuracy.Value = (double)scoreForAccuracy / maxScoreForAccuracy; + TotalScore.Value = comboScore + accuracyScore + bonusScore; } protected override void Reset() From 10f62eb8da15bd22268fca9b84a71755d932af55 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 26 May 2017 20:25:24 +0900 Subject: [PATCH 06/14] Fix incorrect combo score. --- .../Scoring/ManiaScoreProcessor.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 2f4ce075c3..4a5ab639b9 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -29,6 +29,16 @@ namespace osu.Game.Rulesets.Mania.Scoring /// private const double accuracy_portion_max = max_score * 0.8; + /// + /// The factor used to determine relevance of combos. + /// + private const double combo_base = 4; + + /// + /// The combo value at which hit objects result in the max score possible. + /// + private const int combo_relevance_cap = 400; + /// /// The cumulative combo portion of the score. /// @@ -153,7 +163,9 @@ namespace osu.Game.Rulesets.Mania.Scoring break; } - comboPortion += judgement.ResultValueForScore; + // A factor that is applied to make higher combos more relevant + double comboRelevance = Math.Min(Math.Max(0.5, Math.Log(Combo.Value, combo_base)), Math.Log(combo_relevance_cap, combo_base)); + comboPortion += judgement.ResultValueForScore * comboRelevance; } break; } From 95908af677aec6bf59bf1545233e3b4f8e35fa4d Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 26 May 2017 20:26:06 +0900 Subject: [PATCH 07/14] Fix resetting scoreprocessor. --- osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 4a5ab639b9..18df7888b6 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -188,6 +188,10 @@ namespace osu.Game.Rulesets.Mania.Scoring base.Reset(); Health.Value = 1; + + bonusScore = 0; + comboPortion = 0; + totalHits = 0; } } } From ca080117349bc78789a0f1e79c27818666f46e22 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 26 May 2017 20:26:26 +0900 Subject: [PATCH 08/14] Add basic (new) hp calculations. --- .../Scoring/ManiaScoreProcessor.cs | 98 +++++++++++-------- 1 file changed, 56 insertions(+), 42 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 18df7888b6..fc2e8bec10 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -60,14 +60,17 @@ namespace osu.Game.Rulesets.Mania.Scoring private int maxTotalHits; private int totalHits; - private double hpIncreaseBad; - private double hpIncreaseOk; - private double hpIncreaseGood; - private double hpIncreaseGreat; - private double hpIncreasePerfect; - private double hpIncreaseTick; - private double hpIncreaseTickMiss; - private double hpIncreaseMiss; + private double hpMultiplier = 1; + private const double hp_increase_bad = 0.005; + private const double hp_increase_ok = 0.010; + private const double hp_increase_good = 0.035; + private const double hp_increase_tick = 0.040; + private const double hp_increase_great = 0.055; + private const double hp_increase_perfect = 0.065; + + private double hpMissMultiplier = 1; + private const double hp_increase_tick_miss = -0.025; + private const double hp_increase_miss = -0.125; public ManiaScoreProcessor() { @@ -80,41 +83,52 @@ namespace osu.Game.Rulesets.Mania.Scoring protected override void ComputeTargets(Beatmap beatmap) { - foreach (var obj in beatmap.HitObjects) + while (true) { - if (obj is Note) + foreach (var obj in beatmap.HitObjects) { - AddJudgement(new ManiaJudgement + if (obj is Note) { - Result = HitResult.Hit, - ManiaResult = ManiaHitResult.Perfect - }); - } - else if (obj is HoldNote) - { - // Head - AddJudgement(new ManiaJudgement - { - Result = HitResult.Hit, - ManiaResult = ManiaJudgement.MAX_HIT_RESULT - }); - - // Ticks - for (int i = 0; i < ((HoldNote)obj).TotalTicks; i++) - { - AddJudgement(new HoldNoteTickJudgement + AddJudgement(new ManiaJudgement { Result = HitResult.Hit, - ManiaResult = ManiaJudgement.MAX_HIT_RESULT, + ManiaResult = ManiaHitResult.Perfect }); } - - AddJudgement(new HoldNoteTailJudgement + else if (obj is HoldNote) { - Result = HitResult.Hit, - ManiaResult = ManiaJudgement.MAX_HIT_RESULT - }); + // Head + AddJudgement(new ManiaJudgement + { + Result = HitResult.Hit, + ManiaResult = ManiaJudgement.MAX_HIT_RESULT + }); + + // Ticks + for (int i = 0; i < ((HoldNote)obj).TotalTicks; i++) + { + AddJudgement(new HoldNoteTickJudgement + { + Result = HitResult.Hit, + ManiaResult = ManiaJudgement.MAX_HIT_RESULT, + }); + } + + AddJudgement(new HoldNoteTailJudgement + { + Result = HitResult.Hit, + ManiaResult = ManiaJudgement.MAX_HIT_RESULT + }); + } } + + if (!HasFailed) + break; + + hpMultiplier *= 1.01; + hpMissMultiplier *= 0.98; + + Reset(); } maxTotalHits = totalHits; @@ -132,14 +146,14 @@ namespace osu.Game.Rulesets.Mania.Scoring { case HitResult.Miss: if (isTick) - Health.Value += hpIncreaseTickMiss; + Health.Value += hpMissMultiplier * hp_increase_tick_miss; else - Health.Value += hpIncreaseMiss; + Health.Value += hpMissMultiplier * hp_increase_miss; break; case HitResult.Hit: if (isTick) { - Health.Value += hpIncreaseTick; + Health.Value += hpMultiplier * hp_increase_tick; bonusScore += judgement.ResultValueForScore; } else @@ -147,19 +161,19 @@ namespace osu.Game.Rulesets.Mania.Scoring switch (judgement.ManiaResult) { case ManiaHitResult.Bad: - Health.Value += hpIncreaseBad; + Health.Value += hpMultiplier * hp_increase_bad; break; case ManiaHitResult.Ok: - Health.Value += hpIncreaseOk; + Health.Value += hpMultiplier * hp_increase_ok; break; case ManiaHitResult.Good: - Health.Value += hpIncreaseGood; + Health.Value += hpMultiplier * hp_increase_good; break; case ManiaHitResult.Great: - Health.Value += hpIncreaseGreat; + Health.Value += hpMultiplier * hp_increase_great; break; case ManiaHitResult.Perfect: - Health.Value += hpIncreasePerfect; + Health.Value += hpMultiplier * hp_increase_perfect; break; } From 3715171948983a9f95fe246143f56ef14e245d65 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 26 May 2017 20:32:21 +0900 Subject: [PATCH 09/14] Ticks can't be missed. --- osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index fc2e8bec10..1be92f6dc4 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -69,7 +69,6 @@ namespace osu.Game.Rulesets.Mania.Scoring private const double hp_increase_perfect = 0.065; private double hpMissMultiplier = 1; - private const double hp_increase_tick_miss = -0.025; private const double hp_increase_miss = -0.125; public ManiaScoreProcessor() @@ -145,9 +144,6 @@ namespace osu.Game.Rulesets.Mania.Scoring switch (judgement.Result) { case HitResult.Miss: - if (isTick) - Health.Value += hpMissMultiplier * hp_increase_tick_miss; - else Health.Value += hpMissMultiplier * hp_increase_miss; break; case HitResult.Hit: From b28b7af887261f8b67d8daba0aff7ff5876ec2a2 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 26 May 2017 20:42:03 +0900 Subject: [PATCH 10/14] Scale HP with drain rate a bit. --- .../Scoring/ManiaScoreProcessor.cs | 102 ++++++++++++++++-- 1 file changed, 93 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 1be92f6dc4..12c8386ae7 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -3,6 +3,7 @@ using System; using osu.Game.Beatmaps; +using osu.Game.Database; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Objects.Drawables; @@ -39,6 +40,71 @@ namespace osu.Game.Rulesets.Mania.Scoring /// private const int combo_relevance_cap = 400; + /// + /// The hit HP multiplier at OD = 0. + /// + private const double hp_multiplier_min = 0.75; + + /// + /// The hit HP multiplier at OD = 0. + /// + private const double hp_multiplier_mid = 0.85; + + /// + /// The hit HP multiplier at OD = 0. + /// + private const double hp_multiplier_max = 1; + + /// + /// The default BAD hit HP increase. + /// + private const double hp_increase_bad = 0.005; + + /// + /// The default OK hit HP increase. + /// + private const double hp_increase_ok = 0.010; + + /// + /// The default GOOD hit HP increase. + /// + private const double hp_increase_good = 0.035; + + /// + /// The default tick hit HP increase. + /// + private const double hp_increase_tick = 0.040; + + /// + /// The default GREAT hit HP increase. + /// + private const double hp_increase_great = 0.055; + + /// + /// The default PERFECT hit HP increase. + /// + private const double hp_increase_perfect = 0.065; + + /// + /// The MISS HP multiplier at OD = 0. + /// + private const double hp_multiplier_miss_min = 0.5; + + /// + /// The MISS HP multiplier at OD = 5. + /// + private const double hp_multiplier_miss_mid = 0.75; + + /// + /// The MISS HP multiplier at OD = 10. + /// + private const double hp_multiplier_miss_max = 1; + + /// + /// The default MISS HP increase. + /// + private const double hp_increase_miss = -0.125; + /// /// The cumulative combo portion of the score. /// @@ -55,21 +121,35 @@ namespace osu.Game.Rulesets.Mania.Scoring /// private double bonusScore; + /// + /// The achieved by a perfect playthrough. + /// private double maxComboPortion; + + /// + /// The portion of the score dedicated to combo. + /// private double comboPortion; + + /// + /// The achieved by a perfect playthrough. + /// private int maxTotalHits; + + /// + /// The total hits. + /// private int totalHits; - private double hpMultiplier = 1; - private const double hp_increase_bad = 0.005; - private const double hp_increase_ok = 0.010; - private const double hp_increase_good = 0.035; - private const double hp_increase_tick = 0.040; - private const double hp_increase_great = 0.055; - private const double hp_increase_perfect = 0.065; - + /// + /// The MISS HP multiplier. + /// private double hpMissMultiplier = 1; - private const double hp_increase_miss = -0.125; + + /// + /// The HIT HP multiplier. + /// + private double hpMultiplier = 1; public ManiaScoreProcessor() { @@ -82,6 +162,10 @@ namespace osu.Game.Rulesets.Mania.Scoring protected override void ComputeTargets(Beatmap beatmap) { + BeatmapDifficulty difficulty = beatmap.BeatmapInfo.Difficulty; + hpMultiplier = BeatmapDifficulty.DifficultyRange(difficulty.DrainRate, hp_multiplier_min, hp_multiplier_mid, hp_multiplier_max); + hpMissMultiplier = BeatmapDifficulty.DifficultyRange(difficulty.DrainRate, hp_multiplier_miss_min, hp_multiplier_miss_mid, hp_multiplier_miss_max); + while (true) { foreach (var obj in beatmap.HitObjects) From e5e73b31b61c932fc39408e5a650369a4ad3cd6d Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 29 May 2017 11:42:43 +0900 Subject: [PATCH 11/14] Cleanup + slight xmldoc improvements. --- .../Scoring/ManiaScoreProcessor.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 12c8386ae7..95c5c58d51 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -105,6 +105,16 @@ namespace osu.Game.Rulesets.Mania.Scoring /// private const double hp_increase_miss = -0.125; + /// + /// The MISS HP multiplier. This is multiplied to the miss hp increase. + /// + private double hpMissMultiplier = 1; + + /// + /// The HIT HP multiplier. This is multiplied to hit hp increases. + /// + private double hpMultiplier = 1; + /// /// The cumulative combo portion of the score. /// @@ -141,16 +151,6 @@ namespace osu.Game.Rulesets.Mania.Scoring /// private int totalHits; - /// - /// The MISS HP multiplier. - /// - private double hpMissMultiplier = 1; - - /// - /// The HIT HP multiplier. - /// - private double hpMultiplier = 1; - public ManiaScoreProcessor() { } From f17b8acd13d5afffc865f543761cfce2680702b3 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 29 May 2017 11:45:16 +0900 Subject: [PATCH 12/14] Remove erroneous tab. --- osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 95c5c58d51..ebf99206ee 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -228,7 +228,7 @@ namespace osu.Game.Rulesets.Mania.Scoring switch (judgement.Result) { case HitResult.Miss: - Health.Value += hpMissMultiplier * hp_increase_miss; + Health.Value += hpMissMultiplier * hp_increase_miss; break; case HitResult.Hit: if (isTick) From 44f1d906eac658aa586e1bc2ec326a8194f74f64 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 29 May 2017 14:47:51 +0900 Subject: [PATCH 13/14] Store tick count locally, remove HoldNote TickCount. --- osu.Game.Rulesets.Mania/Objects/HoldNote.cs | 5 ----- osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs | 8 ++++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs index 3550d561c1..3d988d9dda 100644 --- a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs @@ -61,11 +61,6 @@ namespace osu.Game.Rulesets.Mania.Objects tickSpacing = timingPoint.BeatLength / difficulty.SliderTickRate; } - /// - /// Total number of hold note ticks. - /// - public int TotalTicks => Ticks.Count(); - /// /// The scoring scoring ticks of the hold note. /// diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index ebf99206ee..798d4b8c5b 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Linq; using osu.Game.Beatmaps; using osu.Game.Database; using osu.Game.Rulesets.Mania.Judgements; @@ -170,6 +171,8 @@ namespace osu.Game.Rulesets.Mania.Scoring { foreach (var obj in beatmap.HitObjects) { + var holdNote = obj as HoldNote; + if (obj is Note) { AddJudgement(new ManiaJudgement @@ -178,7 +181,7 @@ namespace osu.Game.Rulesets.Mania.Scoring ManiaResult = ManiaHitResult.Perfect }); } - else if (obj is HoldNote) + else if (holdNote != null) { // Head AddJudgement(new ManiaJudgement @@ -188,7 +191,8 @@ namespace osu.Game.Rulesets.Mania.Scoring }); // Ticks - for (int i = 0; i < ((HoldNote)obj).TotalTicks; i++) + int tickCount = holdNote.Ticks.Count(); + for (int i = 0; i < tickCount; i++) { AddJudgement(new HoldNoteTickJudgement { From 0327adcba8e14c3caf78e9390289f7c54f72659d Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 29 May 2017 15:35:50 +0900 Subject: [PATCH 14/14] Update HoldNote.cs --- osu.Game.Rulesets.Mania/Objects/HoldNote.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs index 3d988d9dda..92f570476e 100644 --- a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs @@ -1,8 +1,7 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using System.Linq; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Database; using osu.Game.Rulesets.Objects.Types;