Skip to content

Latest commit

 

History

History
104 lines (86 loc) · 2.79 KB

README.md

File metadata and controls

104 lines (86 loc) · 2.79 KB

About

Since there are now numerous outdated osu!mania performance calculators out there, I decided to put another one into the mix!

BEHOLD:

@mpp - A very light C++ osu!mania performance calculator.
@mpp2 - A very light C++ osu!mania performance calculator that abuses anything and everything to achieve better speed than it's predecessor mpp1.


Usage:

#include <stdio.h>
#include "mpp.h"

int main() {
    std::string location = "./test_map.osu";
    int score = 1000000;
    int mods = mpp::DT;

    mpp::calculator a((char*)location.c_str());
    a.setMods(mods);
    printf("Beatmap: %s - %s [%s] | %dK\n", a.bmap_data.artist.c_str(), a.bmap_data.title.c_str(), a.bmap_data.version.c_str(), a.bmap_data.keys);
    printf("Performance: %.2lf\n", a.getPerformance(score));
    printf("Difficulty: %.2lf\n", a.bmap_data.difficulty);
    return 0;
}

Example Output:

> ./test

Beatmap: Camellia - PLANET//SHAPER [GEOLOGICAL//IRRESOLUTION] | 4K
Performance: 914.44
Difficulty: 8.50

Average performance comparison between MPP v1 and v2:

MPP1 - Operation took: 119.68ms.
MPP2 - Operation took: 1.54ms.

Disclaimer: This calculator's algorithm is out of date and will not display 100% correct statistics compared to bancho's current algorithm.

If there are any brave volunteers who are in the know and wish to explain to me how the new algorithm works - I will gladly update mpp to make it up to date again!


Reference:

Methods:

Here is the class reference for the mpp::calculator class
If you do not wish to do mpp:: on the object you can also do using namespace mpp;

// Constructor:
// requires file location.
// you can also use the empty mpp constructor if you already have
// the map difficulty to only use the getPerformance(); method
mpp::calculator <obj_name>(<file_location>);
// ex:
mpp::calculator a; // can only use setMods(); & getPerformance();
mpp::calculator a("./test_map.osu");

// Setting mods
// Mods are located in the data struct mpp::mods
void <obj>.setMods(<mod_int>);
// ex:
a.setMods(64);
a.setMods(mpp::DT | mpp::NF);

// Calculating difficulty
// should be executed after if using setMods();
double <obj>.getDifficulty();
// ex:
a.getDifficulty();

// Calculating performance
// Will call getDifficulty(); if the calculator object has bmap_data.difficulty still at 0
// if score parameter is not passed, defaults to 1M
double <obj>.getPerformance([<score> = 1000000]);
// ex:
a.getPerformance();
a.getPerformance(850000);

// The beatmap data can be accessed from the calculator object using
mpp::beatmap_data <obj>.bmap_data;
// ex:
a.bmap_data.artist; // Returns the map artist

Mods:

mpp::NF;
mpp::EZ;
mpp::HT;
mpp::DT;
mpp::NC;

// Mixing mods
int mods = mpp::NF | mpp::DT;

Made with love by Jakatebel ♥