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

Calculate sample playback position using screen-space drawable rectangles #17860

Merged
merged 4 commits into from Apr 21, 2022

Conversation

frenzibyte
Copy link
Member

As there are mods which could modify the positioning of the DrawableHitObject representation directly, the playback position of the hit samples will still remain unadjusted given that they read from the HitObject's stored position.

Instead, the playback position has changed to now be calculated using the DrawableHitObject's actual coordinates at a screen-space level, relative to the parenting container (retrieved by a recursive ParentHitObject?.Parent ?? Parent).

@peppy
Copy link
Sponsor Member

peppy commented Apr 18, 2022

This seems to not work great for slider "sliding" sounds applied via

if (Tracking.Value && slidingSample != null)
// keep the sliding sample playing at the current tracking position
slidingSample.Balance.Value = CalculateSamplePlaybackBalance(Ball.X / OsuPlayfield.BASE_SIZE.X);

Sounds correct at a non-rotated playfield, but if applying a mod like barrel roll, the positional playback seems out.

osu.2022-04-18.at.05.51.56.mp4

Copy link
Sponsor Member

@peppy peppy left a comment

Choose a reason for hiding this comment

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

Issue as mentioned.

@frenzibyte
Copy link
Member Author

Good catch. Thought sliding samples never had balance adjusted according to ball position, but turns out it's because I was testing on master with "Barrel Roll" enabled. Have updated it to use the screen-space logic instead, and it seems to work properly now.

@peppy peppy enabled auto-merge April 21, 2022 07:57
@peppy peppy merged commit 000c152 into ppy:master Apr 21, 2022
@frenzibyte frenzibyte deleted the sample-positional-playback-screen-space branch April 21, 2022 17:48
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.

Positional hitsounds don't update with mods that change the position of hit objects
2 participants