Performance Tricks/Questions

Discussion and feedback on Construct 2

Post » Thu Dec 06, 2012 7:48 am

Okay so I've read the performance tips page a dozen times, I've tried optimizing everything to the best of my ability.

I'd like to know if anyone has any tricks/tips that aren't listed or are harder to track down.

What are some big performance hitters? Should I worry more about graphics file size or resolution? Should I worry more about the code? What about nested loops, is that a huge deal with maybe a dozen objects?

Also my game seems to be locking up for a second or two when creating some of the heavier objects at runtime... Is there a way I can avoid this happening? Like can I preload the objects somehow?

Right now I have some objects that are destroyed at the start of the layout, and later on I create them again... but when I create them my framerate drops to 0 for a second and then the game plays as normal. But after that they can be created over and over without any issue. Are the objects not loaded into memory if they are destroyed at start? Maybe I should create them at runtime and destroy them after? Would that keep them in memory when I create them again later?

Oh and one other question... I have rather large backgrounds (roughly 1200x800. Should I bother chopping these up into multiple images? I think I attempted to do this a while back with little to no change in framerate. It also seems that breaking up the image actually increases the overall file size... So what is the answer?

Thanks in advance. I really enjoy using Construct 2. :)

edit: oh forgot to mention I'm trying to target mobile iPad/iPhone/other mobile devicesKonidias2012-12-06 07:50:16
B
7
S
2
G
3
Posts: 28
Reputation: 2,260

Post » Thu Dec 06, 2012 8:16 am

Great post! I`m also very interested in these topics and I`ll add one of my own: is running events in certain intervals meaningfull performance wise? Is there really any difference running a simple event everytick versus running it every 1seconds?

Also is there perhaps an chrome addon or something that could be used to monitor performance more closely?
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Thu Dec 06, 2012 2:31 pm

I don't think anything raised here affects performance significantly at all, unless you can actually measure a big framerate difference changing it one way or another.

The Performance Tips lists almost everything that is likely to significantly affect the performance of your game. Anything not on the list likely does not affect performance significantly at all. That's about it really.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Thu Dec 06, 2012 6:55 pm

Okay well I solved the lagging when creating certain objects by just putting them in a new layout and setting them to global objects. (a trick I read on the forums)

Two more questions:

1. is there any way to display how much memory is being used?
2. is there any special way to get a game to resize to fit inside the window of a tablet/phone that takes into account the address bars? I designed my game for i-pad resolution but the address bar doesn't go away, so the game is sizing up to the width of the screen but not the height... meaning the game window is being cut off which leads to the page scrolling when you drag up/down on the screen.

Also is there a way to keep focus on the game even if the page can be scrolled? It's a big issue when touch controls don't work because every swipe is moving the screen aroundKonidias2012-12-06 18:56:11
B
7
S
2
G
3
Posts: 28
Reputation: 2,260


Return to Construct 2 General

Who is online

Users browsing this forum: Solomon, zenox98 and 9 guests