Tricks to optimizing large scenes
So Tiny Diggers is almost done and I'm trying to do as much optimizing as I can. One thing that is most important is obviously the amount of actors, what they're doing, spawning, not a lot of constrains, rules blah blah. I've got the scene setup so that actors will only animate when the main actor (truck) is near them, so it's a draw distance if you will. I'm not really sure if this is helping but what I was hoping to do was to only show the actors when the truck is near but I obviously don't want to use spawning....
Would:
A) moving the actors off-screen and moving them to their position when the truck is near work in optimizing?
Setting the actor's visibility to true when the truck is near help? Or would that be the same as spawing.
c) Setting their alpha to 0. I know the answer to this one is probably no.
Any other tricks to optimizing a large scene would greatly help!
Would:
A) moving the actors off-screen and moving them to their position when the truck is near work in optimizing?

c) Setting their alpha to 0. I know the answer to this one is probably no.
Any other tricks to optimizing a large scene would greatly help!
Comments
I think making sure your images and sounds are as small file sizes as possible will be one area you could look at (relook). Sorry not much but at least it gets the post bumped!
b) you can't change visibility flag with rules
c) no
Shadows Peak is an atmospheric psychological horror that explores the dark side of a player.
C) you can change the Alpha on the actor … so they appear invisible, but their image will still load in memory as Alpha = 1
you can import a 2x2 transparent.png into GS
when your actor is all set-up
have it's first behavior: changeAttribute: self.image To: the correct image name that is in the actor's attributes section
then drag the 2x2 into the image area of the actor (it will stretch to fit the W,H of that actor)
when scene loads it will just load the little 2x2 in memory … and change the image attribute as soon as its starts
spawners are only resource demanding when continuously spawning at timed intervals …(Every)
to use a Control Actor off-screen for a one-time spawn of a bunch of actors in various location after the scene has been loaded is a good idea
just use a Timer: After: 0.05 seconds … and that is very efficient especially when used with the transparent png
@};- MH
For good frame rates: I'm guessing you already do much of this but here's my general view...
Whenever possible I try and use the most simple and 'manual' of rules. By that I mean I am trying to make it easy for the device CPU. I don't want to give it lots of complicated calculations to perform (if possible) and especially not all at the same time.
So in the context of GS I'm using the 'change attribute' behaviour when ever possible. e.g if I can use 'change attribute>self>motion>linear>x' to get the effect I want I'll do that. Instead of using the 'change velocity', 'move' or' accelerate' behaviours which will probably involve larger calculations for the device.
I think you've got the right idea with having your actors only move when close to the truck. As much as possible all rules should have specific conditions so that they are not constantly taxing the CPU. e.g you can wrap a set rules inside another rule so that the engine does not even have to bother checking through the entire set. It can just read the first rule, and if conditions are not met... no need to go looking through all those 'otherwise' rules.
However I'm sure @codemonkey could clarify and confirm any questions regarding optimising in GS.
Shaz
_______________
On the GS asset store: Rock Music, Pack 2
Casual & Platformer Music, Pack 3
Atmosphere Music, Pack 1