Optimising without a device
Armelline
Member, PRO Posts: 5,374
Hey all,
I decided to get off my ass and make a game that's been sitting in the back of my head for a while, and I knew from previous playing that GameSalad would make it easy.
So the past couple of weeks I've been putting the game together, and now I'm at a point where I'm mostly done with the core functionality and just need to add more levels. The problem is that the levels take a long time to get just right and I don't want to dump hours and hours of time into making them if it turns out my game is managing resources badly. For all I know I'll get 1 fps on an actual device.
A typical level has a lot of static, unmovable actors. There's not that much complexity to the game, but sometimes in the viewer is moves a little stuttery. If it's doing that in the view on a top-end Mac, it makes me worried about on-device performance. I'm positive that I'll be able to optimise a reasonable amount and if my current way of doing things just don't work I have ideas on how to do things differently.
But the bottom line is until I can test on a device there's little point me pushing forward with making more levels. Or even fine-tuning the current ones (actor placement wise, that is).
I previously had an Objective-C game on the app store (that got bullied off the store by legal threats from a major board game company - threats without ANY merit but that I simply couldn't afford to fight (they were releasing a competing app based on the same type of puzzles)). But my account expired a couple of years ago and with the Enrollment being down I can't renew it at the moment.
So to get to my point, what things can I be doing to optimise my game, and what things are typical "bad" scenarios in GameSalad that will cause bad performance.
Perhaps we can compile a few things to watch out for in this thread?
Some things I'm already conscious of:
* I'm preloading as little art as possible.
* I'm trying to structure my rules as efficiently as possible (sometimes more successfully than others).
* I'm using rules rather than timers.
I decided to get off my ass and make a game that's been sitting in the back of my head for a while, and I knew from previous playing that GameSalad would make it easy.
So the past couple of weeks I've been putting the game together, and now I'm at a point where I'm mostly done with the core functionality and just need to add more levels. The problem is that the levels take a long time to get just right and I don't want to dump hours and hours of time into making them if it turns out my game is managing resources badly. For all I know I'll get 1 fps on an actual device.
A typical level has a lot of static, unmovable actors. There's not that much complexity to the game, but sometimes in the viewer is moves a little stuttery. If it's doing that in the view on a top-end Mac, it makes me worried about on-device performance. I'm positive that I'll be able to optimise a reasonable amount and if my current way of doing things just don't work I have ideas on how to do things differently.
But the bottom line is until I can test on a device there's little point me pushing forward with making more levels. Or even fine-tuning the current ones (actor placement wise, that is).
I previously had an Objective-C game on the app store (that got bullied off the store by legal threats from a major board game company - threats without ANY merit but that I simply couldn't afford to fight (they were releasing a competing app based on the same type of puzzles)). But my account expired a couple of years ago and with the Enrollment being down I can't renew it at the moment.
So to get to my point, what things can I be doing to optimise my game, and what things are typical "bad" scenarios in GameSalad that will cause bad performance.
Perhaps we can compile a few things to watch out for in this thread?
Some things I'm already conscious of:
* I'm preloading as little art as possible.
* I'm trying to structure my rules as efficiently as possible (sometimes more successfully than others).
* I'm using rules rather than timers.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Comments
http://forums.gamesalad.com/discussion/46652/31-optimization-tips/p1
There's a lot of things there with no explanation, though, which makes me worried about implementing some. Some followup questions (added ticks to show the answered ones!):
✗ 1. I couldn't find anything about scaling effects of number of actors on and off screen and performance. Is it better to destroy and then respawn an actor when the camera moves off it and then back to it, or to have it sit there, for example?
✓ 2. What is the benefit of using a png-8 if a jpg produces a lower file size? - As noted below by FryingBaconStudios and BoomshackBarry, GS converts all images to png and if I'm reading BoomshackBarry correctly, at least tries to use png24 only when necessary.
✓ 3. Does it really save resources to use an image change rather than a display text? - According to tenrdrmer the performance change isn't an issue, so doing this would only increase file size. That said, better fonts in images.
✓ 4. In what circumstances is better to NOT uncheck "preload art"? - According to tenrdrmer this only matters if your actor has animations. So almost all of mine should be fine leaving it on (I find out after turning them all off :P)
✓ 5. Turn every attribute under the physics tab in the actor editor to 0 on actors who do not need it." Is this really worth it? It'll take a long time but I can't see why it would affect performance if they attributes aren't used by the actor? - According to tenrdrmer my instinct was correct and these attributes only load when needed.
✓ 6. "If an image file is large or is a background, have the actor that uses the image use the suggestion in number 7 instead of having the actor start initially with the image." This doesn't lead to any kind of 'image pop-in'? - According to tenrdrmer this is "Hoopla". So my question becomes moot.
✓ 7. "Make your own pause instead of using the behavior. See http://gshelper.com/stop-motion-on-custom-pause-gamesalad-tutorial/" This link is broken, so what is the rationale behind this tip? And how complicated is it to implement this (unknown to me) alternative? (found it: http://gshelper.com/shop/advanced-game-functions/stop-motion-on-custom-pause-gamesalad-tutorial/) - Okay, I watched the video now. Is the rationale behind this one really just the loading symbol? Until I test on device I can't judge how bad it is but it seems a whole lot of work and extra rules added for a very minor thing. Is there further justification for this? - tenrdrmer seems to think there's no performance reason for this, but I'll reserve judgment until I try my game on a device.
✓ 8. "Use music at your own risk because it will decrease performance." To what extent? How much is a single looping music track going to affect things? - Another hoopla according to tenrdrmer.
✗ 9. "Don't save more than 3 attributes at once." Why? What kind of diminishing returns would I be looking at?
✓ 10. "If you can, unlock actors to constrain to the actor directly. See: http://gshelper.com/gamesalad-performance-tip-1-2/" This link is also broken, what is this one saying? (I presume this one? http://gshelper.com/shop/free-templates-and-tutorials/gamesalad-performance-tip-1-2/) Okay watched this video too now and this is something I discovered as I worked on my game. I have a bunch of double-constrains in the stuff I did early on but use this method in things added later. Time to go back and change the early ones I guess!
✓ 11. At times I used integers when booleans would function equivocally. Is it worth me going back and changing them, performance wise? - MarkOnTheIron reported back in 2011 to having issues with booleans. Quite likely fixed in a GS build since then I'd guess. Calvin9403 argued in the same thread that booleans save memory, but as BoomshackBarry noted below, it's likely to be a negligible amount.
✗ 12. Is there any performance impact whatsoever from using mixed case and multi-word attribute and actor names?
✗ 13. Unrelated but still... Is it normal for GameSalad to crash A LOT? I get maybe 20 crashes a day - mostly when changing scene size attributes, but far from exclusively.
Sorry for all the questions. I'm going a bit stir crazy not being able to test on a device Will watch those two videos now too and update my questions after.
Everything else that is relevant to my project I was already doing naturally it seems so maybe things will go better than I fear when I finally get to run it on my phone!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
http://forums.gamesalad.com/discussion/comment/413351/
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
1. I couldn't find anything about scaling effects of number of actors on and off screen and performance. Is it better to destroy and then respawn an actor when the camera moves off it and then back to it, or to have it sit there, for example?
2. What is the benefit of using a png-8 if a jpg produces a lower file size?
9. "Don't save more than 3 attributes at once." Why? What kind of diminishing returns would I be looking at?
11. At times I used integers when booleans would function equivocally. Is it worth me going back and changing them, performance wise?
12. Is there any performance impact whatsoever from using mixed case and multi-word attribute and actor names?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
(Can't find an official list but it seems .png, .ogg, .m4a)
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
I can't remember for the of me where I read that - I seem to remember Tshirtbooth explaining it, and that he uses integers rather than booleans so that he has the flexibility if he ever needs to go back and add more conditions to a rule, for example.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support