ppy/osu · error · OverflowException

Value is too low

Error message

Value is too low

What it means

Thrown by Parsing.ParseFloat when the parsed float value is less than -parseLimit (default -int.MaxValue ≈ -2.15 billion). This is a range-guard that fires after the string is successfully parsed as a float but the result is unreasonably negative for beatmap coordinate/value contexts.

Source

Thrown at osu.Game/Beatmaps/Formats/Parsing.cs:22

using System;
using System.Globalization;

namespace osu.Game.Beatmaps.Formats
{
    /// <summary>
    /// Helper methods to parse from string to number and perform very basic validation.
    /// </summary>
    public static class Parsing
    {
        public const int MAX_COORDINATE_VALUE = 131072;

        public const double MAX_PARSE_VALUE = int.MaxValue;

        public static float ParseFloat(string input, float parseLimit = (float)MAX_PARSE_VALUE, bool allowNaN = false)
        {
            float output = float.Parse(input, CultureInfo.InvariantCulture);

            if (output < -parseLimit) throw new OverflowException("Value is too low");
            if (output > parseLimit) throw new OverflowException("Value is too high");

            if (!allowNaN && float.IsNaN(output)) throw new FormatException("Not a number");

            return output;
        }

        public static double ParseDouble(string input, double parseLimit = MAX_PARSE_VALUE, bool allowNaN = false)
        {
            double output = double.Parse(input, CultureInfo.InvariantCulture);

            if (output < -parseLimit) throw new OverflowException("Value is too low");
            if (output > parseLimit) throw new OverflowException("Value is too high");

            if (!allowNaN && double.IsNaN(output)) throw new FormatException("Not a number");

            return output;
        }

View on GitHub (pinned to d9c73e12ad)

Solutions

  1. Find the value shown in the context of the error and ensure it's within the acceptable range for its field.
  2. For coordinate values, ensure they're within ±131072 (MAX_COORDINATE_VALUE).
  3. Clamp or correct the offending value in the .osu/.osb file.
  4. If calling ParseFloat directly, pass an appropriate parseLimit for your use case.

Example fix

// before (.osu storyboard sprite line with extreme coordinate):
// Sprite,Background,Centre,"img.png",-999999999,0

// after:
// Sprite,Background,Centre,"img.png",0,0
Defensive patterns

Strategy: validation

Validate before calling

// Validate range before calling ParseFloat
float value = float.Parse(input, CultureInfo.InvariantCulture);
if (value < -parseLimit)
    throw new OverflowException($"Value {value} is below the minimum of {-parseLimit}");

Try / catch

try
{
    float x = Parsing.ParseFloat(input, Parsing.MAX_COORDINATE_VALUE);
}
catch (OverflowException ex) when (ex.Message == "Value is too low")
{
    Logger.Log($"Coordinate value {input} is below minimum", LoggingTarget.Database);
}

Prevention

When it happens

Trigger: Calling Parsing.ParseFloat(input) where input parses to a float below -parseLimit. With the default limit this requires a value below roughly -2.15 billion, but callers can pass a smaller parseLimit (e.g. Parsing.MAX_COORDINATE_VALUE=131072 for storyboard sprite positions) making the threshold much lower.

Common situations: A storyboard sprite position or beatmap value with an extremely negative number in the .osu/.osb file; a coordinate value that exceeds the MAX_COORDINATE_VALUE limit (131072) when ParseFloat is called with that limit; data corruption or a typo adding extra digits.

Related errors


AI-assisted analysis of ppy/osu@d9c73e12ad (2026-08-13). Data as JSON: /api/errors/744f798b0a3b16d0. Report an issue: GitHub.