Alright so my game has 80 objects when it's running. My android phone heats up when I play my game!
I realized that I don't need 30 of those objects until Game Over... Initially, they're invisible, but they exist on screen.
Question is, how much would it help in performance if I do one of these:
1) Destroy them on Start of Layout, and spawn them all when needed?
2) Since they're all positioned manually as I want them, I don't want to do the above (placing them back again through programming will be a mess), would it help if I move everything by Self.X + 3000 and bring them all back by Self.X - 3000 (i.e. removing them from screen).
Thanks!
Here's what I've faced on my mobile games:
1. Avoid ticking as much as possibble. Don't execute stuff unless you have to, this will lead you to an event driven approach. For instance, HUD use to be something you have to update frequently but using text objects or forcing Construct to draw a sprite font every tick is terrible. Instead, determine the events that will trigger an update and call an UpdateHUD function to improve performance.
2. Too many Physics objects. Use only what you need or what "looks good" aiming always to the minimum.
3. Using too many Platform behavior objects. This behavior is quiet heavy even for a PC, some people tend to use it instead of a physics behavior. For performance reasons, try not to have more than 3 objects with platform beh.
4. Too many particles with large lifetime. It will demand the engine to process each object created individualy, so it is self explained.
5. Effects. Some shaders are really gpu intensive, so you will have to figure each out by trial and error. Mobiles have way less processing capacity than a PC, so always test your effect alone in your phone and build over it or completely remove it if your phone has les than 30fps (aim for that)
6. Text Objects are really heavy to render in a mobile, use sprite fonts if you need lots of text objects, however you can still them use them as long as you don't update them every tick.
7. HTML objects like Input fields, buttons and so on tend to be heavy in my experience, so use as few as possible or try to isolate the "forms" layouts from the game layouts.
Hope it helps.