Skip to content

Commit

Permalink
Merge pull request #16331 from stanriders/continuous-effective-misscount
Browse files Browse the repository at this point in the history
Don't floor `effectiveMissCount`
  • Loading branch information
smoogipoo authored Jan 19, 2022
2 parents 3e5d29e + dc755f4 commit 58bae9b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class OsuPerformanceCalculator : PerformanceCalculator
private int countMeh;
private int countMiss;

private int effectiveMissCount;
private double effectiveMissCount;

public OsuPerformanceCalculator(Ruleset ruleset, DifficultyAttributes attributes, ScoreInfo score)
: base(ruleset, attributes, score)
Expand Down Expand Up @@ -97,7 +97,7 @@ private double computeAimValue()

// Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of misses.
if (effectiveMissCount > 0)
aimValue *= 0.97 * Math.Pow(1 - Math.Pow((double)effectiveMissCount / totalHits, 0.775), effectiveMissCount);
aimValue *= 0.97 * Math.Pow(1 - Math.Pow(effectiveMissCount / totalHits, 0.775), effectiveMissCount);

aimValue *= getComboScalingFactor();

Expand Down Expand Up @@ -144,7 +144,7 @@ private double computeSpeedValue()

// Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of misses.
if (effectiveMissCount > 0)
speedValue *= 0.97 * Math.Pow(1 - Math.Pow((double)effectiveMissCount / totalHits, 0.775), Math.Pow(effectiveMissCount, .875));
speedValue *= 0.97 * Math.Pow(1 - Math.Pow(effectiveMissCount / totalHits, 0.775), Math.Pow(effectiveMissCount, .875));

speedValue *= getComboScalingFactor();

Expand Down Expand Up @@ -228,7 +228,7 @@ private double computeFlashlightValue()

// Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of misses.
if (effectiveMissCount > 0)
flashlightValue *= 0.97 * Math.Pow(1 - Math.Pow((double)effectiveMissCount / totalHits, 0.775), Math.Pow(effectiveMissCount, .875));
flashlightValue *= 0.97 * Math.Pow(1 - Math.Pow(effectiveMissCount / totalHits, 0.775), Math.Pow(effectiveMissCount, .875));

flashlightValue *= getComboScalingFactor();

Expand All @@ -244,7 +244,7 @@ private double computeFlashlightValue()
return flashlightValue;
}

private int calculateEffectiveMissCount()
private double calculateEffectiveMissCount()
{
// Guess the number of misses + slider breaks from combo
double comboBasedMissCount = 0.0;
Expand All @@ -256,10 +256,10 @@ private int calculateEffectiveMissCount()
comboBasedMissCount = fullComboThreshold / Math.Max(1.0, scoreMaxCombo);
}

// Clamp misscount since it's derived from combo and can be higher than total hits and that breaks some calculations
// Clamp miss count since it's derived from combo and can be higher than total hits and that breaks some calculations
comboBasedMissCount = Math.Min(comboBasedMissCount, totalHits);

return Math.Max(countMiss, (int)Math.Floor(comboBasedMissCount));
return Math.Max(countMiss, comboBasedMissCount);
}

private double getComboScalingFactor() => Attributes.MaxCombo <= 0 ? 1.0 : Math.Min(Math.Pow(scoreMaxCombo, 0.8) / Math.Pow(Attributes.MaxCombo, 0.8), 1.0);
Expand Down

0 comments on commit 58bae9b

Please sign in to comment.