mirror of https://github.com/ppy/osu
Add flag to disable computing legacy scoring values
This commit is contained in:
parent
87447f41d0
commit
06565871d6
|
@ -41,18 +41,23 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
|
|||
// this is the same as osu!, so there's potential to share the implementation... maybe
|
||||
double preempt = IBeatmapDifficultyInfo.DifficultyRange(beatmap.Difficulty.ApproachRate, 1800, 1200, 450) / clockRate;
|
||||
|
||||
CatchScoreV1Processor sv1Processor = new CatchScoreV1Processor(workingBeatmap.Beatmap, beatmap, mods);
|
||||
|
||||
return new CatchDifficultyAttributes
|
||||
CatchDifficultyAttributes attributes = new CatchDifficultyAttributes
|
||||
{
|
||||
StarRating = Math.Sqrt(skills[0].DifficultyValue()) * star_scaling_factor,
|
||||
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)),
|
||||
LegacyAccuracyScore = sv1Processor.AccuracyScore,
|
||||
LegacyComboScore = sv1Processor.ComboScore,
|
||||
LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio
|
||||
};
|
||||
|
||||
if (ComputeLegacyScoringValues)
|
||||
{
|
||||
CatchScoreV1Processor sv1Processor = new CatchScoreV1Processor(workingBeatmap.Beatmap, beatmap, mods);
|
||||
attributes.LegacyAccuracyScore = sv1Processor.AccuracyScore;
|
||||
attributes.LegacyComboScore = sv1Processor.ComboScore;
|
||||
attributes.LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio;
|
||||
}
|
||||
|
||||
return attributes;
|
||||
}
|
||||
|
||||
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
|
||||
|
|
|
@ -48,9 +48,7 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
|
|||
HitWindows hitWindows = new ManiaHitWindows();
|
||||
hitWindows.SetDifficulty(beatmap.Difficulty.OverallDifficulty);
|
||||
|
||||
ManiaScoreV1Processor sv1Processor = new ManiaScoreV1Processor(mods);
|
||||
|
||||
return new ManiaDifficultyAttributes
|
||||
ManiaDifficultyAttributes attributes = new ManiaDifficultyAttributes
|
||||
{
|
||||
StarRating = skills[0].DifficultyValue() * star_scaling_factor,
|
||||
Mods = mods,
|
||||
|
@ -58,8 +56,15 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
|
|||
// This is done the way it is to introduce fractional differences in order to match osu-stable for the time being.
|
||||
GreatHitWindow = Math.Ceiling((int)(getHitWindow300(mods) * clockRate) / clockRate),
|
||||
MaxCombo = beatmap.HitObjects.Sum(maxComboForObject),
|
||||
LegacyComboScore = sv1Processor.TotalScore
|
||||
};
|
||||
|
||||
if (ComputeLegacyScoringValues)
|
||||
{
|
||||
ManiaScoreV1Processor sv1Processor = new ManiaScoreV1Processor(mods);
|
||||
attributes.LegacyComboScore = sv1Processor.TotalScore;
|
||||
}
|
||||
|
||||
return attributes;
|
||||
}
|
||||
|
||||
private static int maxComboForObject(HitObject hitObject)
|
||||
|
|
|
@ -91,9 +91,7 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
|
|||
|
||||
double hitWindowGreat = hitWindows.WindowFor(HitResult.Great) / clockRate;
|
||||
|
||||
OsuScoreV1Processor sv1Processor = new OsuScoreV1Processor(workingBeatmap.Beatmap, beatmap, mods);
|
||||
|
||||
return new OsuDifficultyAttributes
|
||||
OsuDifficultyAttributes attributes = new OsuDifficultyAttributes
|
||||
{
|
||||
StarRating = starRating,
|
||||
Mods = mods,
|
||||
|
@ -109,10 +107,17 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
|
|||
HitCircleCount = hitCirclesCount,
|
||||
SliderCount = sliderCount,
|
||||
SpinnerCount = spinnerCount,
|
||||
LegacyAccuracyScore = sv1Processor.AccuracyScore,
|
||||
LegacyComboScore = sv1Processor.ComboScore,
|
||||
LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio
|
||||
};
|
||||
|
||||
if (ComputeLegacyScoringValues)
|
||||
{
|
||||
OsuScoreV1Processor sv1Processor = new OsuScoreV1Processor(workingBeatmap.Beatmap, beatmap, mods);
|
||||
attributes.LegacyAccuracyScore = sv1Processor.AccuracyScore;
|
||||
attributes.LegacyComboScore = sv1Processor.ComboScore;
|
||||
attributes.LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio;
|
||||
}
|
||||
|
||||
return attributes;
|
||||
}
|
||||
|
||||
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
|
||||
|
|
|
@ -89,9 +89,7 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
|
|||
HitWindows hitWindows = new TaikoHitWindows();
|
||||
hitWindows.SetDifficulty(beatmap.Difficulty.OverallDifficulty);
|
||||
|
||||
TaikoScoreV1Processor sv1Processor = new TaikoScoreV1Processor(workingBeatmap.Beatmap, beatmap, mods);
|
||||
|
||||
return new TaikoDifficultyAttributes
|
||||
TaikoDifficultyAttributes attributes = new TaikoDifficultyAttributes
|
||||
{
|
||||
StarRating = starRating,
|
||||
Mods = mods,
|
||||
|
@ -101,10 +99,17 @@ protected override DifficultyAttributes CreateDifficultyAttributes(IBeatmap beat
|
|||
PeakDifficulty = combinedRating,
|
||||
GreatHitWindow = hitWindows.WindowFor(HitResult.Great) / clockRate,
|
||||
MaxCombo = beatmap.HitObjects.Count(h => h is Hit),
|
||||
LegacyAccuracyScore = sv1Processor.AccuracyScore,
|
||||
LegacyComboScore = sv1Processor.ComboScore,
|
||||
LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio
|
||||
};
|
||||
|
||||
if (ComputeLegacyScoringValues)
|
||||
{
|
||||
TaikoScoreV1Processor sv1Processor = new TaikoScoreV1Processor(workingBeatmap.Beatmap, beatmap, mods);
|
||||
attributes.LegacyAccuracyScore = sv1Processor.AccuracyScore;
|
||||
attributes.LegacyComboScore = sv1Processor.ComboScore;
|
||||
attributes.LegacyBonusScoreRatio = sv1Processor.BonusScoreRatio;
|
||||
}
|
||||
|
||||
return attributes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -23,6 +23,13 @@ namespace osu.Game.Rulesets.Difficulty
|
|||
{
|
||||
public abstract class DifficultyCalculator
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether legacy scoring values (ScoreV1) should be computed to populate the difficulty attributes
|
||||
/// <see cref="DifficultyAttributes.LegacyAccuracyScore"/>, <see cref="DifficultyAttributes.LegacyComboScore"/>,
|
||||
/// and <see cref="DifficultyAttributes.LegacyBonusScoreRatio"/>.
|
||||
/// </summary>
|
||||
public bool ComputeLegacyScoringValues;
|
||||
|
||||
/// <summary>
|
||||
/// The beatmap for which difficulty will be calculated.
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue