486c / rosu-memory

Lightweight, cross-platform memory reader for osu! but in rust
24 stars 7 forks source link

Adjust beatmap-related calculations to use Gradual calculations #22

Closed Chiffario closed 10 months ago

Chiffario commented 11 months ago

rosu-pp's GradualDifficultyAttributes and GradualPerformanceAttributes allow for higher efficiency in calculations. However, to use it you need to track object deltas. Issue is: reading loop is called every 300ms. In some cases there might be no new objects. process_next_n_objects() doesn't allow for delta = 0, so we need to adjust for that slightly

486c commented 11 months ago

We already have passed_objects i guess we can use that

MaxOhn commented 11 months ago

Calculating difficulty attributes requires conversion of hitobjects in Beatmap to mode-specific objects. This can be very costly, e.g. because of slider generation in osu!standard. Using the general calculator AnyPP will re-calculate these objects every time.

GradualPerformanceAttributes stores the objects internally and re-use them each time, making it much more efficient.

I will say though that the gradual calculation is not as battle-tested and its API could be improved a little which I'll get to eventually. Still, in theory it should definitely improve performance for this use case.