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 slider tail volume not saving #28619

Merged
merged 4 commits into from
Jul 3, 2024

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented Jun 26, 2024

RFC. Closes #28587.

As outlined in the issue thread, the tail volume wasn't saving because it wasn't actually attached to a hitobject properly, and as such the LegacyBeatmapEncoder logic, which is based on hitobjects, did not pick them up on save.

To fix that, switch to using NodeSamples for objects that are IHasRepeats. That has one added complication in that having it work properly requires changes to the decode side too. That is because the intent is to allow the user to change the sample settings for each node (which are specified via NodeSamples), as well as "the rest of the object", which generally means ticks or auxiliary samples like sliderslide (which are specified by Samples).

However, up until now, Samples always queried the control point which was active at the end time of the slider. This obviously can't work anymore when converting NodeSamples to legacy control points, because the last node's sample is also at the end time of the slider. To bypass that, add extra sample points after each node (just out of reach of the 5ms leniency), which are supposed to control volume of ticks and/or slides, and read those instead on decode into Samples when parsing an IHasRepeats. See following crude visual explanation:

obraz

Upon testing, this sort of has the intended effect in stable, with the exception of sliderslide, which seems to either respect or not respect the relevant volume spec dependent on... not sure what, and not sure I want to be debugging that. It might be frame alignment, or it might be the phase of the moon.

cc @OliBomby (not sure if you want to voice your opinion on this)

Closes ppy#28587.

As outlined in the issue thread, the tail volume wasn't saving because
it wasn't actually attached to a hitobject properly, and as such the
`LegacyBeatmapEncoder` logic, which is based on hitobjects, did not
pick them up on save.

To fix that, switch to using `NodeSamples` for objects that are
`IHasRepeats`. That has one added complication in that having it work
properly requires changes to the decode side too. That is because the
intent is to allow the user to change the sample settings for each node
(which are specified via `NodeSamples`), as well as "the rest of the
object", which generally means ticks or auxiliary samples like
`sliderslide` (which are specified by `Samples`).

However, up until now, `Samples` always queried the control point
which was _active at the end time of the slider_. This obviously can't
work anymore when converting `NodeSamples` to legacy control points,
because the last node's sample is _also_ at the end time of the slider.
To bypass that, add extra sample points after each node (just out of
reach of the 5ms leniency), which are supposed to control volume of
ticks and/or slides.

Upon testing, this *sort of* has the intended effect in stable, with
the exception of `sliderslide`, which seems to either respect or _not_
respect the relevant volume spec dependent on... not sure what, and not
sure I want to be debugging that. It might be frame alignment, or it
might be the phase of the moon.
@bdach bdach added area:beatmap-parsing .osu file format parsing area:editor labels Jun 26, 2024
@bdach bdach self-assigned this Jun 28, 2024
Comment on lines 296 to 297
if (spanDuration > LegacyBeatmapDecoder.CONTROL_POINT_LENIENCY + 1 && hitObject.Samples.Count > 0)
yield return createSampleControlPointFor(nodeTime + LegacyBeatmapDecoder.CONTROL_POINT_LENIENCY + 1, hitObject.Samples);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Realised that this is probably slightly bugged, this control point shouldn't be output for the last node (which is presumed to be the end of the object). Will fix whenever able.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

See d4a8f6c

@smoogipoo
Copy link
Contributor

I think this makes sense to me.

@smoogipoo smoogipoo merged commit 537e3a1 into ppy:master Jul 3, 2024
13 of 17 checks passed
@bdach bdach deleted the fix-tail-volume-not-saving branch July 3, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slider tail volume is not saved properly
2 participants