1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-11 14:04:37 +08:00
3
Breaking changes
Bartłomiej Dach edited this page 2026-05-27 11:00:22 +02:00

Occasionally we will make changes which require custom rulesets to make amendments to maintain compatibility. Wherever possible, we maintain compatibility via [Obsolete] attributes, but it is encouraged that you leave obsolete warnings turned on, and deal with them sooner rather than later. Generally we aim to leave obsolete methods around for 3-6 months after obsoletion.

This page serves to give a list of all breaking/major changes.

vNext

Mod.ScoreMultiplier obsoleted

To facilitate the implementation of new community-decided mod multipliers in official osu! rulesets, the Mod.ScoreMultiplier API has been obsoleted.

To adjust to this change, subclass ScoreMultiplierCalculator in your ruleset, move all mod multiplier specifications from Mod.ScoreMultiplier overrides to your subclass, and then override Ruleset.CreateScoreMultiplierCalculator() to return an instance of your created subclass.

For a reference on how to use ScoreMultiplierCalculator, see the XMLDoc on the class and the implementation of it for the osu! ruleset.

2022.901.0

Localisation support added for string return type methods

Mod.Description type has been changed

    // ...
-   public override string Description => "...";
+   public override LocalisableString Description => "...";
    // ...

ResumeOverlay.Message type has been changed

    // ...
-   protected override string Message => "...";
+   protected override LocalisableString Message => "...";
    // ...

Ruleset.GetDisplayNameForHitResult(HitResult) type has been changed

    // ...
-   public override string GetDisplayNameForHitResult(HitResult result)
+   public override LocalisableString GetDisplayNameForHitResult(HitResult result)
    // ...

Ruleset.GetVariantName(int variant) type has been changed

    // ...
-   public override string GetVariantName(int variant)
+   public override LocalisableString GetVariantName(int variant)
    // ...

2022.319.0

PerformanceCalculator method signatures have changed

The PerformanceCalculator signature has changed a bit in order for performance calculators to be constructed less during critical code paths. Refer to the following diff for required changes:

// Constructor signature.
- ctor(Ruleset ruleset, DifficultyAttributes attributes, ScoreInfo score);
+ ctor();

// These are the methods that actually perform the calculation:
- public virtual PerformanceAttributes Calculate();
+ protected virtual PerformanceAttributes CreatePerformanceAttributes(ScoreInfo score, DifficultyAttributes attributes);

// Helper methods to calculate performance:
+ public PerformanceAttributes Calculate(ScoreInfo score, DifficultyAttributes attributes);
+ public PerformanceAttributes Calculate(ScoreInfo score, IWorkingBeatmap beatmap);

// Ruleset API:
- public PerformanceCalculator CreatePerformanceCalculator(IWorkingBeatmap beatmap, ScoreInfo score);
- public virtual PerformanceCalculator CreatePerformanceCalculator(DifficultyAttributes attributes, ScoreInfo score);
+ public virtual PerformanceCalculator CreatePerformanceCalculator();

ScoreProcessor now requires a Ruleset construction parameter

Migration is simple: define a constructor on custom ScoreProcessor implementations and pass an instance of your Ruleset to the base constructor.

2022.205.0

FramedReplayInputHandler.CollectPendingInputs renamed to FramedReplayHandler.CollectReplayInputs

Accessibility has also changed from public to protected, however the rest of the method signature remains identical and a simple find-replace can be used to fix existing usages.