@@ -116,11 +116,8 @@ void OsuScore::computeAimValue(const Beatmap &beatmap)
116116 (numTotalHits > 2000 ? log10 (static_cast <f32 >(numTotalHits) / 2000 .0f ) * 0 .5f : 0 .0f );
117117 _aimValue *= lengthBonus;
118118
119- // Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of misses.
120119 if (_effectiveMissCount > 0 )
121- _aimValue *= 0 .97f * std::pow (1 .0f - std::pow (_effectiveMissCount / static_cast <f32 >(numTotalHits), 0 .775f ), _effectiveMissCount);
122-
123- _aimValue *= getComboScalingFactor (beatmap);
120+ _aimValue *= calculateMissPenalty (_effectiveMissCount, beatmap.DifficultyAttribute (_mods, Beatmap::AimDifficultStrainCount));
124121
125122 f32 approachRate = beatmap.DifficultyAttribute (_mods, Beatmap::AR);
126123 f32 approachRateFactor = 0 .0f ;
@@ -162,11 +159,8 @@ void OsuScore::computeSpeedValue(const Beatmap &beatmap)
162159 (numTotalHits > 2000 ? log10 (static_cast <f32 >(numTotalHits) / 2000 .0f ) * 0 .5f : 0 .0f );
163160 _speedValue *= lengthBonus;
164161
165- // Penalize misses by assessing # of misses relative to the total # of objects. Default a 3% reduction for any # of misses.
166162 if (_effectiveMissCount > 0 )
167- _speedValue *= 0 .97f * std::pow (1 .0f - std::pow (_effectiveMissCount / static_cast <f32 >(numTotalHits), 0 .775f ), std::pow (_effectiveMissCount, 0 .875f ));
168-
169- _speedValue *= getComboScalingFactor (beatmap);
163+ _speedValue *= calculateMissPenalty (_effectiveMissCount, beatmap.DifficultyAttribute (_mods, Beatmap::SpeedDifficultStrainCount));
170164
171165 f32 approachRate = beatmap.DifficultyAttribute (_mods, Beatmap::AR);
172166 f32 approachRateFactor = 0 .0f ;
@@ -261,6 +255,11 @@ void OsuScore::computeFlashlightValue(const Beatmap &beatmap)
261255 _flashlightValue *= 0 .98f + std::pow (beatmap.DifficultyAttribute (_mods, Beatmap::OD), 2 .0f ) / 2500 .0f ;
262256}
263257
258+ f32 OsuScore::calculateMissPenalty (f32 missCount, f32 strainCount)
259+ {
260+ return 0 .94f / ((missCount / (2 .0f * std::sqrt (strainCount))) + 1 .0f );
261+ }
262+
264263f32 OsuScore::getComboScalingFactor (const Beatmap &beatmap)
265264{
266265 float maxCombo = beatmap.DifficultyAttribute (_mods, Beatmap::MaxCombo);
0 commit comments