Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 869bc39

Browse files
committed
Add changes for combo scaling removal
1 parent d2eb3c1 commit 869bc39

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

include/pp/performance/Beatmap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class Beatmap
2525
ScoreMultiplier,
2626
Flashlight,
2727
SliderFactor,
28+
AimDifficultStrainCount,
29+
SpeedDifficultStrainCount,
2830

2931
NumTypes,
3032
};

include/pp/performance/osu/OsuScore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class OsuScore : public Score
4545
void computeAccuracyValue(const Beatmap &beatmap);
4646
void computeFlashlightValue(const Beatmap &beatmap);
4747

48+
f32 calculateMissPenalty(f32 missCount, f32 strainCount);
4849
f32 getComboScalingFactor(const Beatmap &beatmap);
4950
};
5051

src/performance/Beatmap.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const std::unordered_map<std::string, Beatmap::EDifficultyAttributeType> Beatmap
1414
{"Score multiplier", ScoreMultiplier},
1515
{"Flashlight", Flashlight},
1616
{"Slider factor", SliderFactor},
17+
{"Aim difficult strain count", AimDifficultStrainCount},
18+
{"Speed difficult strain count", SpeedDifficultStrainCount},
1719
};
1820

1921
Beatmap::Beatmap(s32 id)

src/performance/osu/OsuScore.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
264263
f32 OsuScore::getComboScalingFactor(const Beatmap &beatmap)
265264
{
266265
float maxCombo = beatmap.DifficultyAttribute(_mods, Beatmap::MaxCombo);

0 commit comments

Comments
 (0)