Skip to content

Implement animation for RankedPlayBottomOrnament#37478

Open
LiquidPL wants to merge 1 commit intoppy:masterfrom
LiquidPL:ranked-play-ornament-animation
Open

Implement animation for RankedPlayBottomOrnament#37478
LiquidPL wants to merge 1 commit intoppy:masterfrom
LiquidPL:ranked-play-ornament-animation

Conversation

@LiquidPL
Copy link
Copy Markdown
Contributor

This commit rewrites the separate SmoothPaths to be handled by a single SliderPath, so that they can be animated in a consistent manner, and then uses that to create a cool looking animation where the path expands from the middle to the sides.

I am not sure about the performance impact of repeatedly calling GetPathToProgress every frame, but I also couldn't find a way to somehow precache the vertices in a way I could retrieve them for an arbitrary progress. Either way I believe this shouldn't impact things too negatively.

Screencast_20260422_162221.webm

This commit rewrites the separate `SmoothPath`s to be handled
by a single `SliderPath`, so that they can be animated
in a consistent manner, and then uses that to create a cool
looking animation where the path expands from the middle to the
sides.

I am not sure about the performance impact of repeatedly calling
`GetPathToProgress` every frame, but I also couldn't find a way
to somehow precache the vertices in a way I could retrieve them
for an arbitrary progress. Either way I believe this shouldn't
impact things too negatively.
private Path pathCenterWide = null!;

private readonly LayoutValue layout = new LayoutValue(Invalidation.DrawSize);
// TODO: remove this jank after we've migrated to .NET 10
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what's this about?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't like how it's possible for someone to accidentally write to the <something>Internal properties without triggering the intended side effect. I noticed that C# 14 lets you create an [auto property with an implicitly handled backing field], however we're still on net8/C# 12, hence the TODO.

It's nothing too serious, I'm just paying too much attention to minor code quality things.

Copy link
Copy Markdown
Contributor

@EVAST9919 EVAST9919 left a comment

Choose a reason for hiding this comment

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

I am not sure about the performance impact of repeatedly calling GetPathToProgress every frame

Native start/end path progress is coming in the near future, but for now snaking sliders use that with no issues since binary search is involved there especially with low vertex count.

const int left_corner = 10;
const int left_end = 20;

List<Vector2> vertices = new List<Vector2>();
Copy link
Copy Markdown
Contributor

@EVAST9919 EVAST9919 Apr 22, 2026

Choose a reason for hiding this comment

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

Probably want this list init outside the function to avoid reallocations on each frame. May be even with a set capacity

protected override void Update()
{
base.Update();
List<Vector2> verticesLeft = new List<Vector2>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same here

@EVAST9919
Copy link
Copy Markdown
Contributor

While we are at it I have a proposal: can we move this element to the top of the screen? Right now it hides default UR bar (seems like people agree) and from my own perspective: I play mania with a skin with judgements at the bottom (However you could say "what if someone has judgements at the top" and you would be right, so my take may be invalid)

@LiquidPL
Copy link
Copy Markdown
Contributor Author

can we move this element to the top of the screen?

I've been investigating temporarily moving any relevant skin components up to avoid overlapping with this element. We've talked moving the element itself to the top, but decided against it probably because it'd overlap with something else (like the health bar, which would feel more awkward to move around especially since people might have custom overlays that expect it to be placed in the corner).

Basically the issue is that just about any edge of the screen is occupied by something, so it's a matter of taking the most satisfying middle ground (which probably is the bottom placement).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants