Giter Site home page Giter Site logo

emotionallove / beatmap-analyzer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ekgame/beatmap-analyzer

0.0 1.0 0.0 235 KB

Parser, difficulty and performance calculator for osu! beatmaps.

License: GNU General Public License v3.0

Java 100.00%

beatmap-analyzer's Introduction

Beatmap Analyzer

Beatmap Analyzer is a library for parsing osu! beatmap files, calculating their difficulty and performance values. Supports standard, Taiko and Mania gamemodes. Conversion from standard to other gamemodes is not supported yet.

The project started off as a port of oppai by Francesco149, but has since evolved in to a powerful library in own right.

Usage

// Parse a beatmap.
BeatmapParser parser = new BeatmapParser();
Beatmap beatmap = parser.parse(new File("beatmap.osu"));

// Calculate difficulty, optionally apply mods.
Difficulty difficulty = beatmap.getDifficulty(new Mods(Mod.HARDROCK));

// Get the star difficulty.
difficulty.getStars();

// Calculate performance.
Score score = Score.of(beatmap).combo(2358).accuracy(0.9971, 1).build();
Performance performance = diff.getPerformance(score);

// Get the performance value.
performance.getPerformance();

You can find more usage examples in the tests directory.

Accuracy

osu!

The algorithm for osu! standard treats sliders as hit circles. This is much more efficient, however it does produce a small error for both star difficulty and performance. It should still be accurate enough for most applications, because the error is only about 0.02pp.

osu!taiko

The algorithm for osu!taiko is the least tricky one and should be 100% accurate.

osu!mania

Due to the nature of osu!mania difficulty calculation, it is very hard to accurately calculate difficulty and performance. Expect about 10pp error for the top plays.

The problem lies in the original implementation of the difficulty calculator. Before calculating the difficulty, osu! tries to sort all objects by their timestamp. Unfortunately, to sort the objects .NET uses an unstable sorting algorithm, which may change the order of objects on the same timestamp. Depending on the version of .NET, either quicksort or introsort is used - both of which end up with different results. Even now you can find beatmaps that have different star difficulty on the website and the osu! client.

The official osu! server supposedly runs .NET 3.5 which uses quicksort, so this library tries to use that too. The difference of this algorithm implementation produces the error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.