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

Refactor AnimationSpeed related stuff #484

Merged
merged 8 commits into from
Sep 4, 2023
Merged

Conversation

LumpBloom7
Copy link
Owner

@LumpBloom7 LumpBloom7 commented Aug 17, 2023

Previously, AdjustedAnimationSpeed was computed within DrawableSentakkiHitObject, SentakkiHitObjectLifetimeEntry and LineLifetimeEntry. Now this calculation is done centrally within DrawableSentakkiRuleset, with each of the mentioned above binding to the bindables provided by it, instead of directly to the config values.

Since DrawableRuleset is guaranteed to be alive during gameplay, we can actually easy recompute the AnimationSpeed every update to compensate for rate-adjusting mods like ModWindUp or ModAdaptiveSpeed, resulting in the animation speeds being consistent throughout. (LifetimeEntries aren't drawables, so they can't spontaneously update; DHO's aren't always on screen, so they can only update if they are present)

Bonus changes

  • When adjusting the animation speed configs, gameplay will smoothly transition to the new value.
  • Judgements, HitExplosions and the SlideTap star also compensate for rate-adjust now.
  • Players can change the laned note animation speed using the global scroll speed up/down bindings

The performance impact of refreshing transforms every frame seems negligible in my basic eyeballing. Profiling shows roughtly 400ms of CPU time over a 4 minute beatmap, which should only apply when using rate adjusting mods.

@LumpBloom7 LumpBloom7 added the enhancement New feature or request label Aug 17, 2023
@LumpBloom7 LumpBloom7 changed the title Allow the use global scroll speed bindings to adjust note animation durations Refactor AnimationSpeed related stuff Aug 18, 2023
@LumpBloom7 LumpBloom7 added tweak A minor change to an existing feature and removed enhancement New feature or request labels Aug 18, 2023
@LumpBloom7 LumpBloom7 merged commit c8ba623 into master Sep 4, 2023
3 checks passed
@LumpBloom7 LumpBloom7 deleted the better-scroll-adjustment branch September 4, 2023 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tweak A minor change to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant