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 bulbs on Catmull sliders #27734
Fix bulbs on Catmull sliders #27734
Conversation
!diffcalc Not sure if this will show any differences, but worth a shot... |
// At draw time, osu!stable optimises paths by only keeping piecewise segments that are 6px apart. | ||
// For the most part we don't care about this optimisation, and its additional heuristics are hard to reproduce in every implementation. | ||
// | ||
// However, it matters for Catmull paths which form "bulbs" around sequential knots with identical positions, | ||
// so we'll apply a very basic form of the optimisation here and return a length representing the optimised portion. | ||
// The returned length is important so that the optimisation doesn't cause the path to get extended to match the value of ExpectedDistance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that "At draw time" implies that the path normally doesn't have this optimisation applied. This actually has an effect.
In osu!stable the ball behaves like this:
2024-03-27.04-13-34.mp4
Notice how it does the weird loop at the knot, where there is technically still a bulb there. In osu!lazer it behaves like this:
2024-03-27.04-16-47.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a visual pass, it looks like stable is taking longer at the "bulb" points while lazer isn't. So before I dive into the code, can you explain where the extra time is spent in lazer? Or does the slider just get marginally shorter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the extra time is spent at the end of the slider in lazer, going by how it slows down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this is what we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to say that this behaves better than stable, but I'm still thinking about it
Technically it's possible to mimic stable's behaviour more closely, but I want to see how the other rulesets work in diffcalc first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is still what we want. Applying the optimisation later on (in GetPathToProgress
) would cause it to be applied to non-Catmull segments. This is probably the best that can reasonably be done.
That being said, the diffcalc sheet showed changes in catch which I didn't like. I've changed it to only apply the optimisation in the osu ruleset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what I'm getting out of this review thread is...
- Stable approximates the path in the same way that lazer does (in a way that affects all segment types, but catmull particularly as it's prone to these "bulbs"), but then it happens to delete the "bulbs" on catmull sliders as an optimisation, but it only does so at the point of displaying the slider path specifically, so actual input tracking uses the "bulbed" slider path.
- lazer displays the approximated path as it was given it, i.e. with "bulbs", but the input handling is consistent with the visuals.
Is that understanding correct?
In that case I'm not thoroughly convinced that lazer needs changing here. To use an analogy, to me this is a bit like that "fake slider follow circle radius" thing wherein stable lies with its visuals as to how large the follow circle really is.
Classic mod toggle, maybe...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it only does so at the point of displaying visuals, so actual input tracking uses the "bulbed" slider path.
Correct.
but catmull particularly as it's prone to these "bulbs"), but then it happens to delete the "bulbs" on catmull sliders as an optimisation
The optimisation targets every path type and only deletes the bulbs by sheer luck. I'd actually say that the optimisation is more aggressive for other path types, but I digress. You can still bend the sliders to certain degrees and have the bulbs pop out again.
The optimisation traces back to the very beginnings of osu! (2007-09-02) likely targeted at improving performance more-so than visuals, because it was batched along with another that made sliders use AA'd paths (a6fe6288c026a3efc485981bcf2f76b9b29e377e
):
(+) Sliders look a LOT nicer. Performance should be considerably higher too - although I still believe I have a bit of work to do in this area.
(2007-08-26, credit to osekai)
Classic mod toggle, maybe...?
I don't feel okay with maps looking weird just because they were using an old algorithm. I think for all intents and purposes this should be considered as part of the algorithm. Furthermore, as mentioned in #27711, there are even recent maps using Catmull.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So to sum up, the effect of this change is such that visuals on lazer will now match stable, but the actual input handling will be slightly different (because lazer will still handle input to match what it displays, it doesn't do the dumb games stable does with showing one path and using another for input).
I think I could be fine with that, personally. I definitely don't want to play the stable dumb games, so it's either this PR or nothing as far as I'm concerned. @peppy thoughts?
!diffcalc |
I've looked at some of the maps in the sheet above but I can't spot any differences. The differences are within error margins though - I don't think they're too important to care about. |
!diffcalc |
!diffcalc |
!diffcalc |
!diffcalc |
Is this still blocked? |
Nope, my bad. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems fine to me
Never mind. Was looking at conversion mappings for #27822 and saw some stuff I did not like but it was just a few slider ticks moving around on some funky catmull sliders so seems fine. |
Fixes #27712
For those with access, the optimisation I'm referring to is here: https://github.com/peppy/osu-stable-reference/blob/e53980dd76857ee899f66ce519ba1597e7874f28/osu!/GameplayElements/HitObjects/Osu/SliderOsu.cs#L1145-L1184
I'm not sure how I could ever add tests for this. If tests are necessary then please give a suggestion for what I could assert.