Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix samples not being preloaded before gameplay starts #17244

Merged
merged 8 commits into from Mar 14, 2022

Conversation

peppy
Copy link
Sponsor Member

@peppy peppy commented Mar 14, 2022

Should reduce IO stutters during gameplay, especially on beatmaps with heavy custom hitsounding.

Closes #17241. Can be tested with the two provided beatmaps (which both have hundreds of hitsounds) by adding a breakpoint in Playfield.prepareSamplePool after entering gameplay (ie. after PlayerLoader finishes the load sequence).

A few changes in this PR to make this work. Can be split out as dependencies but quite small and hopefully non-contentious:

6d6f73e Add overrides in DrawableSliderTail to explain/warn that this class never plays its own samples

Not strictly required to make this work, but is part of a flow I really could not understand while working through the tail sample playback logic. This makes things more explicit.

8676a25 Add the ability for HitObjects to specify auxiliary samples

Used specifically for this optimisation, and nothing else (for now?).

4523393 Removes IsLayered from LegacyHitSampleInfo comparison

The equality of samples is generally used to compare the sample equality, not its full properties. For instance, we don't compare Volume in the base implementation.

Having IsLayered here breaks actual usages of equality, ie. for pooling purposes.

39d95aa Adds automatic preloading of sample pools at a Playfield level

This is the actual optimisation part of this PR.

The equality of samples is generally used to compare the sample
equality, not its full properties. For instance, we don't compare
`Volume` in the base implementation.

Having `IsLayered` here breaks actual usages of equality, ie. for
pooling purposes.
smoogipoo
smoogipoo previously approved these changes Mar 14, 2022
Copy link
Contributor

@smoogipoo smoogipoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smoogipoo smoogipoo merged commit dc1e5a4 into ppy:master Mar 14, 2022
@peppy peppy deleted the preload-sample-pools branch March 16, 2022 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hit sounds are not preloaded before a beatmap is played
3 participants