Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement probability-based aim SR calculation for osu!standard to better assess length and miss penalty #30934

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8a582ee
Implement aim probability
Natelytle Mar 8, 2024
089b27d
Fix pp counter
Natelytle Mar 8, 2024
266e617
Make hitProbability abstract
Natelytle Mar 9, 2024
32e95a8
Move CreateBins method to Bin.cs
Natelytle Mar 21, 2024
5f759ff
Make FcProbability abstract
Natelytle Mar 25, 2024
e2930a0
Merge remote-tracking branch 'origin/aim_prob' into aim_prob
Natelytle Mar 25, 2024
fd53423
Restructuring
Natelytle Apr 2, 2024
ef0797a
Implement quartic curve fitting miss penalty
Natelytle Apr 23, 2024
8576689
Reduce polynomial to a cubic, move penalty slightly
Natelytle Apr 27, 2024
dd95140
Remove aimValue testing
Natelytle Apr 27, 2024
0e08858
Refactoring and test solving polynomial algebraically
Natelytle Apr 30, 2024
52984af
Bug fixes and a bit of refactorage
Natelytle Apr 30, 2024
632435e
Merge remote-tracking branch 'origin/master' into aim_prob_with_penalty
Natelytle Aug 3, 2024
03d963d
Merge branch 'master' into aim_prob_with_penalty
Natelytle Oct 13, 2024
7bd4c3d
Clean everything up
Natelytle Oct 13, 2024
c266c18
Merge branch 'master' into aim_prob_with_penalty
Natelytle Nov 30, 2024
45174a4
General cleanup, fixes, and renames
Natelytle Nov 30, 2024
153ff37
Code quality tests
Natelytle Dec 1, 2024
21ecb17
Fix the miss penalty polynomial being incorrect
Natelytle Dec 10, 2024
6b095a4
Merge branch 'pp-dev' into aim_prob_with_penalty
Natelytle Jan 18, 2025
99fa5f8
Add DifficultyCalculationUtils_Polynomial.cs and add CDF and PDF to D…
Natelytle Jan 18, 2025
f8ecc9a
Switch to using a quartic to fix precision issues
Natelytle Feb 9, 2025
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
Prev Previous commit
Next Next commit
Merge branch 'master' into aim_prob_with_penalty
# Conflicts:
#	osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
#	osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs
  • Loading branch information
Natelytle committed Nov 30, 2024
commit c266c18deb67d001df5d77d511fb475ba7bead62
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
double sliderFactor = aimRating > 0 ? aimRatingNoSliders / aimRating : 1;

ExpPolynomial aimMissPenaltyCurve = ((Aim)skills[0]).GetMissPenaltyCurve();
double speedDifficultyStrainCount = ((OsuStrainSkill)skills[2]).CountDifficultStrains();
double speedDifficultyStrainCount = ((OsuStrainSkill)skills[2]).CountTopWeightedStrains();

if (mods.Any(m => m is OsuModTouchDevice))
{
42 changes: 11 additions & 31 deletions osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Osu.Difficulty.Aggregation;
using osu.Game.Rulesets.Osu.Difficulty.Skills;
using osu.Game.Rulesets.Osu.Difficulty.Utils;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
@@ -141,7 +142,8 @@ private double computeAimValue(ScoreInfo score, OsuDifficultyAttributes attribut
double lengthBonus = 0.95 + 0.4 * Math.Min(1.0, totalHits / 2000.0) +
(totalHits > 2000 ? Math.Log10(totalHits / 2000.0) * 0.5 : 0.0);

aimValue *= calculateAimMissPenalty(effectiveMissCount, attributes);
if (effectiveMissCount > 0)
aimValue *= calculateCurveFittedMissPenalty(effectiveMissCount, attributes.AimMissPenaltyCurve);

double approachRateFactor = 0.0;
if (attributes.ApproachRate > 10.33)
@@ -205,7 +207,7 @@ private double computeSpeedValue(ScoreInfo score, OsuDifficultyAttributes attrib
speedValue *= lengthBonus;

if (effectiveMissCount > 0)
speedValue *= calculateMissPenalty(effectiveMissCount, attributes.SpeedDifficultStrainCount);
speedValue *= calculateStrainCountMissPenalty(effectiveMissCount, attributes.SpeedDifficultStrainCount);

double approachRateFactor = 0.0;
if (attributes.ApproachRate > 10.33)
@@ -304,37 +306,15 @@ private double computeFlashlightValue(ScoreInfo score, OsuDifficultyAttributes a
return flashlightValue;
}

private double calculateAimMissPenalty(double missCount, OsuDifficultyAttributes attributes)
{
double penalty = attributes.AimMissPenaltyCurve.GetPenaltyAt(missCount);

double multiplier = Math.Pow(1 - penalty, 1.5);

return multiplier;
}

private double calculateEffectiveMissCount(OsuDifficultyAttributes attributes)
{
// Guess the number of misses + slider breaks from combo
double comboBasedMissCount = 0.0;
// The miss penalty formulas assume that a player will miss on the hardest parts of a map.
// With the curve fitted miss penalty, we use a pre-computed curve of skill levels for each
// miss count, raised to the power of 1.5 to account for skill -> sr -> pp changing the exponent.
private double calculateCurveFittedMissPenalty(double missCount, ExpPolynomial curve) => Math.Pow(1 - curve.GetPenaltyAt(missCount), 1.5);

if (attributes.SliderCount > 0)
{
double fullComboThreshold = attributes.MaxCombo - 0.1 * attributes.SliderCount;
if (scoreMaxCombo < fullComboThreshold)
comboBasedMissCount = fullComboThreshold / Math.Max(1.0, scoreMaxCombo);
}

// Clamp miss count to maximum amount of possible breaks
comboBasedMissCount = Math.Min(comboBasedMissCount, countOk + countMeh + countMiss);

return Math.Max(countMiss, comboBasedMissCount);
}
// With the strain count miss penalty, we use the amount of relatively difficult sections to
// adjust miss penalty to make it more punishing on maps with lower amount of hard sections.
private double calculateStrainCountMissPenalty(double missCount, double difficultStrainCount) => 0.96 / ((missCount / (4 * Math.Pow(Math.Log(difficultStrainCount), 0.94))) + 1);

// Miss penalty assumes that a player will miss on the hardest parts of a map,
// so we use the amount of relatively difficult sections to adjust miss penalty
// to make it more punishing on maps with lower amount of hard sections.
private double calculateMissPenalty(double missCount, double difficultStrainCount) => 0.96 / ((missCount / (4 * Math.Pow(Math.Log(difficultStrainCount), 0.94))) + 1);
private double getComboScalingFactor(OsuDifficultyAttributes attributes) => attributes.MaxCombo <= 0 ? 1.0 : Math.Min(Math.Pow(scoreMaxCombo, 0.8) / Math.Pow(attributes.MaxCombo, 0.8), 1.0);
private int totalHits => countGreat + countOk + countMeh + countMiss;
private int totalImperfectHits => countOk + countMeh + countMiss;
You are viewing a condensed version of this merge commit. You can view the full changes here.