Optimize rotation of an actor with thousands of actors attached on it

Hello,

we have a 3d game which is played on a vertical 2d grid, composed of blocks. Each block is an actor, composed of 6 static mesh components (one per face), and we can have up to 2500 blocks in the grid (50x50)

The problem I face is a huge DPS drop (from 100Fps to 20) when I rotate the root actor.

I managed to have a much better FPS (around 50 FPS) by disabling the collision on every component during the rotation, by disabling completely the navigation system (since we don’t need it), and by using a scoped update.

Nonetheless, we still have a lot of time spent in UpdateComponentToWorld, like you can see in this profiling session:

Would some flags on components, or functions, or whatever, be worth of interest to speed up the process?

I was thinking of using an InstanceMeshComponent, I did a few tests and it helps a lot, but that would require some huge refactorings in the code to implement that.

Thanks !

I would probably change things up so instead of having all those actors as children of the root, you just point the block to the root and notify them when the roots rotation has changed (unless they are already ticking objects - in which case you can just have them check during their tick).

Maybe segment the update so the blocks nearest to the camera are updated first and the others are updated over a few frames. You could also Async it out across multiple cores since its just a position update and should be thread safe (assuming its just modifying the transform).