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

Add changes for combo scaling removal #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/pp/performance/Beatmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class Beatmap
ScoreMultiplier,
Flashlight,
SliderFactor,
AimDifficultStrainCount,
SpeedDifficultStrainCount,

NumTypes,
};
Expand Down
1 change: 1 addition & 0 deletions include/pp/performance/osu/OsuScore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
2 changes: 2 additions & 0 deletions src/performance/Beatmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const std::unordered_map<std::string, Beatmap::EDifficultyAttributeType> Beatmap
{"Score multiplier", ScoreMultiplier},
{"Flashlight", Flashlight},
{"Slider factor", SliderFactor},
{"Aim difficult strain count", AimDifficultStrainCount},
{"Speed difficult strain count", SpeedDifficultStrainCount},
};

Beatmap::Beatmap(s32 id)
Expand Down
15 changes: 7 additions & 8 deletions src/performance/osu/OsuScore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,8 @@ void OsuScore::computeAimValue(const Beatmap &beatmap)
(numTotalHits > 2000 ? log10(static_cast<f32>(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<f32>(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;
Expand Down Expand Up @@ -162,11 +159,8 @@ void OsuScore::computeSpeedValue(const Beatmap &beatmap)
(numTotalHits > 2000 ? log10(static_cast<f32>(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<f32>(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;
Expand Down Expand Up @@ -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);
Expand Down