From 869bc3942d8f3bbfa780946238f45e91cefd2f28 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Thu, 6 Jan 2022 16:36:18 +0900 Subject: [PATCH] Add changes for combo scaling removal --- include/pp/performance/Beatmap.h | 2 ++ include/pp/performance/osu/OsuScore.h | 1 + src/performance/Beatmap.cpp | 2 ++ src/performance/osu/OsuScore.cpp | 15 +++++++-------- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/pp/performance/Beatmap.h b/include/pp/performance/Beatmap.h index 34b802c..d934b35 100644 --- a/include/pp/performance/Beatmap.h +++ b/include/pp/performance/Beatmap.h @@ -25,6 +25,8 @@ class Beatmap ScoreMultiplier, Flashlight, SliderFactor, + AimDifficultStrainCount, + SpeedDifficultStrainCount, NumTypes, }; diff --git a/include/pp/performance/osu/OsuScore.h b/include/pp/performance/osu/OsuScore.h index 91c8dc3..4d1d39e 100644 --- a/include/pp/performance/osu/OsuScore.h +++ b/include/pp/performance/osu/OsuScore.h @@ -45,6 +45,7 @@ class OsuScore : public Score void computeAccuracyValue(const Beatmap &beatmap); void computeFlashlightValue(const Beatmap &beatmap); + f32 calculateMissPenalty(f32 missCount, f32 strainCount); f32 getComboScalingFactor(const Beatmap &beatmap); }; diff --git a/src/performance/Beatmap.cpp b/src/performance/Beatmap.cpp index cf72d78..226aa02 100644 --- a/src/performance/Beatmap.cpp +++ b/src/performance/Beatmap.cpp @@ -14,6 +14,8 @@ const std::unordered_map Beatmap {"Score multiplier", ScoreMultiplier}, {"Flashlight", Flashlight}, {"Slider factor", SliderFactor}, + {"Aim difficult strain count", AimDifficultStrainCount}, + {"Speed difficult strain count", SpeedDifficultStrainCount}, }; Beatmap::Beatmap(s32 id) diff --git a/src/performance/osu/OsuScore.cpp b/src/performance/osu/OsuScore.cpp index cd9ccbd..aed9e99 100644 --- a/src/performance/osu/OsuScore.cpp +++ b/src/performance/osu/OsuScore.cpp @@ -116,11 +116,8 @@ void OsuScore::computeAimValue(const Beatmap &beatmap) (numTotalHits > 2000 ? log10(static_cast(numTotalHits) / 2000.0f) * 0.5f : 0.0f); _aimValue *= lengthBonus; - // 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.97f * std::pow(1.0f - std::pow(_effectiveMissCount / static_cast(numTotalHits), 0.775f), _effectiveMissCount); - - _aimValue *= getComboScalingFactor(beatmap); + _aimValue *= calculateMissPenalty(_effectiveMissCount, beatmap.DifficultyAttribute(_mods, Beatmap::AimDifficultStrainCount)); f32 approachRate = beatmap.DifficultyAttribute(_mods, Beatmap::AR); f32 approachRateFactor = 0.0f; @@ -162,11 +159,8 @@ void OsuScore::computeSpeedValue(const Beatmap &beatmap) (numTotalHits > 2000 ? log10(static_cast(numTotalHits) / 2000.0f) * 0.5f : 0.0f); _speedValue *= lengthBonus; - // 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.97f * std::pow(1.0f - std::pow(_effectiveMissCount / static_cast(numTotalHits), 0.775f), std::pow(_effectiveMissCount, 0.875f)); - - _speedValue *= getComboScalingFactor(beatmap); + _speedValue *= calculateMissPenalty(_effectiveMissCount, beatmap.DifficultyAttribute(_mods, Beatmap::SpeedDifficultStrainCount)); f32 approachRate = beatmap.DifficultyAttribute(_mods, Beatmap::AR); f32 approachRateFactor = 0.0f; @@ -261,6 +255,11 @@ void OsuScore::computeFlashlightValue(const Beatmap &beatmap) _flashlightValue *= 0.98f + std::pow(beatmap.DifficultyAttribute(_mods, Beatmap::OD), 2.0f) / 2500.0f; } +f32 OsuScore::calculateMissPenalty(f32 missCount, f32 strainCount) +{ + return 0.94f / ((missCount / (2.0f * std::sqrt(strainCount))) + 1.0f); +} + f32 OsuScore::getComboScalingFactor(const Beatmap &beatmap) { float maxCombo = beatmap.DifficultyAttribute(_mods, Beatmap::MaxCombo);