LTCA save me

This commit is contained in:
Nathen 2024-10-30 18:57:47 -04:00
parent 50be7fb077
commit 101a4028fa
4 changed files with 42 additions and 8 deletions

View File

@ -1,33 +1,51 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System;
using osu.Game.Rulesets.Difficulty.Preprocessing; using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Difficulty.Skills; using osu.Game.Rulesets.Difficulty.Skills;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Taiko.Difficulty.Evaluators; using osu.Game.Rulesets.Taiko.Difficulty.Evaluators;
using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing;
namespace osu.Game.Rulesets.Taiko.Difficulty.Skills namespace osu.Game.Rulesets.Taiko.Difficulty.Skills
{ {
/// <summary> /// <summary>
/// Calculates the stamina coefficient of taiko difficulty. /// Calculates the stamina coefficient of taiko difficulty.
/// </summary> /// </summary>
public class Stamina : StrainDecaySkill public class Stamina : StrainSkill
{ {
protected override double SkillMultiplier => 1.1; private double skillMultiplier => 1.1;
protected override double StrainDecayBase => 0.4; private double strainDecayBase => 0.4;
private bool onlyMono;
private double currentStrain;
/// <summary> /// <summary>
/// Creates a <see cref="Stamina"/> skill. /// Creates a <see cref="Stamina"/> skill.
/// </summary> /// </summary>
/// <param name="mods">Mods for use in skill calculations.</param> /// <param name="mods">Mods for use in skill calculations.</param>
public Stamina(Mod[] mods) /// <param name="onlyMono">I hate strangeprogram</param>
public Stamina(Mod[] mods, bool onlyMono)
: base(mods) : base(mods)
{ {
this.onlyMono = onlyMono;
} }
protected override double StrainValueOf(DifficultyHitObject current) private double strainDecay(double ms) => Math.Pow(strainDecayBase, ms / 1000);
protected override double StrainValueAt(DifficultyHitObject current)
{ {
return StaminaEvaluator.EvaluateDifficultyOf(current); currentStrain *= strainDecay(current.DeltaTime);
currentStrain += StaminaEvaluator.EvaluateDifficultyOf(current) * skillMultiplier;
if (onlyMono)
return ((TaikoDifficultyHitObject)current).Colour.MonoStreak?.RunLength >= 16 ? currentStrain : 0;
return currentStrain;
} }
protected override double CalculateInitialStrain(double time, DifficultyHitObject current) => onlyMono ? 0 : currentStrain * strainDecay(time - current.Previous(0).StartTime);
} }
} }

View File

@ -16,6 +16,12 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
[JsonProperty("stamina_difficulty")] [JsonProperty("stamina_difficulty")]
public double StaminaDifficulty { get; set; } public double StaminaDifficulty { get; set; }
/// <summary>
/// The ratio of stamina difficulty from mono-color streams to total stamina difficulty.
/// </summary>
[JsonProperty("mono_stamina_factor")]
public double MonoStaminaFactor { get; set; }
/// <summary> /// <summary>
/// The difficulty corresponding to the rhythm skill. /// The difficulty corresponding to the rhythm skill.
/// </summary> /// </summary>

View File

@ -38,7 +38,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
{ {
new Rhythm(mods), new Rhythm(mods),
new Colour(mods), new Colour(mods),
new Stamina(mods) new Stamina(mods, false),
new Stamina(mods, true)
}; };
} }
@ -79,10 +80,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
Colour colour = (Colour)skills.First(x => x is Colour); Colour colour = (Colour)skills.First(x => x is Colour);
Rhythm rhythm = (Rhythm)skills.First(x => x is Rhythm); Rhythm rhythm = (Rhythm)skills.First(x => x is Rhythm);
Stamina stamina = (Stamina)skills.First(x => x is Stamina); Stamina stamina = (Stamina)skills.First(x => x is Stamina);
Stamina staminaMonos = (Stamina)skills.Last(x => x is Stamina);
double colourRating = colour.DifficultyValue() * colour_skill_multiplier; double colourRating = colour.DifficultyValue() * colour_skill_multiplier;
double rhythmRating = rhythm.DifficultyValue() * rhythm_skill_multiplier; double rhythmRating = rhythm.DifficultyValue() * rhythm_skill_multiplier;
double staminaRating = stamina.DifficultyValue() * stamina_skill_multiplier; double staminaRating = stamina.DifficultyValue() * stamina_skill_multiplier;
double monoStaminaRating = staminaMonos.DifficultyValue() * stamina_skill_multiplier;
double monoStaminaFactor = Math.Pow(monoStaminaRating / staminaRating, 5);
double combinedRating = combinedDifficultyValue(rhythm, colour, stamina); double combinedRating = combinedDifficultyValue(rhythm, colour, stamina);
double starRating = rescale(combinedRating * 1.4); double starRating = rescale(combinedRating * 1.4);
@ -95,6 +100,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
StarRating = starRating, StarRating = starRating,
Mods = mods, Mods = mods,
StaminaDifficulty = staminaRating, StaminaDifficulty = staminaRating,
MonoStaminaFactor = monoStaminaFactor,
RhythmDifficulty = rhythmRating, RhythmDifficulty = rhythmRating,
ColourDifficulty = colourRating, ColourDifficulty = colourRating,
PeakDifficulty = combinedRating, PeakDifficulty = combinedRating,

View File

@ -95,7 +95,11 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
if (estimatedUnstableRate == null) if (estimatedUnstableRate == null)
return 0; return 0;
return difficultyValue * Math.Pow(SpecialFunctions.Erf(400 / (Math.Sqrt(2) * estimatedUnstableRate.Value)), 2.0); // Scale accuracy more harshly on nearly-completely mono speed maps.
double accScalingExponent = 2 + attributes.MonoStaminaFactor;
double accScalingShift = 300 - 100 * attributes.MonoStaminaFactor;
return difficultyValue * Math.Pow(SpecialFunctions.Erf(accScalingShift / (Math.Sqrt(2) * estimatedUnstableRate.Value)), accScalingExponent);
} }
private double computeAccuracyValue(ScoreInfo score, TaikoDifficultyAttributes attributes, bool isConvert) private double computeAccuracyValue(ScoreInfo score, TaikoDifficultyAttributes attributes, bool isConvert)