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

Remove combo scaling from Aim and Speed from osu! performance calculation #16280

Merged
merged 44 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
cff9dab
Remove combo scaling and change miss penalty
apollo-dw Dec 14, 2021
86ad42a
Nerf length bonus
apollo-dw Dec 14, 2021
489aa43
Make miss penalty harsher
apollo-dw Dec 14, 2021
bac4cfe
Use frost's miss count penalty
apollo-dw Dec 16, 2021
60e2a8e
Use MathNet for miss penalty calculation, and use old penalty formula…
apollo-dw Dec 21, 2021
5640918
New miss penalty formula, using relevant difficult notes in each skil…
apollo-dw Dec 26, 2021
e9589e5
Fix logical error
apollo-dw Dec 27, 2021
d514567
Merge master
apollo-dw Dec 29, 2021
8ce6e3c
Remove mathnet
apollo-dw Dec 29, 2021
4f257d6
Clean up unsuccessful merge
apollo-dw Dec 29, 2021
fd1028f
Use clockrate in the difficult strain count method
apollo-dw Dec 29, 2021
d2b815b
Add miss penalty comment
apollo-dw Jan 2, 2022
75be4e8
Remove abusable 0.66 threshold by averaging
Luminiscental Jan 3, 2022
1320790
Remove unnecessary truncation
Luminiscental Jan 4, 2022
391110c
Remove abusable 0.66 threshold by averaging
apollo-dw Jan 4, 2022
443640a
Revert "Remove abusable 0.66 threshold by averaging"
apollo-dw Jan 4, 2022
f07bfcd
Merge pull request #6 from apollo-dw/revert-5-no-combo-scaling
apollo-dw Jan 4, 2022
dcb9693
Weight difficult strain count against the top strain
apollo-dw Jan 4, 2022
b3e90c3
Merge
apollo-dw Jan 4, 2022
400abc1
Add attribute ids to mapping functions
smoogipoo Jan 6, 2022
5989467
Reword comment and rename argument
apollo-dw Jan 12, 2022
1ae8ff0
Merge branch 'master' into no-combo-scaling
apollo-dw Feb 10, 2022
da31ca1
Use note strains instead of sectional strains
apollo-dw Feb 14, 2022
94a46ab
Rescale miss penalty for note strains
apollo-dw Feb 14, 2022
c18df86
Remove clockrate factor
apollo-dw Feb 19, 2022
580e43b
Merge branch 'master' into no-combo-scaling
apollo-dw Mar 3, 2022
0d4fe96
Merge branch 'master' into no-combo-scaling
apollo-dw Mar 17, 2022
2f335a7
Switch to using osuAttributes
apollo-dw Mar 17, 2022
23d0c03
Merge branch 'master' into no-combo-scaling
apollo-dw Oct 24, 2022
7d34542
use difficulty instead of topstrain
TextAdventurer12 Feb 22, 2024
0db910d
cap each note at adding 1 difficult strain count
TextAdventurer12 Feb 22, 2024
9f5f6b5
stop capping difficult strains per note
TextAdventurer12 Apr 6, 2024
b32d73e
adjust weighting function
TextAdventurer12 Apr 12, 2024
e2a5d19
adjust count difficult strains formula
TextAdventurer12 Apr 16, 2024
1d19bd2
Merge pull request #7 from TextAdventurer12/no-combo-scaling
apollo-dw May 11, 2024
9b60abe
Merge branch 'ppy:master' into no-combo-scaling
apollo-dw May 11, 2024
c1efcc0
Change miss penalty (nerf longer maps)
TextAdventurer12 May 21, 2024
9ff277c
Merge pull request #9 from TextAdventurer12/no-combo-scaling
apollo-dw May 21, 2024
20c54ab
Apply code quality changes
apollo-dw May 23, 2024
61afda1
Fix NaN case when difficulty is 0
apollo-dw May 26, 2024
c25e1bd
Use correct operation for 0 difficulty case
apollo-dw May 26, 2024
a7e1d35
Update osu.Game/Rulesets/Difficulty/DifficultyAttributes.cs
apollo-dw Sep 11, 2024
f54a5a5
Merge branch 'master' into no-combo-scaling
tsunyoku Oct 3, 2024
f30ac5d
Merge branch 'master' into no-combo-scaling
bdach Oct 7, 2024
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
6 changes: 6 additions & 0 deletions osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ public class OsuDifficultyAttributes : DifficultyAttributes
[JsonProperty("slider_factor")]
public double SliderFactor { get; set; }

[JsonProperty("aim_difficult_strain_count")]
public int AimDifficultStrainCount { get; set; }

[JsonProperty("speed_difficult_strain_count")]
public int SpeedDifficultStrainCount { get; set; }

[JsonProperty("approach_rate")]
public double ApproachRate { get; set; }

Expand Down
9 changes: 9 additions & 0 deletions osu.Game.Rulesets.Osu/Difficulty/OsuDifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat

double sliderFactor = aimRating > 0 ? aimRatingNoSliders / aimRating : 1;

int aimDifficultyStrainCount = ((OsuStrainSkill)skills[0]).RelevantDifficultStrains();
int speedDifficultyStrainCount = ((OsuStrainSkill)skills[2]).RelevantDifficultStrains();

// Total number of strains in a map can vary by clockrate, and this needs to be corrected for.
aimDifficultyStrainCount = (int)(aimDifficultyStrainCount * clockRate);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make RelevantDifficultStrains have clock rate as param instead? So that it'll be ((OsuStrainSkill)skills[0]).RelevantDifficultStrains(clockRate); and public int RelevantDifficultStrains(double clockRate)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, good idea.

speedDifficultyStrainCount = (int)(speedDifficultyStrainCount * clockRate);

if (mods.Any(h => h is OsuModRelax))
speedRating = 0.0;

Expand Down Expand Up @@ -78,6 +85,8 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
SpeedDifficulty = speedRating,
FlashlightDifficulty = flashlightRating,
SliderFactor = sliderFactor,
AimDifficultStrainCount = aimDifficultyStrainCount,
SpeedDifficultStrainCount = speedDifficultyStrainCount,
ApproachRate = preempt > 1200 ? (1800 - preempt) / 120 : (1200 - preempt) / 150 + 5,
OverallDifficulty = (80 - hitWindowGreat) / 6,
DrainRate = drainRate,
Expand Down
16 changes: 8 additions & 8 deletions osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,8 @@ private double computeAimValue()
(totalHits > 2000 ? Math.Log10(totalHits / 2000.0) * 0.5 : 0.0);
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.97 * Math.Pow(1 - Math.Pow((double)effectiveMissCount / totalHits, 0.775), effectiveMissCount);

aimValue *= getComboScalingFactor();
aimValue *= calculateMissPenalty(effectiveMissCount, Attributes.AimDifficultStrainCount);
Copy link

@SensouShin SensouShin Dec 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should calculate miss penalty only once and save it into a variable in my opinion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the penalties for aim and speed are different because AimDifficultStrainCount and SpeedDifficultStrainCount are different, so there is no repetition...


double approachRateFactor = 0.0;
if (Attributes.ApproachRate > 10.33)
Expand Down Expand Up @@ -142,11 +139,8 @@ private double computeSpeedValue()
(totalHits > 2000 ? Math.Log10(totalHits / 2000.0) * 0.5 : 0.0);
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.97 * Math.Pow(1 - Math.Pow((double)effectiveMissCount / totalHits, 0.775), Math.Pow(effectiveMissCount, .875));

speedValue *= getComboScalingFactor();
speedValue *= calculateMissPenalty(effectiveMissCount, Attributes.SpeedDifficultStrainCount);

double approachRateFactor = 0.0;
if (Attributes.ApproachRate > 10.33)
Expand Down Expand Up @@ -263,6 +257,12 @@ private int calculateEffectiveMissCount()
}

private double getComboScalingFactor() => Attributes.MaxCombo <= 0 ? 1.0 : Math.Min(Math.Pow(scoreMaxCombo, 0.8) / Math.Pow(Attributes.MaxCombo, 0.8), 1.0);

private double calculateMissPenalty(double missCount, double strainCount)
{
return 0.95 / ((missCount / (3 * Math.Sqrt(strainCount))) + 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably need some comments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really sure what I could comment here, and I don't think it'd end up being very helpful anyway? have you got anything specific in mind

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something about why exactly you need difficult strains here would be good I think. Basically just explain the idea so that people that have no idea what's going on could understand the motivation for this penalty

}

private int totalHits => countGreat + countOk + countMeh + countMiss;
private int totalSuccessfulHits => countGreat + countOk + countMeh;
}
Expand Down
7 changes: 7 additions & 0 deletions osu.Game.Rulesets.Osu/Difficulty/Skills/OsuStrainSkill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,12 @@ public override double DifficultyValue()

return difficulty * DifficultyMultiplier;
}

public int RelevantDifficultStrains()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xmldoc?

{
List<double> strains = GetCurrentStrainPeaks().OrderByDescending(d => d).ToList();

return strains.Count(s => s > strains[0] * 0.66);
}
}
}