What are Rulesets?
Rulesets are osu!‘s architecture for creating custom gameplay modes. They allow developers to harness the power of the osu! beatmap library, game engine, and UI framework to create entirely new styles of gameplay. Each ruleset defines:- How beatmaps are converted and interpreted
- What hit objects exist and how they’re displayed
- Input handling and player interaction
- Scoring and judgement systems
- Difficulty and performance calculation
- Available mods and their effects
Core Architecture
Every custom ruleset must inherit from theRuleset base class and implement its abstract methods:
Ruleset Components
1. DrawableRuleset
The visual gameplay implementation that renders hit objects and manages playfield interaction. Location:osu.Game.Rulesets.UI.DrawableRuleset<TObject>
Responsibilities:
- Manages the playfield and its components
- Handles frame stability and timing
- Processes input through the input manager
- Coordinates with the scoring system
2. HitObjects
Define the elements players interact with during gameplay. Base class:osu.Game.Rulesets.Objects.HitObject
Key properties:
StartTime- When the object appearsSamples- Audio samples to play- Implement interfaces like
IHasPosition,IHasDurationfor additional behavior
3. BeatmapConverter
Converts standard osu! beatmaps into ruleset-specific hit objects. Base class:osu.Game.Beatmaps.BeatmapConverter<T>
Methods:
CanConvert()- Check if beatmap is compatibleConvertHitObject()- Transform each hit object
4. DifficultyCalculator
Calculates star rating and difficulty attributes. Base class:osu.Game.Rulesets.Difficulty.DifficultyCalculator
Required methods:
CreateDifficultyAttributes()- Generate difficulty resultsCreateDifficultyHitObjects()- Prepare objects for analysisCreateSkills()- Define difficulty calculation skills
5. Mods
Gameplay modifiers that alter mechanics, difficulty, or automation. Base class:osu.Game.Rulesets.Mods.Mod
Common mod types:
ModType.DifficultyIncrease- Makes the game harderModType.DifficultyReduction- Makes the game easierModType.Automation- Autoplay and assist modsModType.Conversion- Changes gameplay mechanicsModType.Fun- Visual or audio effects
Getting Started
osu! provides official ruleset templates to help you get started quickly:Install the templates
Templates are available in the osu! repository.
Create your ruleset
Choose between two template types:Freeform ruleset - For gameplay like osu!standard or osu!maniaScrolling ruleset - For gameplay like osu!taiko or osu!catch
Example: Pippidon Ruleset
The included example ruleset demonstrates core concepts:osu.Game.Rulesets.Pippidon/PippidonRuleset.cs
Key Interfaces
Many components use interfaces to provide specific functionality:Hit Object Interfaces
IHasPosition- Objects with X/Y coordinatesIHasDuration- Objects withEndTimeIHasPath- Slider-like objects with curvesIHasComboInformation- Combo counter behaviorIHasRepeats- Repeating patterns
Mod Interfaces
IApplicableToHitObject- Modify hit objectsIApplicableToDifficulty- Adjust difficulty settingsIApplicableToDrawableRuleset- Modify playfieldIApplicableToScoreProcessor- Change scoringIApplicableToRate- Alter playback speed
Community Rulesets
Explore existing custom rulesets for inspiration and learning:- Custom Ruleset Directory
- Browse community-created gameplay modes
- Learn from real-world implementations
- Share your own creations
Next Steps
Creating a Ruleset
Step-by-step guide to building your first ruleset
Hit Objects
Define gameplay elements and their behavior
Mods System
Create gameplay modifiers and effects
Difficulty Calculation
Implement star rating and performance points