{"record":{"id":"3463afe1f4ab8688","repo":"ppy/osu","slug":"beatmap-can-not-be-converted-for-the-ruleset-rule","errorCode":null,"errorMessage":"Beatmap can not be converted for the ruleset (ruleset: {ruleset.InstantiationInfo}, converter: {converter}).","messagePattern":"Beatmap can not be converted for the ruleset \\(ruleset: (.+?), converter: (.+?)\\)\\.","errorType":"exception","errorClass":"BeatmapInvalidForRulesetException","httpStatus":null,"severity":"error","filePath":"osu.Game/Beatmaps/WorkingBeatmap.cs","lineNumber":288,"sourceCode":"            }\r\n            catch (OperationCanceledException)\r\n            {\r\n                throw new BeatmapLoadTimeoutException(BeatmapInfo);\r\n            }\r\n        }\r\n\r\n        public virtual IBeatmap GetPlayableBeatmap(IRulesetInfo ruleset, IReadOnlyList<Mod> mods, CancellationToken token)\r\n        {\r\n            var rulesetInstance = ruleset.CreateInstance();\r\n\r\n            if (rulesetInstance == null)\r\n                throw new RulesetLoadException(\"Creating ruleset instance failed when attempting to create playable beatmap.\");\r\n\r\n            IBeatmapConverter converter = CreateBeatmapConverter(Beatmap, rulesetInstance);\r\n\r\n            // Check if the beatmap can be converted\r\n            if (Beatmap.HitObjects.Count > 0 && !converter.CanConvert())\r\n                throw new BeatmapInvalidForRulesetException($\"{nameof(Beatmaps.Beatmap)} can not be converted for the ruleset (ruleset: {ruleset.InstantiationInfo}, converter: {converter}).\");\r\n\r\n            // Apply conversion mods\r\n            foreach (var mod in mods.OfType<IApplicableToBeatmapConverter>())\r\n            {\r\n                token.ThrowIfCancellationRequested();\r\n                mod.ApplyToBeatmapConverter(converter);\r\n            }\r\n\r\n            // Convert\r\n            IBeatmap converted = converter.Convert(token);\r\n\r\n            // Apply conversion mods to the result\r\n            foreach (var mod in mods.OfType<IApplicableAfterBeatmapConversion>())\r\n            {\r\n                token.ThrowIfCancellationRequested();\r\n                mod.ApplyToBeatmap(converted);\r\n            }\r\n\r","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/ppy/osu/blob/d9c73e12adff2feaae4a3e158d36fe5883faf6ca/osu.Game/Beatmaps/WorkingBeatmap.cs#L270-L306","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nIBeatmap playable = working.GetPlayableBeatmap(someOtherRuleset, mods);\n\n// after\nif (working.BeatmapInfo.Ruleset.OnlineID != someOtherRuleset.OnlineID)\n    throw new InvalidOperationException(\"Beatmap ruleset does not match the requested ruleset.\");\nIBeatmap playable = working.GetPlayableBeatmap(someOtherRuleset, mods);","handlingStrategy":"validation","validationCode":"if (working.BeatmapInfo.Ruleset.OnlineID != targetRuleset.OnlineID)\n    throw new InvalidOperationException(\"Beatmap and requested ruleset modes differ.\");\nvar playable = working.GetPlayableBeatmap(targetRuleset, mods);","typeGuard":"static bool RulesetMatchesBeatmap(IBeatmapInfo beatmapInfo, IRulesetInfo ruleset)\n    => beatmapInfo.Ruleset.OnlineID == ruleset.OnlineID;","tryCatchPattern":"try { var playable = working.GetPlayableBeatmap(ruleset, mods); }\ncatch (BeatmapInvalidForRulesetException) { /* pick the beatmap's own ruleset instead */ }","preventionTips":["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."],"tags":["ruleset","beatmap","conversion","gameplay","validation"],"backgroundTag":null,"analyzedSha":"d9c73e12adff2feaae4a3e158d36fe5883faf6ca","analyzedAt":"2026-08-13T14:12:54.015Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}