Coder Social home page Coder Social logo

rosu-pp-js's Issues

Beatmap leaks memory

import * as fs from 'fs';
import * as rosu from "rosu-pp-js";

const file_path = `/mnt/f/osu!/beatmaps/53.osu`;
const bytes = fs.readFileSync(file_path);

while (true) {
    let beatmap = new rosu.Beatmap(bytes);
}

This MRE currently results in RAM usage steadily climbing up. This issue has most likely to do with rustwasm/wasm-bindgen#3917.

I believe the best "workaround" is to denote very clearly in the readme and documentation to call Beatmap.free manually.

No compatibility with ESM

Since the switch to wasm the compability with ESM faded, since it's now considered a commonjs only module. There is a workaround but i'd really wish to see native ESM back. Took me by surprise that my beatmap mirror just suddenly broke after upgrading packages lol

Some mod pp's are wrong

I came here to say that the PP calculations for some of the mods were wrong.

const map = fs.readFileSync('test.osu', 'utf-8'); //https://osu.ppy.sh/beatmapsets/1856862#taiko/3825077
const beatmap = new rosu.Beatmap(map);

//HD: 8
//HR: 16
//EZ: 2
//DT: 64
//HT: 256

let difficultyArgs = {
    mods: Tested with the above values.
};

let difficulty = new rosu
    .Difficulty(difficultyArgs)
    .calculate(beatmap);

const PP = new rosu
    .Performance()
    .calculate(difficulty);

console.log(PP.pp);

Result
Original PP => rosu-pp-js
HDSS: 759pp => 692.3902281341881(same as NM)
HRSS: 779pp => 751.8363331710395
EZSS: 620pp => 643.6490906614597
DTSS: 1275pp => 1275.1074471835482(Correct)
HTSS: 439pp => 439.4615725388199(Correct)

The calculation seems to be correct for mods that change speed.

Add setters to builders

As mentioned in #11, the classes Performance, Difficulty, and BeatmapAttributesBuilder should have setter methods to adjust their fields.

This might lead users to initialize each field with setters instead of using the more efficient constructor but that's a worthy tradeoff considering that there's currently no way to re-use a builder with just a single field modified for example.

Buffer support

Just wondering if it would be possible to add support for buffers instead of just file paths.

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.