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 osu!catch fruit rotation being applied too late #29894

Merged
merged 5 commits into from
Sep 17, 2024

Conversation

peppy
Copy link
Member

@peppy peppy commented Sep 17, 2024

In passing

Untitled.Project.1.mp4
Untitled.Project.2.mp4

I still think we should do more hitobject animations using this style. Really gets rid of the mental overhead of transform / rewind gymnastics.


ScalingContainer.RotateTo(startRotation).RotateTo(startRotation + 720, duration);
double preemptProgress = (Time.Current - (HitObject.StartTime - InitialLifetimeOffset)) / (HitObject.TimePreempt + 2000);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this clamped in DrawableBanana (albeit only from above to 1, rather than from both sides), and not here? Interpolation.Lerp() does no clamping on its own, so it will extrapolate when given arguments outside [0;1].

Copy link
Member Author

@peppy peppy Sep 17, 2024

Choose a reason for hiding this comment

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

The clamping in DrawableBanana is because we assume that scale shouldn't continue to decrease after reaching the final value. For rotation, I want it to continue in both directions for sanity reasons (assume it's always spinning).

Also for bananas, they end up on the plate (where they shouldn't rotate) while droplets fly off the plate immediately, where I'd expect them to continue rotating (although they don't seem to for some reason, wasn't really interested in finding out why).

This is the same reason clamping is only applied to max not min for scale – to allow extrapolating values for the range which previously didn't animate.

I can add inline comments if this isn't clear.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Inline comments could be useful because all that makes sense but is also very non-obvious.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will do. Also having talked through the above I realised that bananas will look wrong if you don't catch them, will fix that.

// roughly matches osu-stable
float startRotation = RandomSingle(1) * 20;
double duration = HitObject.TimePreempt + 2000;
// Important to have this in UpdateInitialTransforms() to it is re-triggered by RefreshStateTransforms().
Copy link
Member Author

Choose a reason for hiding this comment

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

Arguably, we could move all of these Random fetches to Update and nuke RefreshStateTransforms completely (seems only used in catch)...

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think having it where it is right now is preferable. I'm not sure putting that in update would end well.

@bdach bdach merged commit ea94f90 into ppy:master Sep 17, 2024
13 checks passed
@peppy peppy deleted the fix-fruit-rotation branch September 18, 2024 03:47
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.

2 participants