Understanding the beatmap system in osu! - how beatmaps are stored, managed, and processed
Beatmaps are the core content of osu!, containing the gameplay patterns, metadata, and difficulty settings for each playable map. The beatmap system handles everything from importing and storing beatmaps to managing difficulty calculations and online status.
Beatmaps can have different online statuses that affect their visibility and whether they grant performance points:
1
LocallyModified
Beatmap has been edited locally via the editor. Online status changes are ignored.
2
Pending
Beatmap is uploaded but not yet ranked.
3
Qualified
Beatmap is in the qualification process for ranking.
4
Ranked
Official ranked status - grants performance points (PP).
5
Approved
Approved status - also grants performance points.
6
Loved
Community-loved beatmap - does not grant PP but appears in rankings.
Only Ranked and Approved beatmaps grant performance points:
public static bool GrantsPerformancePoints(this BeatmapOnlineStatus status) => status == BeatmapOnlineStatus.Ranked || status == BeatmapOnlineStatus.Approved;
Difficulties can be hidden from song select while keeping them in the database:
// Hide a difficulty (requires at least one other visible difficulty)public bool Hide(BeatmapInfo beatmapInfo)// Check if a difficulty can be hiddenpublic bool CanHide(BeatmapInfo beatmapInfo) => beatmapInfo.BeatmapSet!.Beatmaps.Count(b => !b.Hidden) > 1;// Restore a hidden difficultypublic void Restore(BeatmapInfo beatmapInfo)// Restore all hidden difficultiespublic void RestoreAll()
You cannot hide all difficulties in a beatmap set. At least one difficulty must remain visible.
Beatmaps maintain relationships with scores through hash matching:
public void UpdateLocalScores(Realm realm){ // Disassociate scores that no longer match foreach (var score in Scores) score.BeatmapInfo = null; // Associate scores matching the current hash foreach (var score in realm.All<ScoreInfo>().Where(s => s.BeatmapHash == Hash)) score.BeatmapInfo = this;}
Scores are matched to beatmaps via MD5 hash rather than ID, allowing scores to persist even when beatmaps are updated or reimported.
Beatmap sets may include background videos. The system provides tools to manage storage:
// Delete all videos from all beatmap setspublic void DeleteAllVideos()// Delete videos from specific beatmap setspublic void DeleteVideos(List<BeatmapSetInfo> items, bool silent = false)
Deleting videos can significantly reduce storage usage while keeping the beatmaps playable.