Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 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
10 changes: 5 additions & 5 deletions PerformanceCalculator/PerformanceCalculator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<ItemGroup>
<PackageReference Include="Alba.CsConsoleFormat" Version="1.0.0" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="5.0.1" />
<PackageReference Include="ppy.osu.Game" Version="2026.317.0" />
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2026.317.0" />
<PackageReference Include="ppy.osu.Game.Rulesets.Taiko" Version="2026.317.0" />
<PackageReference Include="ppy.osu.Game.Rulesets.Catch" Version="2026.317.0" />
<PackageReference Include="ppy.osu.Game.Rulesets.Mania" Version="2026.317.0" />
<PackageReference Include="ppy.osu.Game" Version="2026.702.1" />
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2026.702.1" />
<PackageReference Include="ppy.osu.Game.Rulesets.Taiko" Version="2026.702.1" />
<PackageReference Include="ppy.osu.Game.Rulesets.Catch" Version="2026.702.1" />
<PackageReference Include="ppy.osu.Game.Rulesets.Mania" Version="2026.702.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ namespace PerformanceCalculatorGUI.Components
{
public class LegacyBeatmapMetadataDecoder : LegacyBeatmapDecoder
{
protected override void ParseLine(Beatmap beatmap, Section section, string line)
protected override void ParseLine(Beatmap beatmap, Section section, string line, bool isPrimaryStream)
{
// early out to only parse relevant data
if (section != Section.Metadata && section != Section.General)
return;

base.ParseLine(beatmap, section, line);
base.ParseLine(beatmap, section, line, isPrimaryStream);
}
}

Expand Down
8 changes: 4 additions & 4 deletions PerformanceCalculatorGUI/ExtendedCatchDifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public ExtendedCatchDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap b
public Skill[] GetSkills() => skills;
public DifficultyHitObject[] GetDifficultyHitObjects() => difficultyHitObjects;

protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, Mod[] mods)
{
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, mods).ToArray();
return difficultyHitObjects;
}

protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate)
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods)
{
skills = base.CreateSkills(beatmap, mods, clockRate);
skills = base.CreateSkills(beatmap, mods);
return skills;
}
}
Expand Down
8 changes: 4 additions & 4 deletions PerformanceCalculatorGUI/ExtendedManiaDifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public ExtendedManiaDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap b
public Skill[] GetSkills() => skills;
public DifficultyHitObject[] GetDifficultyHitObjects() => difficultyHitObjects;

protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, Mod[] mods)
{
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, mods).ToArray();
return difficultyHitObjects;
}

protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate)
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods)
{
skills = base.CreateSkills(beatmap, mods, clockRate);
skills = base.CreateSkills(beatmap, mods);
return skills;
}
}
Expand Down
8 changes: 4 additions & 4 deletions PerformanceCalculatorGUI/ExtendedOsuDifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public ExtendedOsuDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap bea
public Skill[] GetSkills() => skills;
public DifficultyHitObject[] GetDifficultyHitObjects() => difficultyHitObjects;

protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, Mod[] mods)
{
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, mods).ToArray();
return difficultyHitObjects;
}

protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate)
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods)
{
skills = base.CreateSkills(beatmap, mods, clockRate);
skills = base.CreateSkills(beatmap, mods);
return skills;
}
}
Expand Down
8 changes: 4 additions & 4 deletions PerformanceCalculatorGUI/ExtendedTaikoDifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public ExtendedTaikoDifficultyCalculator(IRulesetInfo ruleset, IWorkingBeatmap b
public Skill[] GetSkills() => skills;
public DifficultyHitObject[] GetDifficultyHitObjects() => difficultyHitObjects;

protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate)
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, Mod[] mods)
{
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, clockRate).ToArray();
difficultyHitObjects = base.CreateDifficultyHitObjects(beatmap, mods).ToArray();
return difficultyHitObjects;
}

protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate)
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods)
{
skills = base.CreateSkills(beatmap, mods, clockRate);
skills = base.CreateSkills(beatmap, mods);
return skills;
}
}
Expand Down
10 changes: 5 additions & 5 deletions PerformanceCalculatorGUI/PerformanceCalculatorGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2026.317.0" />
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2026.317.0" />
<PackageReference Include="ppy.osu.Game.Rulesets.Taiko" Version="2026.317.0" />
<PackageReference Include="ppy.osu.Game.Rulesets.Catch" Version="2026.317.0" />
<PackageReference Include="ppy.osu.Game.Rulesets.Mania" Version="2026.317.0" />
<PackageReference Include="ppy.osu.Game" Version="2026.702.1" />
<PackageReference Include="ppy.osu.Game.Rulesets.Osu" Version="2026.702.1" />
<PackageReference Include="ppy.osu.Game.Rulesets.Taiko" Version="2026.702.1" />
<PackageReference Include="ppy.osu.Game.Rulesets.Catch" Version="2026.702.1" />
<PackageReference Include="ppy.osu.Game.Rulesets.Mania" Version="2026.702.1" />
</ItemGroup>
</Project>
17 changes: 6 additions & 11 deletions PerformanceCalculatorGUI/RulesetHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Scoring;

Check failure

Code scanning / InspectCode

Redundant using directive Error

Using directive is not required by the code and can be safely removed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

namespace PerformanceCalculatorGUI
{
Expand Down Expand Up @@ -46,20 +47,14 @@
};
}

public static int AdjustManiaScore(int score, IReadOnlyList<Mod> mods)
public static int AdjustManiaScore(int score, IReadOnlyList<Mod> mods, Ruleset ruleset)
{
if (score != 1000000) return score;
if (score != 1000000)
return score;

double scoreMultiplier = 1;
var scoreMultiplierCalculator = ruleset.CreateScoreMultiplierCalculator(new ScoreMultiplierContext(new BeatmapDifficulty())); // we don't really care about the beatmap difficulty

// Cap score depending on difficulty adjustment mods (matters for mania).
foreach (var mod in mods)
{
if (mod.Type == ModType.DifficultyReduction)
scoreMultiplier *= mod.ScoreMultiplier;
}

return (int)Math.Round(1000000 * scoreMultiplier);
return (int)Math.Round(1000000 * scoreMultiplierCalculator.CalculateFor(mods));
}

public static Dictionary<HitResult, int> GenerateHitResultsForRuleset(RulesetInfo ruleset, double accuracy, IBeatmap beatmap, Mod[] mods, int countMiss, int? countMeh, int? countGood, int? countLargeTickMisses, int? countSliderTailMisses)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Difficulty.Evaluators;
using osu.Game.Rulesets.Osu.Difficulty.Evaluators.Aim;
using osu.Game.Rulesets.Osu.Difficulty.Evaluators.Speed;
using osu.Game.Rulesets.Osu.Difficulty.Preprocessing;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko.Difficulty.Evaluators;
using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing;
using osu.Game.Rulesets.Taiko.Objects;
Expand Down Expand Up @@ -134,16 +135,22 @@ private void drawOsuValues(OsuDifficultyHitObject hitObject)
new ObjectInspectorDifficultyValue("Position", (hitObject.BaseObject as OsuHitObject)!.StackedPosition),
new ObjectInspectorDifficultyValue("Delta Time", hitObject.DeltaTime),
new ObjectInspectorDifficultyValue("Adjusted Delta Time", hitObject.AdjustedDeltaTime),
new ObjectInspectorDifficultyValue("Doubletapness", hitObject.GetDoubletapness((OsuDifficultyHitObject)hitObject.Next(0))),
new ObjectInspectorDifficultyValue("Last Obj End Delta Time", hitObject.LastObjectEndDeltaTime),
new ObjectInspectorDifficultyValue("Doubletap Feasibility", hitObject.CalculateDoubleTapFeasibility((OsuDifficultyHitObject)hitObject.Next())),
new ObjectInspectorDifficultyValue("Jump Distance", hitObject.JumpDistance),
new ObjectInspectorDifficultyValue("Lazy Jump Dist", hitObject.LazyJumpDistance),
new ObjectInspectorDifficultyValue("Min Jump Dist", hitObject.MinimumJumpDistance),
new ObjectInspectorDifficultyValue("Min Jump Time", hitObject.MinimumJumpTime),

new ObjectInspectorDifficultyValue("Aim Difficulty", AimEvaluator.EvaluateDifficultyOf(hitObject, true)),
new ObjectInspectorDifficultyValue("Aim Difficulty (w/o sliders)", AimEvaluator.EvaluateDifficultyOf(hitObject, false)),
new ObjectInspectorDifficultyValue("Speed Difficulty", SpeedEvaluator.EvaluateDifficultyOf(hitObject, appliedMods.Value)),
new ObjectInspectorDifficultyValue("Rhythm Diff", osu.Game.Rulesets.Osu.Difficulty.Evaluators.RhythmEvaluator.EvaluateDifficultyOf(hitObject)),
new ObjectInspectorDifficultyValue(hidden ? "FLHD Difficulty" : "Flashlight Diff", FlashlightEvaluator.EvaluateDifficultyOf(hitObject, hidden)),
new ObjectInspectorDifficultyValue("Snap Aim Difficulty", SnapAimEvaluator.EvaluateDifficultyOf(hitObject, true)),
new ObjectInspectorDifficultyValue("Snap Aim Difficulty (w/o sliders)", SnapAimEvaluator.EvaluateDifficultyOf(hitObject, false)),
new ObjectInspectorDifficultyValue("Flow Aim Difficulty", FlowAimEvaluator.EvaluateDifficultyOf(hitObject, true)),
new ObjectInspectorDifficultyValue("Flow Aim Difficulty (w/o sliders)", FlowAimEvaluator.EvaluateDifficultyOf(hitObject, false)),
new ObjectInspectorDifficultyValue("Agility Difficulty", AgilityEvaluator.EvaluateDifficultyOf(hitObject)),
new ObjectInspectorDifficultyValue("Speed Difficulty", SpeedEvaluator.EvaluateDifficultyOf(hitObject)),
new ObjectInspectorDifficultyValue("Rhythm Difficulty", osu.Game.Rulesets.Osu.Difficulty.Evaluators.Speed.RhythmEvaluator.EvaluateDifficultyOf(hitObject)),
new ObjectInspectorDifficultyValue("Reading Difficulty", osu.Game.Rulesets.Osu.Difficulty.Evaluators.ReadingEvaluator.EvaluateDifficultyOf(hitObject, hidden)),
new ObjectInspectorDifficultyValue(hidden ? "FLHD Difficulty" : "Flashlight Diff", FlashlightEvaluator.EvaluateDifficultyOf(hitObject, appliedMods.Value)),
});

if (hitObject.Angle is not null)
Expand Down Expand Up @@ -173,17 +180,14 @@ private void drawOsuValues(OsuDifficultyHitObject hitObject)

private void drawTaikoValues(TaikoDifficultyHitObject hitObject)
{
double rhythmDifficulty =
osu.Game.Rulesets.Taiko.Difficulty.Evaluators.RhythmEvaluator.EvaluateDifficultyOf(hitObject, 2 * hitObject.BaseObject.HitWindows.WindowFor(HitResult.Great) / track.Rate);

flowContainer.AddRange(new[]
{
new ObjectInspectorDifficultyValue("Delta Time", hitObject.DeltaTime),
new ObjectInspectorDifficultyValue("Effective BPM", hitObject.EffectiveBPM),
new ObjectInspectorDifficultyValue("Rhythm Ratio", hitObject.RhythmData.Ratio),
new ObjectInspectorDifficultyValue("Colour Difficulty", ColourEvaluator.EvaluateDifficultyOf(hitObject)),
new ObjectInspectorDifficultyValue("Stamina Difficulty", StaminaEvaluator.EvaluateDifficultyOf(hitObject)),
new ObjectInspectorDifficultyValue("Rhythm Difficulty", rhythmDifficulty),
new ObjectInspectorDifficultyValue("Rhythm Difficulty", osu.Game.Rulesets.Taiko.Difficulty.Evaluators.RhythmEvaluator.EvaluateDifficultyOf(hitObject)),
});

if (hitObject.BaseObject is Hit hit)
Expand All @@ -207,9 +211,7 @@ private void drawCatchValues(CatchDifficultyHitObject hitObject)
new ObjectInspectorDifficultyValue("Last Player Position", hitObject.LastPlayerPosition),
new ObjectInspectorDifficultyValue("Distance Moved", hitObject.DistanceMoved),
new ObjectInspectorDifficultyValue("Exact Distance Moved", hitObject.ExactDistanceMoved),

// see https://github.com/ppy/osu/blob/a08f7327b11977f1de57b8a177bf26918ebfacda/osu.Game.Rulesets.Catch/Difficulty/Skills/Movement.cs#L36
new ObjectInspectorDifficultyValue("Movement Difficulty", MovementEvaluator.EvaluateDifficultyOf(hitObject, track.Rate)),
new ObjectInspectorDifficultyValue("Movement Difficulty", MovementEvaluator.EvaluateDifficultyOf(hitObject)),
});
}
}
Expand Down
Loading
Loading