Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lawtrohux committed Nov 15, 2024
1 parent 8c3889d commit 97e29fb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
{
public class EffectiveBPMLoader
public class EffectiveBPMPreprocessor
{
private readonly IList<TaikoDifficultyHitObject> noteObjects;
private readonly IReadOnlyList<TimingControlPoint?> timingControlPoints;
private readonly double globalSliderVelocity;

public EffectiveBPMLoader(IBeatmap beatmap, List<TaikoDifficultyHitObject> noteObjects)
public EffectiveBPMPreprocessor(IBeatmap beatmap, List<TaikoDifficultyHitObject> noteObjects)
{
this.noteObjects = noteObjects;
timingControlPoints = beatmap.ControlPointInfo.TimingPoints;
Expand All @@ -38,7 +38,7 @@ public void LoadEffectiveBPM(ControlPointInfo controlPointInfo, double clockRate
double currentSliderVelocity = calculateSliderVelocity(controlPointInfo, currentNoteObject.StartTime, clockRate);
currentNoteObject.CurrentSliderVelocity = currentSliderVelocity;

setEffectiveBPMForObject(currentNoteObject, currentControlPoint, currentSliderVelocity);
calculateEffectiveBPM(currentNoteObject, currentControlPoint, currentSliderVelocity);
}
}

Expand Down Expand Up @@ -68,7 +68,7 @@ private double calculateSliderVelocity(ControlPointInfo controlPointInfo, double
/// <summary>
/// Sets the effective BPM for the given note object.
/// </summary>
private void setEffectiveBPMForObject(TaikoDifficultyHitObject currentNoteObject, TimingControlPoint? currentControlPoint, double currentSliderVelocity)
private void calculateEffectiveBPM(TaikoDifficultyHitObject currentNoteObject, TimingControlPoint? currentControlPoint, double currentSliderVelocity)
{
if (currentControlPoint != null)
{
Expand Down
7 changes: 3 additions & 4 deletions osu.Game.Rulesets.Taiko/Difficulty/Skills/Reading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ public class Reading : StrainDecaySkill
private const double high_sv_multiplier = 1.0;

/// <summary>
/// Creates a <see cref="Rhythm"/> skill.
/// Creates a <see cref="Reading"/> skill.
/// </summary>
/// <param name="mods">Mods for use in skill calculations.</param>
public Reading(Mod[] mods)
: base(mods)
{
Expand All @@ -49,7 +48,7 @@ private double reading(DifficultyHitObject current)

// Only return a difficulty value when the Object isn't a Spinner or a Slider.
double sliderVelocityBonus = calculateHighVelocityBonus(noteObject.EffectiveBPM);
ObjectDensity = calculateObjectDensity(noteObject.DeltaTime, noteObject.EffectiveBPM, noteObject.CurrentSliderVelocity);
ObjectDensity = calculateObjectDensity(noteObject.DeltaTime, noteObject.CurrentSliderVelocity);

return high_sv_multiplier * sliderVelocityBonus;
}
Expand All @@ -71,7 +70,7 @@ private double calculateHighVelocityBonus(double effectiveBPM)
return sigmoid(effectiveBPM, center, range);
}

private double calculateObjectDensity(double deltaTime, double effectiveBPM, double currentSliderVelocity)
private double calculateObjectDensity(double deltaTime, double currentSliderVelocity)
{
// The maximum and minimum center value for density.
const double density_max = 300;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(I
List<TaikoDifficultyHitObject> centreObjects = new List<TaikoDifficultyHitObject>();
List<TaikoDifficultyHitObject> rimObjects = new List<TaikoDifficultyHitObject>();
List<TaikoDifficultyHitObject> noteObjects = new List<TaikoDifficultyHitObject>();
EffectiveBPMLoader bpmLoader = new EffectiveBPMLoader(beatmap, noteObjects);
EffectiveBPMPreprocessor bpmLoader = new EffectiveBPMPreprocessor(beatmap, noteObjects);

for (int i = 2; i < beatmap.HitObjects.Count; i++)
{
Expand Down Expand Up @@ -100,10 +100,10 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
// TODO: This is temporary measure as we don't detect abuse of multiple-input playstyles of converts within the current system.
if (beatmap.BeatmapInfo.Ruleset.OnlineID == 0)
{
starRating *= 0.925;
starRating *= 0.90;
// For maps with low colour variance and high stamina requirement, multiple inputs are more likely to be abused.
if (colourRating < 2 && staminaRating > 8)
starRating *= 0.90;
starRating *= 0.80;
}

HitWindows hitWindows = new TaikoHitWindows();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private double computeDifficultyValue(ScoreInfo score, TaikoDifficultyAttributes

// Scale accuracy more harshly on nearly-completely mono (single coloured) speed maps.
double accScalingExponent = 2 + attributes.MonoStaminaFactor;
double accScalingShift = 300 - 100 * attributes.MonoStaminaFactor;
double accScalingShift = 400 - 100 * attributes.MonoStaminaFactor;

return difficultyValue * Math.Pow(SpecialFunctions.Erf(accScalingShift / (Math.Sqrt(2) * estimatedUnstableRate.Value)), accScalingExponent);
}
Expand Down

0 comments on commit 97e29fb

Please sign in to comment.