ppy/osu · error · BeatmapInvalidForRulesetException
Beatmap can not be converted for the ruleset (ruleset: {rule
Error message
Beatmap can not be converted for the ruleset (ruleset: {ruleset.InstantiationInfo}, converter: {converter}). What it means
Thrown by WorkingBeatmap.GetPlayableBeatmap (BeatmapInvalidForRulesetException) when the beatmap has hit objects but the chosen ruleset's IBeatmapConverter.CanConvert() returns false — i.e. the ruleset cannot interpret this beatmap's hit object types. The message includes ruleset.InstantiationInfo and the converter type for diagnostics.
Source
Thrown at osu.Game/Beatmaps/WorkingBeatmap.cs:288
}
catch (OperationCanceledException)
{
throw new BeatmapLoadTimeoutException(BeatmapInfo);
}
}
public virtual IBeatmap GetPlayableBeatmap(IRulesetInfo ruleset, IReadOnlyList<Mod> mods, CancellationToken token)
{
var rulesetInstance = ruleset.CreateInstance();
if (rulesetInstance == null)
throw new RulesetLoadException("Creating ruleset instance failed when attempting to create playable beatmap.");
IBeatmapConverter converter = CreateBeatmapConverter(Beatmap, rulesetInstance);
// Check if the beatmap can be converted
if (Beatmap.HitObjects.Count > 0 && !converter.CanConvert())
throw new BeatmapInvalidForRulesetException($"{nameof(Beatmaps.Beatmap)} can not be converted for the ruleset (ruleset: {ruleset.InstantiationInfo}, converter: {converter}).");
// Apply conversion mods
foreach (var mod in mods.OfType<IApplicableToBeatmapConverter>())
{
token.ThrowIfCancellationRequested();
mod.ApplyToBeatmapConverter(converter);
}
// Convert
IBeatmap converted = converter.Convert(token);
// Apply conversion mods to the result
foreach (var mod in mods.OfType<IApplicableAfterBeatmapConversion>())
{
token.ThrowIfCancellationRequested();
mod.ApplyToBeatmap(converted);
}
View on GitHub (pinned to d9c73e12ad)
Solutions
- Match the ruleset to the beatmap's RulesetInfo / BeatmapInfo.Ruleset before calling GetPlayableBeatmap.
- Pre-check compatibility: instantiate the converter and call CanConvert() yourself, or compare beatmap.BeatmapInfo.Ruleset.OnlineID to the target ruleset.
- If cross-ruleset conversion is intended, ensure the target ruleset actually ships a converter for the source mode; otherwise reject the combination in the UI.
Example fix
// before
IBeatmap playable = working.GetPlayableBeatmap(someOtherRuleset, mods);
// after
if (working.BeatmapInfo.Ruleset.OnlineID != someOtherRuleset.OnlineID)
throw new InvalidOperationException("Beatmap ruleset does not match the requested ruleset.");
IBeatmap playable = working.GetPlayableBeatmap(someOtherRuleset, mods); Defensive patterns
Strategy: validation
Validate before calling
if (working.BeatmapInfo.Ruleset.OnlineID != targetRuleset.OnlineID)
throw new InvalidOperationException("Beatmap and requested ruleset modes differ.");
var playable = working.GetPlayableBeatmap(targetRuleset, mods); Type guard
static bool RulesetMatchesBeatmap(IBeatmapInfo beatmapInfo, IRulesetInfo ruleset)
=> beatmapInfo.Ruleset.OnlineID == ruleset.OnlineID; Try / catch
try { var playable = working.GetPlayableBeatmap(ruleset, mods); }
catch (BeatmapInvalidForRulesetException) { /* pick the beatmap's own ruleset instead */ } Prevention
- Always derive the gameplay ruleset from the beatmap's BeatmapInfo.Ruleset unless cross-mode conversion is intentional.
- If offering a ruleset picker, restrict choices to those with a converter for the beatmap mode.
- Pre-check converter.CanConvert() for custom flows.
When it happens
Trigger: Passing a beatmap authored for one ruleset (e.g. osu!mania .osu) to GetPlayableBeatmap with a different ruleset's RulesetInfo (e.g. osu!standard). The converter inspects hit object types/mode and refuses.
Common situations: Score migration, difficulty calculation, or custom screens that try a beatmap against the wrong ruleset; a UI control that lets the user pick any ruleset for any beatmap; programmatic cross-ruleset processing without a mode check.
Related errors
- Creating ruleset instance failed when attempting to create p
- Can't have zero or fewer stages.
- Timed out while loading beatmap ({beatmapInfo}).
- Repeat count is way too high
- Unknown hit object type: {split[3]}
AI-assisted analysis of ppy/osu@d9c73e12ad (2026-08-13).
Data as JSON: /api/errors/3463afe1f4ab8688.
Report an issue: GitHub.