Skip to content

Commit

Permalink
uncommited afile, applied original code
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenMine0502 committed Oct 27, 2021
1 parent b9d58a9 commit 013e6fd
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 34 deletions.
66 changes: 35 additions & 31 deletions osu.Game.Rulesets.Osu/Difficulty/Skills/Speed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ public class Speed : OsuStrainSkill
private const double min_speed_bonus = 75; // ~200BPM
private const double speed_balancing_factor = 40;

private const double min_doubletap_nerf = 0.75; // minimum speedBonus value (eventually on stacked)
private const double max_doubletap_nerf = 1.0; // maximum speedBonus value
private const double threshold_fully_contributing = 1.0; // minimum distance not influenced
private const double min_doubletap_nerf = 0.5; // minimum value (eventually on stacked)
private const double max_doubletap_nerf = 1.0; // maximum value
private const double threshold_doubletap_contributing = 1.5; // minimum distance not influenced (2.0 means it is not stacked at least)

private const double min_acute_stream_spam_nerf = 0.0; // minimum value (eventually on stacked)
private const double max_acute_stream_spam_nerf = 1.0; // maximum value
private const double threshold_acute_stream_spam_contributing = 2.0; // minimum distance not influenced (2.0 means it is not stacked at least)

private readonly double greatWindow;

Expand All @@ -56,38 +60,27 @@ protected override double StrainValueOf(DifficultyHitObject current)
double greatWindowFull = greatWindow * 2;
double speedWindowRatio = strainTime / greatWindowFull;

// Aim to nerf cheesy rhythms (Very fast consecutive doubles with large deltatimes between)
//if (osuPrevious != null && strainTime < greatWindowFull && osuPrevious.StrainTime > strainTime)
// strainTime = Interpolation.Lerp(osuPrevious.StrainTime, strainTime, speedWindowRatio);
//Aim to nerf cheesy rhythms(Very fast consecutive doubles with large deltatimes between)
if (osuPrevious != null && strainTime < greatWindowFull && osuPrevious.StrainTime > strainTime)
strainTime = Interpolation.Lerp(osuPrevious.StrainTime, strainTime, speedWindowRatio);

// Cap deltatime to the OD 300 hitwindow.
// 0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
//strainTime /= Math.Clamp((strainTime / greatWindowFull) / 0.93, 0.92, 1);
//Cap deltatime to the OD 300 hitwindow.
//0.93 is derived from making sure 260bpm OD8 streams aren't nerfed harshly, whilst 0.92 limits the effect of the cap.
strainTime /= Math.Clamp((strainTime / greatWindowFull) / 0.93, 0.92, 1);


double radius = ((OsuHitObject)osuCurrent.BaseObject).Radius;

double speedBonus = 1.0;
if (strainTime < min_speed_bonus)
{
double radius = ((OsuHitObject)osuCurrent.BaseObject).Radius;
/* a basecode to nerf acute high bpm stream and doubletap.
* because no one could do doubletap on spaced streams.
* finally it is multiplied on speedBonus.
*
* but this code make some speed players discourage.
* it makes hidamari no uta be taken about 150pp.
* and other stream maps be taken about 0-5pp in average.
** We could consider to apply this code on angleBonus **/
double multiplierForSpeedBonus = min_doubletap_nerf +
Math.Min(Math.Max(distance / (radius * threshold_fully_contributing), 1.0), 0.0)
* (max_doubletap_nerf - min_doubletap_nerf)
;
double multiplierSpeedBonus = min_doubletap_nerf +
Math.Max(Math.Min(distance / (radius * threshold_doubletap_contributing), 1.0), 0.0)
* (max_doubletap_nerf - min_doubletap_nerf);

speedBonus = 1 + Math.Pow((min_speed_bonus - strainTime) / speed_balancing_factor, 2)
* multiplierForSpeedBonus;
* multiplierSpeedBonus;
}


double angleBonus = 1.0;

if (osuCurrent.Angle != null && osuCurrent.Angle.Value < angle_bonus_begin)
Expand All @@ -96,11 +89,22 @@ protected override double StrainValueOf(DifficultyHitObject current)

if (osuCurrent.Angle.Value < pi_over_2)
{
angleBonus = 1.28;
if (distance < 90 && osuCurrent.Angle.Value < pi_over_4)
angleBonus += (1 - angleBonus) * Math.Min((90 - distance) / 10, 1);
else if (distance < 90)
angleBonus += (1 - angleBonus) * Math.Min((90 - distance) / 10, 1) * Math.Sin((pi_over_2 - osuCurrent.Angle.Value) / pi_over_4);
// nerf anglebonus on stacked acute stream spam

double multiplierAngleBonus = min_acute_stream_spam_nerf +
Math.Max(Math.Min(distance / (radius * threshold_acute_stream_spam_contributing), 1.0), 0.0)
* (max_acute_stream_spam_nerf - min_acute_stream_spam_nerf)
;

if (distance < 90)
if (osuCurrent.Angle.Value < pi_over_4)
angleBonus = (1.28 + (1 - 1.28) * Math.Min((90 - distance) / 10, 1)) * multiplierAngleBonus;
else
angleBonus = (1.28 + (1 - 1.28) * Math.Min((90 - distance) / 10, 1)
* Math.Sin((pi_over_2 - osuCurrent.Angle.Value) / pi_over_4)) * multiplierAngleBonus;
else
angleBonus = 1.28;
//angleBonus *= multiplier;
}
}

Expand Down
3 changes: 0 additions & 3 deletions osu.Game/FodyWeavers.xml

This file was deleted.

0 comments on commit 013e6fd

Please sign in to comment.