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

Statistical accuracy PP and difficulty scaling for the osu!taiko ruleset #20963

Merged
merged 42 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
442e68a
Implement taiko deviation estimation
Natelytle Oct 25, 2022
d5b06ae
Fix difficultyvalue acc scaling
Natelytle Oct 25, 2022
607a006
oops
Natelytle Oct 25, 2022
87cba2d
Slight adjustments
Natelytle Oct 25, 2022
7d3338a
LTCA Balancing pass
Natelytle Oct 26, 2022
af919a6
harshen deviation scaling
Natelytle Oct 26, 2022
2940d18
Fix formatting
Natelytle Oct 27, 2022
883790c
Return null instead of infinity
Natelytle Oct 28, 2022
01c79d8
remove other infinity reference
Natelytle Oct 28, 2022
7403c1c
Return null for greatprobability >= 1
Natelytle Oct 29, 2022
16301f0
Fix low end accuracy, buff high end
Natelytle Oct 30, 2022
37c21cd
fix formatting
Natelytle Nov 1, 2022
2ba1634
account for low acc FC deviation
Natelytle Nov 25, 2022
0e4e92b
totalvalue
Natelytle Nov 25, 2022
b579af6
fix dt
Natelytle Nov 25, 2022
e3ef180
fixes
Natelytle Nov 25, 2022
7b5373a
add comments
Natelytle Nov 27, 2022
34533e5
Merge branch 'master' into taikostatacc
smoogipoo Nov 29, 2022
6a27206
bugfix + tests
Natelytle Dec 2, 2022
2b74c4e
tests return a greathitwindow of 0, add check
Natelytle Dec 3, 2022
45e8d18
fix extremely low OD breaking deviation calc
Natelytle Dec 6, 2022
334f60f
Reformat everything to be simpler
Natelytle Feb 22, 2023
d5ac73e
Merge remote-tracking branch 'osumaster/master' into taikostatacc
Natelytle Feb 23, 2023
adf1618
Change accuracy scaling
Natelytle Feb 23, 2023
858afcd
Pass OK hit window as a separate difficulty attribute, fix erfc appro…
Natelytle Mar 21, 2023
9aa11e0
update desmos
Natelytle Mar 21, 2023
7ee9101
Merge remote-tracking branch 'osumaster/master' into taikostatacc
Natelytle Jun 26, 2023
31c8cf0
Buff accuracy scaling
Natelytle Jul 28, 2023
4de0246
Make comments more professional
Natelytle Jul 28, 2023
faddc4f
Merge remote-tracking branch 'osumaster/master' into taikostatacc
Natelytle Jul 28, 2023
e569420
Serialize ok hit window attribute to db
Natelytle Jul 28, 2023
5f0020b
Reduce accuracy scaling
Natelytle Jul 31, 2023
3a609c9
Merge branch 'master' into taikostatacc
smoogipoo Aug 5, 2023
8a26cda
Merge master
Natelytle Mar 10, 2024
caba051
Compute the upper bound on deviation with a 99% confidence interval
Natelytle Mar 10, 2024
6ddb2b7
Include misses in the great window deviation calc
Natelytle Mar 10, 2024
5370595
Fix comment
Natelytle Mar 10, 2024
a9b3416
Remove MathNet.Numerics dependency
Natelytle Mar 10, 2024
1714567
Save deviation calculations to variables
Natelytle May 29, 2024
f8f18b6
Fix naming convention
Natelytle May 29, 2024
2fb22f1
Move the return value for deviation below the local functions
Natelytle Jun 23, 2024
84d6467
Merge branch 'master' into taikostatacc
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class TaikoPerformanceAttributes : PerformanceAttributes
[JsonProperty("effective_miss_count")]
public double EffectiveMissCount { get; set; }

[JsonProperty("estimated_ur")]
public double? EstimatedUR { get; set; }
Natelytle marked this conversation as resolved.
Show resolved Hide resolved

public override IEnumerable<PerformanceDisplayAttribute> GetAttributesForDisplay()
{
foreach (var attribute in base.GetAttributesForDisplay())
Expand Down
39 changes: 29 additions & 10 deletions osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Scoring;
using MathNet.Numerics;

namespace osu.Game.Rulesets.Taiko.Difficulty
{
Expand All @@ -20,7 +21,7 @@ public class TaikoPerformanceCalculator : PerformanceCalculator
private int countOk;
private int countMeh;
private int countMiss;
private double accuracy;
private double? estimatedDeviation;

private double effectiveMissCount;

Expand All @@ -37,7 +38,7 @@ protected override PerformanceAttributes CreatePerformanceAttributes(ScoreInfo s
countOk = score.Statistics.GetValueOrDefault(HitResult.Ok);
countMeh = score.Statistics.GetValueOrDefault(HitResult.Meh);
countMiss = score.Statistics.GetValueOrDefault(HitResult.Miss);
accuracy = customAccuracy;
estimatedDeviation = computeEstimatedDeviation(score, taikoAttributes);

// The effectiveMissCount is calculated by gaining a ratio for totalSuccessfulHits and increasing the miss penalty for shorter object counts lower than 1000.
if (totalSuccessfulHits > 0)
Expand All @@ -64,6 +65,7 @@ protected override PerformanceAttributes CreatePerformanceAttributes(ScoreInfo s
Difficulty = difficultyValue,
Accuracy = accuracyValue,
EffectiveMissCount = effectiveMissCount,
EstimatedUR = estimatedDeviation * 10,
Total = totalValue
};
}
Expand All @@ -84,35 +86,52 @@ private double computeDifficultyValue(ScoreInfo score, TaikoDifficultyAttributes
difficultyValue *= 1.025;

if (score.Mods.Any(m => m is ModHardRock))
difficultyValue *= 1.050;
difficultyValue *= 1.10;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the changes here already account for hit windows properly, and does not concern SV, why does hard rock specifically need to be buffed here?

Copy link
Member

@Lawtrohux Lawtrohux Oct 30, 2022

Choose a reason for hiding this comment

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

This was done in balancing, as mid-range accuracy with HR was pretty underweighted (4x 100 on the limit does not exist HR was worth 20pp less than a HD SS). Though @Natelytle could the model be fit for greater accuracy leniency on super high OD's?

Copy link
Contributor Author

@Natelytle Natelytle Oct 30, 2022

Choose a reason for hiding this comment

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

I don't think you can without increasing complexity and decreasing estimation accuracy, I think a HR multiplier buff is a better direction if HR in particular is underweight


if (score.Mods.Any(m => m is ModFlashlight<TaikoHitObject>))
difficultyValue *= 1.050 * lengthBonus;

return difficultyValue * Math.Pow(accuracy, 2.0);
if (estimatedDeviation == null)
return 0;

return difficultyValue * Math.Pow(SpecialFunctions.Erf(40 / (Math.Sqrt(2) * (double)estimatedDeviation)), 2.0);
Natelytle marked this conversation as resolved.
Show resolved Hide resolved
}

private double computeAccuracyValue(ScoreInfo score, TaikoDifficultyAttributes attributes)
{
if (attributes.GreatHitWindow <= 0)
if (attributes.GreatHitWindow <= 0 || estimatedDeviation == null)
return 0;

double accuracyValue = Math.Pow(60.0 / attributes.GreatHitWindow, 1.1) * Math.Pow(accuracy, 8.0) * Math.Pow(attributes.StarRating, 0.4) * 27.0;
double accuracyValue = Math.Pow(7.5 / (double)estimatedDeviation, 1.1) * Math.Pow(attributes.StarRating, 0.4) * 100.0;

double lengthBonus = Math.Min(1.15, Math.Pow(totalHits / 1500.0, 0.3));
accuracyValue *= lengthBonus;

// Slight HDFL Bonus for accuracy. A clamp is used to prevent against negative values
if (score.Mods.Any(m => m is ModFlashlight<TaikoHitObject>) && score.Mods.Any(m => m is ModHidden))
accuracyValue *= Math.Max(1.050, 1.075 * lengthBonus);
accuracyValue *= Math.Max(1.0, 1.05 * lengthBonus);

return accuracyValue;
}

private double? computeEstimatedDeviation(ScoreInfo score, TaikoDifficultyAttributes attributes)
{
if (totalHits == 0)
return null;

double greatProbability = 1 - (countOk + countMiss + 1.0) / (totalHits + 1.0);
Natelytle marked this conversation as resolved.
Show resolved Hide resolved

if (greatProbability <= 0 || greatProbability >= 1)
Natelytle marked this conversation as resolved.
Show resolved Hide resolved
{
return null;
}

double deviation = attributes.GreatHitWindow / (Math.Sqrt(2) * SpecialFunctions.ErfInv(greatProbability));

return deviation;
}

private int totalHits => countGreat + countOk + countMeh + countMiss;

private int totalSuccessfulHits => countGreat + countOk + countMeh;

private double customAccuracy => totalHits > 0 ? (countGreat * 300 + countOk * 150) / (totalHits * 300.0) : 0;
}
}
4 changes: 4 additions & 0 deletions osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@
<ItemGroup Label="Project References">
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
</ItemGroup>
Natelytle marked this conversation as resolved.
Show resolved Hide resolved
</Project>