Update propogate_transforms to only visit the transforms of entities that have changed
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
> As far as I know yes, the transform propagation algorithm hasn't been changed since posting this. In order to alleviate the performance concerns we'd need two changes:
> 1. Update `propogate_transforms` to only visit the transforms of entities that have changed. Currently we visit the entire hierarchy on every run of the system which is very inefficient (this is sub-optimal regardless of whether we update transforms in FixedUpdate, but this issue would exacerbate it)
> 2. We'd need a way of sharing change ticks between multiple instances of `propogate_transforms`. Currently, if you were to add `propogate_transforms` to the schedule multiple times, each instance of the system would have its own change ticks, which means each instance would redundantly propagate transforms for the same entities/components
_Originally posted by @JoJoJet in https://github.com/bevyengine/bevy/issues/7836#issuecomment-2571810466_
item 2 can be a follow-up after this issue is handled
Contributor guide
Research direction
Start by locating the `propogate_transforms` system and its existing transform-propagation tests. Trace how entity hierarchies and change ticks are currently visited, then verify that unchanged entities are skipped while changed entities still propagate correctly. Sharing change ticks across multiple system instances is explicitly deferred to a follow-up.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100