Questions about Construct 2 performance issues

Get help using Construct 2

Post » Fri Jun 13, 2014 3:32 pm

My android game is lagging even on Samsung flagship device S4. Can these things be done to improve performance?

1. Reduce the size of sprites using photoshop and then importing it instead of importing a large size (say 128x128) and shrinking it in C2 to a smaller size (say 64x64)

2. Decrease the number of layers which are in parallax scrolling (right now there are 3)

3. Decreasing the number of frames of the player and increasing it's fps.

4. Removing Sine behavior and instead using animated sprite to do the same job. (I use ALOT of sine behavior: everywhere- from main menu buttons to in-game objects, can it slow the game down)

5. Using different event sheets for different layouts? (I am using one event sheet for several layouts so that I can use the same variables, is this option just for organization)

It's an endless running game. I'm deleting the randomly generated tiles as soon as they get out of window view. I'm also deleting all sprites that go outside the game's window. I'm using CocoonJS latest version 2.0.0.1 and C2 latest stable.

Thank you for your help! :)
Last edited by thesecretweapon on Fri Jun 13, 2014 4:05 pm, edited 1 time in total.
B
10
S
2
Posts: 79
Reputation: 1,122

Post » Fri Jun 13, 2014 3:42 pm

thesecretweapon wrote:My android game is lagging even on Samsung flagship device S4. Can these things be done to improve performance?

1. Reduce the size of sprites using photoshop and then importing it instead of importing a large size (say 128x128) and shrinking it in C2 to a smaller size (say 64x64)

2. Decrease the number of layers which are in parallax scrolling (right now there are 3)

3. Decreasing the number of frames of the player and increasing it's fps.

4. Removing Sine behavior and instead using animated sprite to do the same job. (I use ALOT of sine behavior: everywhere- from main menu buttons to in-game objects, can it slow the game down)

It's an endless running game. I'm deleting the randomly generated tiles as soon as they get out of window view. I'm also deleting all sprites that go outside the game's window. I'm using CocoonJS latest version 2.0.0.1 and C2 latest stable.

Thank you for your help! :)


1 and 3 will help memory usage wise (and since cocoonJS lacks of a clean memory management, it can help, not in all cases though)

4 will help if the logic of the game is too heavy, you also might want to see if your events aren t doing tasks when there is no need.

2 I do not know if it will have an impact
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Fri Jun 13, 2014 4:07 pm

Aphrodite wrote:
1 and 3 will help memory usage wise (and since cocoonJS lacks of a clean memory management, it can help, not in all cases though)

4 will help if the logic of the game is too heavy, you also might want to see if your events aren t doing tasks when there is no need.

2 I do not know if it will have an impact


I think I may have some lousily coded events that are doing unnecessary work. There is a considerable logic involved in this game. Can this effect the performance dramatically?
B
10
S
2
Posts: 79
Reputation: 1,122

Post » Fri Jun 13, 2014 4:25 pm

thesecretweapon wrote:
Aphrodite wrote:
1 and 3 will help memory usage wise (and since cocoonJS lacks of a clean memory management, it can help, not in all cases though)

4 will help if the logic of the game is too heavy, you also might want to see if your events aren t doing tasks when there is no need.

2 I do not know if it will have an impact


I think I may have some lousily coded events that are doing unnecessary work. There is a considerable logic involved in this game. Can this effect the performance dramatically?


it depends, exemple: if you are moving like hundreds of ennemies that are far off screen, which also implies that their AI is still active in that case where it does not affect the actual gameplay in any way, then it can be rather problematic.

Of course on mobile the situation is more threatening than on PC.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sat Jun 14, 2014 10:47 am

Any other tips?
B
10
S
2
Posts: 79
Reputation: 1,122

Post » Sat Jun 14, 2014 12:15 pm

See Performance tips. Anything not mentioned there will probably have no significant effect.

I hope for #4 you're not planning on replacing it with animation frames - that will be far, far less efficient. The sine behavior actually has an almost zero performance overhead so I seriously doubt it is causing any issues.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,772


Return to How do I....?

Who is online

Users browsing this forum: evillair, lordsas, Matei511, tarek2 and 67 guests