Closed Minoxs closed 4 months ago
Oh interesting, I've never considered calculating performance attributes only from difficulty attributes without the actual map, am kinda surprised it even worked 😄 It does definitely seem useful, will check on it.
After some quick checkup I noticed that
passed_objects
which should just be the sum of the n_circles
, n_sliders
, and n_spinners
fields of the difficulty attributes.So your initial approach should be good to use again if you also specify the amount of passed objects by calculating it via the difficulty attributes, for osu!standard that is.
The use-case is appealing so even though hitobject count isn't strictly needed in mania difficulty attributes, adding it is probably justified so that the map is no longer necessary for mania performance calc, and thus not needed for any mode as long as attributes and passed objects are specified.
Will work on it 👍
Awesome! This will be super useful 😄
Finally finished the v1.0.0 release which properly supports performance calculation through either beatmap or attributes. 🎉
pub fn get_pp(attr: DifficultyAttributes, score: CScore) -> f64 {
rosu_pp::Performance::new(attr) // `new` method accepts both, attributes or a beatmap
.combo(score.combo)
.n300(score.n300)
.n100(score.n100)
.n50(score.n050)
.misses(score.misses) // `n_misses` -> `misses`
.calculate()
.pp()
}
Problem
I have been using rosu-pp to calculate scores in a project of mine, where I planned to calculate difficulty attributes once and reuse them constantly. This was working great up until v0.10.0.
It always returns 0 now.
The only way to fix this is loading the beatmap file and calculating PP from there... It'd be great to have the option to calculate PP straight from the difficulty attributes again.
Difficulty
Difficulty was being calculated this way:
Workaround
Changing it so that the pp calculation is done on the beatmap itself works just fine, only problem is that can't really cache the attributes and discard the map for future PP calculations.
p.s: Example code has been slightly adapted from the real thing, as seen here https://github.com/Minoxs/crosu-pp