Skip to content

Commit

Permalink
modified aim algorithm and rebaanced
Browse files Browse the repository at this point in the history
  • Loading branch information
Xexxar committed Feb 15, 2024
1 parent cb108e9 commit aa5d839
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
20 changes: 15 additions & 5 deletions osu.Game.Rulesets.Osu/Difficulty/Evaluators/AimEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ current.BaseObject is Spinner ||

// Snap Stuff
// Reduce strain time by 25ms to account for stopping time.
double snapDifficulty = Math.Max(linearDifficulty * (2 * osuCurrObj.Radius / Math.Max(10, osuCurrObj.StrainTime - 40) + currMovement.Length / (osuCurrObj.StrainTime - 25)),
double snapDifficulty = Math.Max(linearDifficulty * (2 * osuCurrObj.Radius / Math.Max(10, Math.Max(osuCurrObj.StrainTime, osuLastObj0.StrainTime) - 40) + currMovement.Length / (osuCurrObj.StrainTime - 25)),
linearDifficulty * currMovement.Length / currTime);

double snapBuff = Math.Max(osuCurrObj.StrainTime, osuLastObj0.StrainTime) / (Math.Max(osuCurrObj.StrainTime, osuLastObj0.StrainTime) - 25);
Expand All @@ -92,17 +92,27 @@ current.BaseObject is Spinner ||
+ linearDifficulty * calculateAngleSpline(Math.Abs(currAngle), true) * Math.Min(Math.Min(currVelocity, prevVelocity), (currMovement - prevMovement).Length / Math.Max(osuCurrObj.StrainTime, osuLastObj0.StrainTime));
}

double flowVelChange = linearDifficulty * Math.Max(0, Math.Min(Math.Abs(currVelocity - prevVelocity) - Math.Min(currVelocity, prevVelocity), Math.Max(osuCurrObj.Radius / Math.Max(osuCurrObj.StrainTime, osuLastObj0.StrainTime), Math.Min(currVelocity, prevVelocity))));
// double flowVelChange = linearDifficulty * Math.Max(0, Math.Min(Math.Abs(currVelocity - prevVelocity) - Math.Min(currVelocity, prevVelocity), Math.Max(osuCurrObj.Radius / Math.Max(osuCurrObj.StrainTime, osuLastObj0.StrainTime), Math.Min(currVelocity, prevVelocity))));

// double flowVelChange = linearDifficulty * Math.Abs(prevVelocity - currVelocity) * rhythmRatio;
double flowVelChange = linearDifficulty * Math.Abs(prevVelocity - currVelocity);
double snapVelChange = linearDifficulty * Math.Max(0, Math.Min(Math.Abs(prevVelocity - currVelocity) - Math.Min(currVelocity, prevVelocity), Math.Max(osuCurrObj.Radius / Math.Max(osuCurrObj.StrainTime, osuLastObj0.StrainTime), Math.Min(currVelocity, prevVelocity))));

snapDifficulty += snapBuff * snapVelChange + snapAngle;
flowDifficulty += flowVelChange + flowAngle;

double snapFlowDifficulty = Math.Min((linearDifficulty * currMovement.Length / currTime) * (currMovement.Length / (osuCurrObj.Radius * 2))
+ Math.Max(linearDifficulty * (2 * osuLastObj0.Radius / Math.Max(10, Math.Max(osuLastObj0.StrainTime, osuLastObj1.StrainTime) - 40) + prevMovement.Length / (osuLastObj0.StrainTime - 25)),
linearDifficulty * prevMovement.Length / currTime),
(linearDifficulty * prevMovement.Length / currTime) * (prevMovement.Length / (osuLastObj0.Radius * 2))
+ Math.Max(linearDifficulty * (2 * osuCurrObj.Radius / Math.Max(10, Math.Max(osuCurrObj.StrainTime, osuLastObj0.StrainTime) - 40) + currMovement.Length / (osuCurrObj.StrainTime - 25)),
linearDifficulty * currMovement.Length / currTime));

flowDifficulty = Math.Min(snapFlowDifficulty, flowDifficulty);
snapDifficulty = Math.Min(snapFlowDifficulty, snapDifficulty);

// Apply balancing parameters.
flowDifficulty = flowDifficulty * 1.4125;
snapDifficulty = snapDifficulty * 0.79;
flowDifficulty = flowDifficulty * 1.4;
snapDifficulty = snapDifficulty * 0.8;

Check failure on line 115 in osu.Game.Rulesets.Osu/Difficulty/Evaluators/AimEvaluator.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Fix formatting

// Apply small CS buff.
snapDifficulty *= Math.Sqrt(linearDifficulty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
public static class RhythmEvaluator
{
private const int history_time_max = 5000; // 5 seconds of calculatingRhythmBonus max.
private const double rhythm_multiplier = 1.5;
private const double rhythm_multiplier = 1.0;

/// <summary>
/// Calculates a rhythm multiplier for the difficulty of the tap associated with historic data of the current <see cref="OsuDifficultyHitObject"/>.
Expand Down Expand Up @@ -50,7 +50,7 @@ public static double EvaluateDifficultyOf(DifficultyHitObject current)
double prevDelta = prevObj.StrainTime;
double lastDelta = lastObj.StrainTime;
double currRatio = Math.PI * Math.Min(5, Math.Max(prevDelta, currDelta) / Math.Min(prevDelta, currDelta));
currRatio = 1.0 + 8 * (-0.25 + Math.Min(0.75, Math.Max(0.25, Math.Pow(Math.Sin(currRatio), 2.0) + 0.2 * Math.Pow(Math.Sin(1.5 * currRatio), 2.0))));
currRatio = 1.0 + 12 * (-0.25 + Math.Min(0.75, Math.Max(0.25, Math.Pow(Math.Sin(currRatio), 2.0) + 0.2 * Math.Pow(Math.Sin(1.5 * currRatio), 2.0))));

double windowPenalty = Math.Min(1, Math.Max(0, Math.Abs(prevDelta - currDelta) - currObj.HitWindowGreat * 0.3) / (currObj.HitWindowGreat * 0.3));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ private double computeSpeedValue(ScoreInfo score, OsuDifficultyAttributes attrib

// Scale the speed value with speed deviation.
if (deviation != null)
speedValue *= 1.0 / (1.0 + Math.Pow((double)speedDeviation / (12.0 + Math.Pow(hitWindow300, .75)), 4.0));
speedValue *= 1.0 / (1.0 + Math.Pow((double)deviation / (10.0 + Math.Pow(hitWindow300, .75)), 4.0));

return speedValue;
}
Expand Down

0 comments on commit aa5d839

Please sign in to comment.