-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix hitobject drawables becoming visible 1 frame too late #34830
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 hitobject drawables becoming visible 1 frame too late #34830
Conversation
…fe being in wrong order Previously CompositeDrawable.CheckChildrenLife() would be run before lifetimeManager.Update() which lead to the new drawables being inserted into the container but not being made alive immediately, leading to the drawable not becoming visibile until the next update loop.
peppy
left a comment
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.
Makes sense to me.
|
@smoogipoo requesting a second set of eyes on this since it deals with gameplay drawables and you have pretty good knowledge of the ins and outs here. |
smoogipoo
left a comment
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.
Makes sense
Trying to find the cause of this has been haunting me for well over a year now but I finally figured it out: Turns out
PooledDrawableWithLifetimeContainer.CheckChildrenLife()is doing things in the wrong order.Currently, the container first updates its children's alive-status and then updates the lifetime manager, which will add all drawables that should become visible on the current frame. The alive-status of the newly added drawables remains unchanged however and they have to wait until the next update loop for the container to re-run step 1 to become visible.
By reversing the order of those 2 operations the new drawables will get made alive immediately, and will appear on the same frame.
In practice this has very little impact. It's only really noticeable in the editor, and even there a bunch of conditions need to be met to actually notice it:
That being said, those conditions can be met reliably by converting a slider to a stream with the game running in single-threaded mode and with v-sync enabled. I'm also pretty sure it's what caused the flickering in the polygon tool prior to #30214 (see video on the pr).
While the impact is negligible I do think that the current implementation is incorrect and this is worth fixing.
Before
2025-08-28.23-30-03.mp4
After
2025-08-28.23-30-11.mp4