I know that similar topics have been discussed before, but since I haven’t come across a question similar to my use case, I will ask it myself.
Now, I’m working on an automation game and I’m developing a new block system, separate from my previous block system.
First of all, none of the machines have logic on their own, so each block can’t run on individual actors because that would probably destroy the performance of the game.
Instead I am using one actor per block type, instanced static mesh in the blocks and the logic of the blocks is running on separate components. These components run 2 times per second consistently. So I have a system that is not too bad in terms of performance.
But in the new block system, I use dynamic meshes, that is, all blocks are in one piece in an actor. But I am undecided about how to run their logic.
I can put the components that the blocks will need separately in the same actor or I can create separate actors per block type as before and the logic of all blocks runs in their own actors.
Now the question is, if the logic stays inside the actors, let’s say I have two actors with 700 ovens. If the components run inside the actors, we have for loops that will run 700 times separately. But if a single oven actor manages them, we have a for loop that will control 1400 blocks by itself.
Which is better in terms of performance, 2 for loops running 700 times in separate actors or a for loop running 1400 times in a single actor?