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

Pp Refactoring: Merged multipliers that do the same thing #29293

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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,7 +20,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty
{
public class CatchDifficultyCalculator : DifficultyCalculator
{
private const double star_scaling_factor = 0.153;
private const double difficulty_multiplier = 4.59;

private float halfCatcherWidth;

Expand All @@ -41,7 +41,7 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat

CatchDifficultyAttributes attributes = new CatchDifficultyAttributes
{
StarRating = Math.Sqrt(skills[0].DifficultyValue()) * star_scaling_factor,
StarRating = Math.Sqrt(skills[0].DifficultyValue()) * difficulty_multiplier,
Mods = mods,
ApproachRate = preempt > 1200.0 ? -(preempt - 1800.0) / 120.0 : -(preempt - 1200.0) / 150.0 + 5.0,
MaxCombo = beatmap.HitObjects.Count(h => h is Fruit) + beatmap.HitObjects.OfType<JuiceStream>().SelectMany(j => j.NestedHitObjects).Count(h => !(h is TinyDroplet)),
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Catch/Difficulty/Skills/Movement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class Movement : StrainDecaySkill
private const float normalized_hitobject_radius = 41.0f;
private const double direction_change_bonus = 21.0;

protected override double SkillMultiplier => 900;
protected override double SkillMultiplier => 1;
protected override double StrainDecayBase => 0.2;

protected override double DecayWeight => 0.94;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty
{
public class ManiaDifficultyCalculator : DifficultyCalculator
{
private const double star_scaling_factor = 0.018;
private const double difficulty_multiplier = 0.018;

private readonly bool isForCurrentRuleset;
private readonly double originalOverallDifficulty;
Expand All @@ -48,7 +48,7 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat

ManiaDifficultyAttributes attributes = new ManiaDifficultyAttributes
{
StarRating = skills[0].DifficultyValue() * star_scaling_factor,
StarRating = skills[0].DifficultyValue() * difficulty_multiplier,
Mods = mods,
// In osu-stable mania, rate-adjustment mods don't affect the hit window.
// This is done the way it is to introduce fractional differences in order to match osu-stable for the time being.
Expand Down
10 changes: 4 additions & 6 deletions osu.Game.Rulesets.Mania/Difficulty/ManiaPerformanceCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ protected override PerformanceAttributes CreatePerformanceAttributes(ScoreInfo s
countMiss = score.Statistics.GetValueOrDefault(HitResult.Miss);
scoreAccuracy = calculateCustomAccuracy();

// Arbitrary initial value for scaling pp in order to standardize distributions across game modes.
// The specific number has no intrinsic meaning and can be adjusted as needed.
double multiplier = 8.0;
double multiplier = 1.0;

if (score.Mods.Any(m => m is ModNoFail))
multiplier *= 0.75;
Expand All @@ -59,9 +57,9 @@ protected override PerformanceAttributes CreatePerformanceAttributes(ScoreInfo s

private double computeDifficultyValue(ManiaDifficultyAttributes attributes)
{
double difficultyValue = Math.Pow(Math.Max(attributes.StarRating - 0.15, 0.05), 2.2) // Star rating to pp curve
* Math.Max(0, 5 * scoreAccuracy - 4) // From 80% accuracy, 1/20th of total pp is awarded per additional 1% accuracy
* (1 + 0.1 * Math.Min(1, totalHits / 1500)); // Length bonus, capped at 1500 notes
double difficultyValue = 8.0 * Math.Pow(Math.Max(attributes.StarRating - 0.15, 0.05), 2.2) // Star rating to pp curve
* Math.Max(0, 5 * scoreAccuracy - 4) // From 80% accuracy, 1/20th of total pp is awarded per additional 1% accuracy
* (1 + 0.1 * Math.Min(1, totalHits / 1500)); // Length bonus, capped at 1500 notes

return difficultyValue;
}
Expand Down
18 changes: 8 additions & 10 deletions osu.Game.Rulesets.Taiko/Difficulty/TaikoDifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
{
public class TaikoDifficultyCalculator : DifficultyCalculator
{
private const double difficulty_multiplier = 1.35;

private const double final_multiplier = 0.0625;
private const double rhythm_skill_multiplier = 0.2 * final_multiplier;
private const double colour_skill_multiplier = 0.375 * final_multiplier;
private const double stamina_skill_multiplier = 0.375 * final_multiplier;
private const double difficulty_multiplier = 0.084375;
private const double rhythm_skill_multiplier = 0.2 * difficulty_multiplier;
private const double colour_skill_multiplier = 0.375 * difficulty_multiplier;
private const double stamina_skill_multiplier = 0.375 * difficulty_multiplier;

public override int Version => 20221107;

Expand Down Expand Up @@ -83,11 +81,11 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
Rhythm rhythm = (Rhythm)skills.First(x => x is Rhythm);
Stamina stamina = (Stamina)skills.First(x => x is Stamina);

double colourRating = colour.DifficultyValue() * colour_skill_multiplier * difficulty_multiplier;
double rhythmRating = rhythm.DifficultyValue() * rhythm_skill_multiplier * difficulty_multiplier;
double staminaRating = stamina.DifficultyValue() * stamina_skill_multiplier * difficulty_multiplier;
double colourRating = colour.DifficultyValue() * colour_skill_multiplier;
double rhythmRating = rhythm.DifficultyValue() * rhythm_skill_multiplier;
double staminaRating = stamina.DifficultyValue() * stamina_skill_multiplier;

double combinedRating = combinedDifficultyValue(rhythm, colour, stamina) * difficulty_multiplier;
double combinedRating = combinedDifficultyValue(rhythm, colour, stamina);
double starRating = rescale(combinedRating * 1.4);

HitWindows hitWindows = new TaikoHitWindows();
Expand Down
Loading