wiki
Client/File_formats/osu_(file_format)查看官网原文 ↗
这篇还没汉化,先拿英文原文顶着。(有想看的页面?催更就完事了。)

.osu (file format)

.osu is a human-readable file format containing information about a beatmap.

Structure

The first line of the file specifies the file format version. For example, osu file format v14 is the latest version. (v128 for osu!(lazer).)

The following content is separated into sections, indicated by section titles in square brackets.

Section Description Content type
[General] General information about the beatmap key: value pairs
[Editor] Saved settings for the beatmap editor key: value pairs
[Metadata] Information used to identify the beatmap key:value pairs
[Difficulty] Difficulty settings key:value pairs
[Events] Beatmap and storyboard graphic events Comma-separated lists
[TimingPoints] Timing and control points Comma-separated lists
[Colours] Combo and skin colours key : value pairs
[HitObjects] Hit objects Comma-separated lists

General

Option Value type Description Default value
AudioFilename String Location of the audio file relative to the current folder
AudioLeadIn Integer Milliseconds of silence before the audio starts playing 0
AudioHash String Deprecated
PreviewTime Integer Time in milliseconds when the audio preview should start -1
Countdown Integer Speed of the countdown before the first hit object (0 = no countdown, 1 = normal, 2 = half, 3 = double) 1
SampleSet String Sample set that will be used if timing points do not override it (Normal, Soft, Drum) Normal
StackLeniency Decimal Multiplier for the threshold in time where hit objects placed close together stack (0–1) 0.7
Mode Integer Game mode (0 = osu!, 1 = osu!taiko, 2 = osu!catch, 3 = osu!mania) 0
LetterboxInBreaks 0 or 1 Whether or not breaks have a letterboxing effect 0
StoryFireInFront 0 or 1 Deprecated 1
UseSkinSprites 0 or 1 Whether or not the storyboard can use the user's skin images 0
AlwaysShowPlayfield 0 or 1 Deprecated 0
OverlayPosition String Draw order of hit circle overlays compared to hit numbers (NoChange = use skin setting, Below = draw overlays under numbers, Above = draw overlays on top of numbers) NoChange
SkinPreference String Preferred skin to use during gameplay
EpilepsyWarning 0 or 1 Whether or not a warning about flashing colours should be shown at the beginning of the map 0
CountdownOffset Integer Time in beats that the countdown starts before the first hit object 0
SpecialStyle 0 or 1 Whether or not the "N+1" style key layout is used for osu!mania 0
WidescreenStoryboard 0 or 1 Whether or not the storyboard allows widescreen viewing 0
SamplesMatchPlaybackRate 0 or 1 Whether or not sound samples will change rate when playing with speed-changing mods 0

Editor

These options are only relevant when opening maps in the beatmap editor. They do not affect gameplay.

Option Value type Description
Bookmarks Comma-separated list of integers Time in milliseconds of bookmarks
DistanceSpacing Decimal Distance snap multiplier
BeatDivisor Integer Beat snap divisor
GridSize Integer Grid size
TimelineZoom Decimal Scale factor for the object timeline

Metadata

Option Value type Description
Title String Romanised song title
TitleUnicode String Song title
Artist String Romanised song artist
ArtistUnicode String Song artist
Creator String Beatmap creator
Version String Difficulty name
Source String Original media the song was produced for
Tags Space-separated list of strings Search terms
BeatmapID Integer Difficulty ID
BeatmapSetID Integer Beatmap ID

Difficulty

Option Value type Description
HPDrainRate Decimal HP setting (0–10)
CircleSize Decimal CS setting (0–10)
OverallDifficulty Decimal OD setting (0–10)
ApproachRate Decimal AR setting (0–10)
SliderMultiplier Decimal Base slider velocity in hundreds of osu! pixels per beat
SliderTickRate Decimal Amount of slider ticks per beat

Events

Event syntax: eventType,startTime,eventParams

Backgrounds

Background syntax: 0,0,filename,xOffset,yOffset

Videos

Video syntax: Video,startTime,filename,xOffset,yOffset

Video may be replaced by 1.

Breaks

Break syntax: 2,startTime,endTime

2 may be replaced by Break.

Storyboards

Note: For information about storyboard syntax, see Storyboard Scripting.

Storyboards can be defined in a separate optional storyboard file with the .osb extension. External storyboards are shared between all difficulties in a beatmap.

Each beatmap may contain its own difficulty-specific storyboard, either in conjunction with the external storyboard or by itself.

Timing points

Each timing point influences a specified portion of the map, commonly called a "timing section". The .osu file format requires these to be sorted in chronological order.

Timing point syntax: time,beatLength,meter,sampleSet,sampleIndex,volume,uninherited,effects

Effects

Timing points have two extra effects that can be toggled using bits 0 and 3 (from least to most significant) in the effects integer:

The rest of the bits are unused.

Examples

10000,333.33,4,0,0,100,1,1
12000,-25,4,3,0,100,0,1

The first timing point at 10 seconds is uninherited, and sets:

The second timing point at 12 seconds is inherited, changing the slider velocity to 4x and the sample set to drum.

Colours

All options in this section represent colours. They are comma-separated triplets of integers 0–255, representing the red, green, and blue components of the colours.

Option Description
Combo#, where # is an integer Additive combo colours
SliderTrackOverride Additive slider track colour
SliderBorder Slider border colour

Hit objects

Hit object syntax: x,y,time,type,hitSound,objectParams,hitSample

Type

The hit object's type parameter is an 8-bit integer where each bit is a flag with special meaning.

Bit index Meaning
0 Marks the object as a hit circle
1 Marks the object as a slider
2 Marks the start of a new combo
3 Marks the object as a spinner
4, 5, 6 A 3-bit integer specifying how many combo colours to skip, a practice referred to as "colour hax". Only relevant if the object starts a new combo.
7 Marks the object as an osu!mania hold note.

Hitsounds

The hitSound bit flags determine which sounds will play when the object is hit:

Bit index Meaning
0 Normal
1 Whistle
2 Finish
3 Clap

If no bits are set, the normal hitsound is used by default.

In every mode except osu!mania, the LayeredHitSounds skin property forces the normal sound to be included regardless of bit 0's setting. It is enabled by default.

Custom hit samples

Usage of hitSample can further customise the sounds that play. It defaults to 0:0:0:0: if it is not written.

Hit sample syntax: normalSet:additionSet:index:volume:filename

normalSet and additionSet can be any of the following:

All of these options (besides volume) are used to determine which sound file to play for a given hitsound. The filename is <sampleSet>-hit<hitSound><index>.wav, where:

The sound file is loaded from the first of the following directories that contains a matching filename:

When filename is given, no addition sounds will be played, and this file in the beatmap directory is played instead.

Hit circles

Hit circles do not have additional objectParams.

Sliders

Slider syntax: x,y,time,type,hitSound,curveType|curvePoints,slides,length,edgeSounds,edgeSets,hitSample

Slider curves

When constructing curves for a slider, x and y are used for the first point, and curvePoints supply the rest.

There are four types of slider curves in osu!:

If the slider's length is longer than the defined curve, the slider will extend in a straight line from the end of the curve until it reaches the target length.

Notice

The slider's length can be used to determine the time it takes to complete the slider. length / (SliderMultiplier * 100 * SV) * beatLength tells how many milliseconds it takes to complete one slide of the slider (where SV is the slider velocity multiplier given by the effective inherited timing point, or 1 if there is none).

Slider hitsounds

Apart from edge hitsounds, sliders also have an ongoing hitsound whenever the player is in range of the slider's follow circle. The sound file is looped for as long as it is active.

This hitsound uses the hit object's hitSound and hitSample properties, but only the normal and whistle sounds are supported. Its filename is <sampleSet>-slider<hitSound><index>.wav, where hitSound is either slide for normal or whistle for whistle.

Spinners

Spinner syntax: x,y,time,type,hitSound,endTime,hitSample

Holds (osu!mania only)

Hold syntax: x,y,time,type,hitSound,endTime:hitSample

Examples

256,192,11000,21,2
256,192,11200,8,12,12000,3:0:0:80:
100,100,12600,6,1,B|200:200|250:200|250:200|300:150,2,310.123,2|1|2,0:0|0:0|0:2,0:0:0:0:

The first object is a hit circle:

The second object is a spinner:

The third object is a slider:

osu!taiko

osu!taiko's hit objects only use time to determine how they are placed on the play field, so x and y are ignored. Likewise, the only significant part of slider curves is length; curveType and curvePoints are only relevant when opening the map in the editor. Combo colours and new combos are ignored, and mode-specific hitsounds are used.

osu!catch

osu!catch's play field only uses the x-axis, so y is not relevant. Slider curves may utilise vertical space to achieve horizontal acceleration when they are flattened to a one-dimensional play field.

osu!mania

Similarly to osu!catch, osu!mania hit objects do not use y. x is used to determine the column; see the Holds section.