does actor edited inside the scene is the same as creating a new one?
POM
Member Posts: 2,599
hello i have a question for the GS guys..
when i create an actor and add it to a scene, then editing it inside the scene with different behaviors (not the prototype),
is it the same as creating a new prototype actor and place it in the scene?
i ask that because i have a lot of actors with almost the same behaviors, should i make 1 prototype and make minor changes in the scenes for the rest? (with change image)
or should i just make different actors?!
when i create an actor and add it to a scene, then editing it inside the scene with different behaviors (not the prototype),
is it the same as creating a new prototype actor and place it in the scene?
i ask that because i have a lot of actors with almost the same behaviors, should i make 1 prototype and make minor changes in the scenes for the rest? (with change image)
or should i just make different actors?!
Comments
In my game I have a mob spawner that acts pretty different based on which level you are playing. It spawns different types of units in different places. I originally had 1 actor for each level. I was always going up to about 58mb memory usage in game & then it would crash. I figured out that the # & weight of ACTORS in your GAME, not just scene, played a HUGE role in how much Ram was used.
So then I used 1 actor & in each instance I copy/pasted all the rules from the original actors in each level. Then I deleted all the unused actors. Now I am consistently around 50-52mb & it doesn't crash. My functionality is the same, but the memory usage went down a lot as you can tell.
My 'thought' is that actors are present in memory at all times, so you can call them up whenever you need to. The instances are only in memory on that particular level, because it doesn't need to be able to call them into place.
Now the obvious issue with doing this is that these now are unlocked & won't be edited by the main actor. But it was such a HUGE memory saver for me that I deem it worth it. Also for me it was fine, b/c those actors are already complete & will not require any changes.
This 'trick' will not help much if you only have one scene though, as the weight of the instance vs actor will probably be the same. But not having to load all those actors into memory for every scene really helped my game. I went from crashing before completing one level to playing non-stop without crashes with this one tip. Hopefully this really helps someone out.
JGary
Thank you friend helped me a lot I have much work to do
now, make 1 actor for about 25 similar actors.
Worth every KB!
Please do make your tip post and share this info with the rest of us..