A lot of actors vs. A lot of edited instances
MarkOnTheIron
Member Posts: 1,447
I don't seem to find it anywhere.
I wanted to know if, in terms of overall performance, it is better to have a lot of actors that do essentially the same thing or it is better to have only one actor and edit all its instances?
In my case it's about an actor that display a text related to an attribute. I want to display 40 to 50 attributes in various scenes, can I use the same actor and manually chance the attribute in its instances? How much memory is lost/gained?
I wanted to know if, in terms of overall performance, it is better to have a lot of actors that do essentially the same thing or it is better to have only one actor and edit all its instances?
In my case it's about an actor that display a text related to an attribute. I want to display 40 to 50 attributes in various scenes, can I use the same actor and manually chance the attribute in its instances? How much memory is lost/gained?
Comments
Any info from a GS official dev?
In a game I'm working on I have one ball actor and one ball spawning actor. The spawning actor spawns balls at random intervals and the ball actor has a random speed and direction of movement. This system creates a very mixed feel using only 2 actors.
Hope this helps.
Let's say I have a puzzle game with 100 levels and on each level there's a message on the end that say "You completed the game in xxx seconds". Which is better: to have 100 different actors that display the message or only one actor and edit its instance on every level with that level time attribute?
Edit: For some reason, I originally typed the modulus operator (%) instead of the string concatenation operator (two periods) above. I fixed it above. Hope I didn't confuse you.
I believe you can update the attributes on the left side of the instance without a hit in performance. Adjusting the behaviors (on the right side, with the padlock) might be a bigger one - hence the padlock.
There is also the overall file size of the app to think about... no sense wasting 100K on the same actor over and over...
I change the left side attribute all the times to adjust position and size, but what puzzled me the most was the right side and I was worried if the padlock was there to help GS users to avoid errors or if it could cause some problems on performance or else.