Skip to content

Commit 9da8dcd

Browse files
osu!taiko stamina balancing (#31337)
* stamina considerations * remove consecutive note count * adjust multiplier * add back comment * adjust tests * adjusts tests post merge * use diffcalcutils --------- Co-authored-by: StanR <[email protected]>
1 parent 974fa76 commit 9da8dcd

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

Diff for: osu.Game.Rulesets.Taiko.Tests/TaikoDifficultyCalculatorTest.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ public class TaikoDifficultyCalculatorTest : DifficultyCalculatorTest
1414
{
1515
protected override string ResourceAssembly => "osu.Game.Rulesets.Taiko";
1616

17-
[TestCase(2.837609165845338d, 200, "diffcalc-test")]
18-
[TestCase(2.837609165845338d, 200, "diffcalc-test-strong")]
17+
[TestCase(2.912326627861987d, 200, "diffcalc-test")]
18+
[TestCase(2.912326627861987d, 200, "diffcalc-test-strong")]
1919
public void Test(double expectedStarRating, int expectedMaxCombo, string name)
2020
=> base.Test(expectedStarRating, expectedMaxCombo, name);
2121

22-
[TestCase(3.8005218640444949, 200, "diffcalc-test")]
23-
[TestCase(3.8005218640444949, 200, "diffcalc-test-strong")]
22+
[TestCase(3.9339069955362014d, 200, "diffcalc-test")]
23+
[TestCase(3.9339069955362014d, 200, "diffcalc-test-strong")]
2424
public void TestClockRateAdjusted(double expectedStarRating, int expectedMaxCombo, string name)
2525
=> Test(expectedStarRating, expectedMaxCombo, name, new TaikoModDoubleTime());
2626

Diff for: osu.Game.Rulesets.Taiko/Difficulty/Evaluators/StaminaEvaluator.cs

+8-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private static double speedBonus(double interval)
1919
// Interval is capped at a very small value to prevent infinite values.
2020
interval = Math.Max(interval, 1);
2121

22-
return 30 / interval;
22+
return 20 / interval;
2323
}
2424

2525
/// <summary>
@@ -59,16 +59,15 @@ public static double EvaluateDifficultyOf(DifficultyHitObject current)
5959
// Find the previous hit object hit by the current finger, which is n notes prior, n being the number of
6060
// available fingers.
6161
TaikoDifficultyHitObject taikoCurrent = (TaikoDifficultyHitObject)current;
62-
TaikoDifficultyHitObject? keyPrevious = taikoCurrent.PreviousMono(availableFingersFor(taikoCurrent) - 1);
63-
64-
if (keyPrevious == null)
65-
{
66-
// There is no previous hit object hit by the current finger
67-
return 0.0;
68-
}
62+
TaikoDifficultyHitObject? taikoPrevious = current.Previous(1) as TaikoDifficultyHitObject;
63+
TaikoDifficultyHitObject? previousMono = taikoCurrent.PreviousMono(availableFingersFor(taikoCurrent) - 1);
6964

7065
double objectStrain = 0.5; // Add a base strain to all objects
71-
objectStrain += speedBonus(taikoCurrent.StartTime - keyPrevious.StartTime);
66+
if (taikoPrevious == null) return objectStrain;
67+
68+
if (previousMono != null)
69+
objectStrain += speedBonus(taikoCurrent.StartTime - previousMono.StartTime) + 0.5 * speedBonus(taikoCurrent.StartTime - taikoPrevious.StartTime);
70+
7271
return objectStrain;
7372
}
7473
}

Diff for: osu.Game.Rulesets.Taiko/Difficulty/Skills/Stamina.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System;
55
using osu.Game.Rulesets.Difficulty.Preprocessing;
66
using osu.Game.Rulesets.Difficulty.Skills;
7+
using osu.Game.Rulesets.Difficulty.Utils;
78
using osu.Game.Rulesets.Mods;
89
using osu.Game.Rulesets.Taiko.Difficulty.Evaluators;
910
using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing;
@@ -44,10 +45,12 @@ protected override double StrainValueAt(DifficultyHitObject current)
4445
var currentObject = current as TaikoDifficultyHitObject;
4546
int index = currentObject?.Colour.MonoStreak?.HitObjects.IndexOf(currentObject) ?? 0;
4647

48+
double monolengthBonus = 1 + Math.Min(Math.Max((index - 5) / 50.0, 0), 0.30);
49+
4750
if (singleColourStamina)
48-
return currentStrain / (1 + Math.Exp(-(index - 10) / 2.0));
51+
return DifficultyCalculationUtils.Logistic(-(index - 10) / 2.0, currentStrain);
4952

50-
return currentStrain;
53+
return currentStrain * monolengthBonus;
5154
}
5255

5356
protected override double CalculateInitialStrain(double time, DifficultyHitObject current) => singleColourStamina ? 0 : currentStrain * strainDecay(time - current.Previous(0).StartTime);

0 commit comments

Comments
 (0)