Closes https://github.com/ppy/osu/issues/28989.
Because swell ticks are judged manually by their parenting objects,
swell ticks were not given a start time (with the thinking that there
isn't really one *to* give). This tripped up the "judge past objects"
logic in `EditorPlayer`, since it would enumerate all objects
(regardless of nesting) that are prior to current time and mark them as
judged. With all swell ticks having the default start time of 0 they
would get judged more often than not, leading to behaviour weirdness.
To resolve, give swell ticks a *relatively* sane start time equal to
the start time of the swell itself.
I don't know how to reproduce this issue in a test, so no tests for now.
Nonetheless, this fixes the issue for me at least on one map:
https://osu.ppy.sh/beatmapsets/1899665#taiko/3915653
This workaround is similar to #16475 (the test from that commit got
eventually removed for some reason).
While `EndTime + tickSpacing` _was_ closer to what stable was using, it
could cause undesirable edge cases wherein a tick would be spawned
outside of the drum roll's duration
(see https://github.com/ppy/osu/pull/23768/files#r1222073027).
For this reason, stick with the old code for now, as it is not as
susceptible to that sort of breakage.
4a7b011a53 inadvertently unearthed that
nested strong hits could play samples of their own accord, rather than
delegating to `DrumSampleTriggerSource` as they were supposed to. This
was an unfortunate omission due to how the inheritance structure of
`TaikoHitObject` looks like (some irrelevant classes omitted for
brevity):
DrawableTaikoHitObject
DrawableTaikoHitObject<TObject> <-- `GetSamples()` was overridden to empty here
DrawableTaikoStrongableHitObject
DrawableHit
DrawableDrumRoll
DrawableDrumRollTick
DrawableSwell
DrawableSwellTick
DrawableStrongNestedHit <-- all strong nested hits are here => didn't receive `GetSamples()` override
DrawableHit.StrongNestedHit
DrawableDrumRoll.StrongNestedHit
DrawableDrumRollTick.StrongNestedHit
To fix, move the `GetSamples()` override one level higher, to the
non-generic `DrawableTaikoHitObject`, to suppress the spurious sample
playbacks.
The stale reference in the comment was also updated to match current
code.
The rationale is the same as in
6d325651dc. Due to the recursive nature of
`GameplaySampleTriggerSource.GetMostValidObject()`, in the case of
nested hits, drum rolls and drum roll ticks, the nested strong hits
would become the most valid object, and so without propagating
the samples down to that level too, nothing would play.
In d97daee96b, `DrumSampleTriggerSource`
was changed such that in order to play sounds for the user's inputs, the
bank of the normal sound would always be used.
The problem is that in the case of taiko objects which have nested
objects (swells and drum rolls), the samples were not propagated fully
(drum rolls, where only the finish sample was kept, for the purposes of
determining strongability), or not propagated at all (swells) to ticks.
As ticks of both objects are valid return values of
`GetMostValidHitObject()`, this would lead to the drum making no sounds
if the next object was a drum roll or swell, until that drum roll or
swell was completed. To fix, propagate the full set of samples, so that
`DrumSampleTriggerSource` can retrieve the normal sound to copy the bank
from.
Note that this may not necessarily reproduce prior behaviour. This is
because it is not guaranteed that all realised samples for a given
hitobject have the same bank - some may have been overriden locally on a
given hitobject. Previously, the bank would have been retrieved from the
sample control point, wherein there is only one possible bank to use;
however, when deciding the sound to play on the basis of a constructed
hitobject, it is possible that there are cases wherein the hitnormal
sample was overridden on that given hitobject, and in such cases, this
PR would make samples _play_, but not necessarily the _same_ samples
as prior to #23308.
If that turns out to be the case, this will have to be revisited.