Implement animation for RankedPlayBottomOrnament#37478
Implement animation for RankedPlayBottomOrnament#37478LiquidPL wants to merge 1 commit intoppy:masterfrom
RankedPlayBottomOrnament#37478Conversation
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I am not sure about the performance impact of repeatedly calling
GetPathToProgressevery 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>(); |
There was a problem hiding this comment.
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>(); |
|
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) |
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). |
This commit rewrites the separate
SmoothPaths to be handled by a singleSliderPath, 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
GetPathToProgressevery 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