MaxOhn / rosu-pp

PP and star calculation for all osu! gamemodes
MIT License
79 stars 40 forks source link

Results from `OsuPerformanceAttributes.state()` are inconsistent with expectations #40

Closed HollisMeynell closed 1 month ago

HollisMeynell commented 1 month ago

In the code below, the results of p1 and p2 are inconsistent in most tests.

I'm not sure if this is the expected behavior, but the result of p1 does not match the osu! result, whereas p2 is correct.

You can test this with any beatmap. (max combo > 190)

let mut state = ScoreState::new();
state.max_combo = 190;
state.n50 = 8;
state.misses = 8;

let p1   = Performance::new(attr.clone())
    .state(state)
    .mods(1<<3)
    .accuracy(88.8)
    .calculate();

let p2 = Performance::new(attr.clone())
    .combo(190)
    .n50(8)
    .misses(8)
    .mods(1<<3)
    .accuracy(88.8)
    .calculate();

println!("{:?}", &p1.pp());
println!("{:?}", &p2.pp());
MaxOhn commented 1 month ago

This is intended behavior.

You may have only modified the state's max_combo, n50, and misses, but using this state will also put n300 and n100 explicitly on 0, whereas for p2 you don't specify n300 and n100 so the hitresult generation works differently.

A ScoreState should only be used if you intend to specify all relevant hitresults.

HollisMeynell commented 1 month ago

This is intended behavior.

You may have only modified the state's max_combo, n50, and misses, but using this state will also put n300 and n100 explicitly on 0, whereas for p2 you don't specify n300 and n100 so the hitresult generation works differently.

A ScoreState should only be used if you intend to specify all relevant hitresults.

Thanks for your answer, this question has troubled me for a long time.