Skip to content

Commit

Permalink
Minor acc curve update
Browse files Browse the repository at this point in the history
  • Loading branch information
NSGolova committed Apr 17, 2023
1 parent 51a8968 commit 61d15f2
Showing 1 changed file with 54 additions and 2 deletions.
56 changes: 54 additions & 2 deletions Utils/ReplayUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,40 @@ static class ReplayUtils
(0.6, 0.217),
(0.0, 0.000) };

static List<(double, double)> pointList2 = new List<(double, double)> {
(1.0, 7.424),
(0.999, 6.241),
(0.9975, 5.158),
(0.995, 4.010),
(0.9925, 3.241),
(0.99, 2.700),
(0.9875, 2.303),
(0.985, 2.007),
(0.9825, 1.786),
(0.98, 1.618),
(0.9775, 1.490),
(0.975, 1.392),
(0.9725, 1.315),
(0.97, 1.256),
(0.965, 1.167),
(0.96, 1.094),
(0.955, 1.039),
(0.95, 1.000),
(0.94, 0.931),
(0.93, 0.867),
(0.92, 0.813),
(0.91, 0.768),
(0.9, 0.729),
(0.875, 0.650),
(0.85, 0.581),
(0.825, 0.522),
(0.8, 0.473),
(0.75, 0.404),
(0.7, 0.345),
(0.65, 0.296),
(0.6, 0.256),
(0.0, 0.000), };

public static float Curve(float acc)
{
int i = 0;
Expand All @@ -60,6 +94,24 @@ public static float Curve(float acc)
return (float)(pointList[i-1].Item2 + middle_dis * (pointList[i].Item2 - pointList[i-1].Item2));
}

public static float Curve2(float acc)
{
int i = 0;
for (; i < pointList2.Count; i++)
{
if (pointList2[i].Item1 <= acc) {
break;
}
}

if (i == 0) {
i = 1;
}

double middle_dis = (acc - pointList2[i-1].Item1) / (pointList2[i].Item1 - pointList2[i-1].Item1);
return (float)(pointList2[i-1].Item2 + middle_dis * (pointList2[i].Item2 - pointList2[i-1].Item2));
}

public static float AccRating(float? predictedAcc, float? passRating, float? techRating) {
float difficulty_to_acc;
if (predictedAcc > 0) {
Expand All @@ -85,8 +137,8 @@ private static (float, float, float) GetPp(float accuracy, float accRating, floa
{
passPP = 0;
}
float accPP = Curve(accuracy) * accRating * 34f;
float techPP = MathF.Exp(1.9f * accuracy) * techRating;
float accPP = Curve2(accuracy) * accRating * 34f;
float techPP = MathF.Exp(1.9f * accuracy) * 1.08f * techRating;

return (passPP, accPP, techPP);
}
Expand Down

0 comments on commit 61d15f2

Please sign in to comment.