Thanks Mangaroo, they've been the things I've been doing. Just wondered if there was anything else as I'm still struggling with fps.
Does anyone know if there is any benefit in not using using "reset scene" to restart a level and instead use "change attribute" to effectively reset all elements to how they would be at the start of the level.
jiffw, in my own game im not using a reset scene behavior except to go back to the main menu, everything else happens manually just so that the sound is not interrupted and the loading times will be obviously cut back considerably, im not sure that will affect fps, just loading...
other issues with fps - if you don't need an object to move then disable the moveable checkbox - turns off physics for the player
im also having a bit of fps trouble and have had to disable two graphic elements or so to lock it to 60fps for now - you can see what is causing major problems just be disabling the graphics for the actor (tickbox)
@gianttroll What is considered too large? - i assume u mean image sizes so ive got a quotation from tenrdrmer:
"the memory usage for images is based on the physical dimensions of the image. There are steps and they are powers of 2. Meaning the amount of memory is determined by which step the image dimension is in between the numbers are 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024
So your image at 640x980 uses the same amount of memory as an image that is 1024x1024"
no worries jiffw and gariantroll i have all my images divisible by 4 in both height and width dimensions so that when gamesalad resizes the images for non-retina devices (since i have resolution independence checked to support older devices) they don't come out blurry. a dotsperinch (dpi) of 72 is required. Generally speaking, they say to -->double<-- the size of the actor's dimensions for "retina" images.
so if an actor was created and stretching about in gamesalad - after editing his size was 93 by 106 and you wanted the game to be for all devices, check resolution independence and have the actors image created at a dimension of 96 by 108. so that it is divisible by 4 - keep in mind extra space will not be detected by gamesalad and if it is blank it will shrink the actors graphics (with graphics settings set to stretch) so make sure you have either a regular empty space in the dimensions or set graphics to fixed instead of stretching. (i make all my actors images 120 by 120 including extra space - since character changes position within those 120pixels (even though he is only say 60by80) and i make a separate invisible actor for hit-detection (collisions) - the graphic actor has his x&y constrained to the collision actor so when playing the game and a bit of the invisible part of the actor collides with the invisible part of the enemy they player doesnt get a WTF moment :P
hopefully that last paragraph isnt more confusing than helpful! i dont think i have the best practice with the image sizes for my character but testing seems to be going well
random tip, if you spawn an actor i heard using the time attribute as a condition in a rule instead of a timer-behavior saves or processing as well, works best for newly spawned objects like bullets or whatever - since their time starts from the moment of spawn. eg when time is > 0.3 (seconds), explode
I never use timers. Here are the workarounds I use:
After Timer:
Actor self.timetag = 0
Rule If event triggers Change Attribute self.timetag to game.time
Rule When game.time > self.timetag+x Trigger event
"Every" Timer workaround (subdivisions of 1 second):
Rule When game.time = (floor(game.time*x))/x Trigger Behavior
"Every" Timer workaround (multiplications of 1 second):
Rule When game.time = (floor(game.time/x))*x Trigger Behavior
GS is always running timers for the game and every actor, so why not put them to good use? I try and reference the game.time as often as possible, only using self.time when it's necessary to making clean code. The nice thing about this workaround is that it's very tunable. You can put as much or little stress on the CPU by changing the subdivisions. If you only need to constrain a variable every 1/4 of a second, it makes a great substitute for constrain as well.
Note that "For" and "After" timers are pretty much the same, it just depends on where you put the behaviors in the rule nesting.
Comments
Limit the use of these behaviors:
constrains
timers
interpolate
try to recycle actors instead of destroying them
-alpha0 is a good way to make unseen without destroying to later respawn
don't overload the memory - keep images divisible by 4 (dimensions) and don't uses images that are too large
Does anyone know if there is any benefit in not using using "reset scene" to restart a level and instead use "change attribute" to effectively reset all elements to how they would be at the start of the level.
other issues with fps - if you don't need an object to move then disable the moveable checkbox - turns off physics for the player
im also having a bit of fps trouble and have had to disable two graphic elements or so to lock it to 60fps for now - you can see what is causing major problems just be disabling the graphics for the actor (tickbox)
@gianttroll What is considered too large? - i assume u mean image sizes so ive got a quotation from tenrdrmer:
"the memory usage for images is based on the physical dimensions of the image. There are steps and they are powers of 2. Meaning the amount of memory is determined by which step the image dimension is in between
the numbers are 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024
So your image at 640x980 uses the same amount of memory as an image that is 1024x1024"
so if an actor was created and stretching about in gamesalad - after editing his size was 93 by 106 and you wanted the game to be for all devices, check resolution independence and have the actors image created at a dimension of 96 by 108. so that it is divisible by 4 - keep in mind extra space will not be detected by gamesalad and if it is blank it will shrink the actors graphics (with graphics settings set to stretch) so make sure you have either a regular empty space in the dimensions or set graphics to fixed instead of stretching.
(i make all my actors images 120 by 120 including extra space - since character changes position within those 120pixels (even though he is only say 60by80) and i make a separate invisible actor for hit-detection (collisions) - the graphic actor has his x&y constrained to the collision actor so when playing the game and a bit of the invisible part of the actor collides with the invisible part of the enemy they player doesnt get a WTF moment :P
hopefully that last paragraph isnt more confusing than helpful! i dont think i have the best practice with the image sizes for my character but testing seems to be going well
random tip, if you spawn an actor i heard using the time attribute as a condition in a rule instead of a timer-behavior saves or processing as well, works best for newly spawned objects like bullets or whatever - since their time starts from the moment of spawn. eg when time is > 0.3 (seconds), explode
After Timer:
Actor
self.timetag = 0
Rule
If event triggers
Change Attribute self.timetag to game.time
Rule
When game.time > self.timetag+x
Trigger event
"Every" Timer workaround (subdivisions of 1 second):
Rule
When game.time = (floor(game.time*x))/x
Trigger Behavior
"Every" Timer workaround (multiplications of 1 second):
Rule
When game.time = (floor(game.time/x))*x
Trigger Behavior
GS is always running timers for the game and every actor, so why not put them to good use? I try and reference the game.time as often as possible, only using self.time when it's necessary to making clean code. The nice thing about this workaround is that it's very tunable. You can put as much or little stress on the CPU by changing the subdivisions. If you only need to constrain a variable every 1/4 of a second, it makes a great substitute for constrain as well.
Note that "For" and "After" timers are pretty much the same, it just depends on where you put the behaviors in the rule nesting.