MouseDance MouseDance
MouseDance MouseDance
MouseDance User Docs powered by DocFx, DiscordFx

Search Results for

    Class BeatmapUtil

    Utility code for getting/deriving Beatmap properties.

    Inheritance
    Object
    BeatmapUtil
    Namespace: MouseDance.Runtime
    Assembly: MouseDance.Runtime.dll
    Syntax
    public static class BeatmapUtil

    Fields

    MEDIUM_HIT_SCORE

    Amount of score given if the player pressed a hit object within the 100 score hit-window.

    Declaration
    public const int MEDIUM_HIT_SCORE = 100
    Field Value
    Type Description
    Int32

    PERFECT_HIT_SCORE

    Amount of score given if the player pressed a hit object within the 300 score hit-window.

    Declaration
    public const int PERFECT_HIT_SCORE = 300
    Field Value
    Type Description
    Int32

    SMALLEST_HIT_SCORE

    Amount of score given if the player pressed a hit object within the 50 score hit-window.

    Declaration
    public const int SMALLEST_HIT_SCORE = 50
    Field Value
    Type Description
    Int32

    Methods

    DebugLog(Beatmap)

    Outputs properties of the Beatmap into the Unity console window. Use this for a quick test to see if your .osu file loaded correctly.

    Declaration
    public static void DebugLog(this Beatmap beatmap)
    Parameters
    Type Name Description
    OsuParsers.Beatmaps.Beatmap beatmap

    Beatmap that you want to Debug Log

    GetCircleRadius(Single)

    Get Radius of Hit Circles and Sliders given the Beatmap's Circle Size.

    Declaration
    public static float GetCircleRadius(float circleSize)
    Parameters
    Type Name Description
    Single circleSize

    0 to 10 value range

    Returns
    Type Description
    Single

    Radius, in osu!pixels.

    Remarks

    See official docs for Circle size.
    Higher Circle Size means smaller radius.

    Circle SizeRadius in osu!pixels
    054.4
    149.92
    245.44 (largest allowed in the osu editor)
    340.96
    436.48
    532 (default)
    627.52
    723.04 (smallest allowed in the osu editor)
    818.56
    914.08
    109.6

    GetFadeInDuration(Beatmap)

    For hit objects, this is the amount of time (in milliseconds) it fades in. After this duration, the hit object should be showing at 100% opacity. Formula comes from official docs on Approach rate.

    Declaration
    public static float GetFadeInDuration(this Beatmap beatmap)
    Parameters
    Type Name Description
    OsuParsers.Beatmaps.Beatmap beatmap
    Returns
    Type Description
    Single
    Remarks
                                           X = hit/collect
                 p r e e m p t             ↓
    ├───────────────────────┬──────────────┤
    0%       FADE IN          100% opacity

    GetFullOpacityDuration(Beatmap)

    For hit objects, this is the amount of time (in milliseconds) the hit object stays at 100% opacity. Formula comes from official docs on Approach rate.

    Declaration
    public static float GetFullOpacityDuration(this Beatmap beatmap)
    Parameters
    Type Name Description
    OsuParsers.Beatmaps.Beatmap beatmap
    Returns
    Type Description
    Single
    Remarks
                                           X = hit/collect
                 p r e e m p t             ↓
    ├───────────────────────┬──────────────┤
    0%       fade_in          100% opacity

    GetHitWindows(Beatmap)

    Time windows (in milliseconds) for getting score 50, 100, and 300 score. Higher scores have shorter time windows. This is affected by the Beatmap's Overall difficulty.

    Declaration
    public static (float, float, float) GetHitWindows(this Beatmap beatmap)
    Parameters
    Type Name Description
    OsuParsers.Beatmaps.Beatmap beatmap

    Beatmap to get the Overall difficulty from.

    Returns
    Type Description
    (T1, T2, T3)<Single, Single, Single>

    The time windows (in milliseconds) for getting each score, 50, 100, 300, respectively.

    Remarks

    See official docs on Overall difficulty.

    GetPreemptDuration(Beatmap)

    For hit objects, this is the total duration (in milliseconds) that it appears, starting from the time it fades in, until it is time to hit it. Formula comes from official docs on Approach rate.

    Declaration
    public static float GetPreemptDuration(this Beatmap beatmap)
    Parameters
    Type Name Description
    OsuParsers.Beatmaps.Beatmap beatmap
    Returns
    Type Description
    Single
    Remarks
                                           X = hit/collect
                 P R E E M P T             ↓
    ├───────────────────────┬──────────────┤
    0%       fade_in          100% opacity

    GetPreemptDuration(Single)

    For hit objects, this is the total duration (in milliseconds) that it appears, starting from the time it fades in, until it is time to hit it. Formula comes from official docs on Approach rate.

    Declaration
    public static float GetPreemptDuration(float approachRate)
    Parameters
    Type Name Description
    Single approachRate
    Returns
    Type Description
    Single
    Remarks
                                           X = hit/collect
                 P R E E M P T             ↓
    ├───────────────────────┬──────────────┤
    0%       fade_in          100% opacity

    GetSliderBaseScore(Int32, Int32)

    Out of the percent of pressed vs total, this will return SMALLEST_HIT_SCORE, MEDIUM_HIT_SCORE, or PERFECT_HIT_SCORE.

    Declaration
    public static int GetSliderBaseScore(int collected, int total)
    Parameters
    Type Name Description
    Int32 collected
    Int32 total
    Returns
    Type Description
    Int32
    Remarks
    Percent of collected vs totalReturn value
    00
    >0 to 1/3 (>0 to 33%)SMALLEST_HIT_SCORE
    1/3 to 2/3 (33% to 66%)MEDIUM_HIT_SCORE
    2/3 to 3/3 (66% to 100%)PERFECT_HIT_SCORE