sentakki icon indicating copy to clipboard operation
sentakki copied to clipboard

Implement support for Slide Chains, with the possibility to use Fans at the end of a chain

Open LumpBloom7 opened this issue 1 year ago • 0 comments

Supersedes #393

This PR adds support for slide bodies that is a composed of a sequence of regular slide paths, as opposed to the single shape limitation the is present before. This could previously be done in a roundabout way by manually placing a Slide at the endpoint of a previous one, but that meant that timing is stricter as the SlideTaps are generated at such points.

All regular slides can be considered a chain slide with a single part

Compared with #393, this PR also enables fan shapes to be used at the end of a chain slide. If a fan slide is used before the end, then it'll still be treated as a regular straight slide.

Example Fan -> Fan would appear as Straight 4 -> fan Fan -> FullCircle would appear as Straight 4 -> FullCircle Anything but a fan -> Fan would appear as you'd expect

https://user-images.githubusercontent.com/12001167/190893557-fb597b5d-fce6-4d9d-8c64-ac935f05f690.mp4

These won't appear in osu! beatmap conversions. (for now)

The details

SentakkiSlideInfo has been renamed to SlideBodyInfo to better match its actual use.

SlideBodyInfo is now initialised using a list of PathParameters (name tbd), which contains info about the Shape, the ending offset from the origin (0 - 7), and whether it is mirrored. The backing SentakkiSlidePath will be generated on the spot using that info, unlike previously where the path will be generated ahead of time, and fetched using the ID.

When generating a path for a sequence of PathParameters, the ending offset is relative the current part's origin lane, with the start offset being relative to the previous path's end offset (or 0 if there isn't a previous part). The segments for each part will then be combined into a single SentakkiSlidePath where it is ready for use.

The SlidePaths.VALIDPATHS list is still computed, for use in conversions from osu! beatmaps, since the converter uses path distance information to determine whether it is appropriate to use a shape with a given duration. However, instead of holding SentakkiSlidePathss, they hold the PathParameter used to create the same path, since it is now the primary way of creating a SlideBodyInfo. Not sure if this is an improvement to the previous setup, or whether I should just store the SlideBodyInfo instead of the parameters. Not a big issue though since the computation happens before gameplay.

SlideBody and DrawableSlideBody now handles both regular slide paths, and fan slides. This is a by-product of requiring Slide bodies to be able to show a fan when it is requested at the end of a Slide chain; Since Slide bodies already has the capability to show Slide fans, the SlideFan and DrawableSlideFan objects become redundant and has therefore been removed.

LumpBloom7 avatar Sep 18 '22 08:09 LumpBloom7