Skip to content

SceneTreeFTI - Fix force_update flag getting out of sync with invisible nodes #107175

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

Merged

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented Jun 5, 2025

…isible nodes

If the force_update flag remained set after the node was removed from the update lists, the node would never be updated in future. This could occur with hidden nodes that were moved after hiding.

Fixes #107142

Explanation

The SceneTreeFTI relies on node flags being in sync with nodes being on various update lists. This bug occurred for the forced frame update list, because the node flag was being cleared in the tree traversal, however invisible nodes were never having their flag cleared, and once the list was cleared the flag and the list became out of sync.

At further node movements, the logic determined incorrectly that the node was already on the update list.

We fix it by removing the flag manually on every node in the list rather than at traversal time.

Notes

  • It's possible this can be done in a more optimal way at a later stage, but this shouldn't be bad.
  • Also applicable in 3.x.
  • I also corrected a few lines that didn't compile with GODOT_SCENE_TREE_FTI_EXTRA_CHECKS defined (these are compiled out of the main build, and are only there for regression testing, hence why CI didn't pick up before, they had some renames needed from 3.x version).

…isible nodes

If the `force_update` flag remained set after the node was removed from the update lists, the node would never be updated in future. This could occur with hidden nodes that were moved after hiding.
@lawnjelly
Copy link
Member Author

I've flagged the usual suspects for review, but actually this is very straightforward, so anyone is welcome to review. 👍

@akien-mga akien-mga changed the title SceneTreeFTI - Fix force_update flag getting out of sync with inv… SceneTreeFTI - Fix force_update flag getting out of sync with invisible nodes Jun 6, 2025
Copy link
Member

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

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

Rubber stamping this.
Code looks good to me; I don't fully understand how FTI works so I can't review the logic. But if Lawnjelly says it's needed for Beta, I don't see a reason not to merge this.

@lawnjelly
Copy link
Member Author

Thanks @Ivorforce , if you can, can you approve #107178 too (which is the 3.x version) and I'll get that merged so it can get more testing.

@akien-mga akien-mga merged commit b7caebc into godotengine:master Jun 12, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@lawnjelly lawnjelly deleted the scenetreefti_fix_show_updates branch June 12, 2025 10:18
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.

Physic Interpolation on moved hidden object lock them on place
3 participants