How do I Make This Game Run Smoothly

Get help using Construct 2

Post » Fri Jan 30, 2015 5:17 pm

Hello,

I am trying to make a photo slide puzzle game and I have managed to make it work properly on browser but it is working very slow on android device and sometimes the sound plays late it seems like the game is lagging too much. I have exported the game with Intel XDK crosswalk and the fps is always around 58 - 60. I checked it on my Google nexus 7 tablet and it works smooth on it but it doesn't work well on Galaxy S3 and Galaxy S2. Please let me know how do I improve the performance for this game. I had so many plans to work on different games for Android using Construct 2 and the only thing stopping me is the performance of the games on Android platforms.

Please download the .capx file from this linke: https://www.dropbox.com/s/4uxr7uu09yovg0u/slidephoto.capx?dl=0

Please help me with it.

Thank you
B
7
Posts: 41
Reputation: 359

Post » Fri Jan 30, 2015 5:52 pm

The first thing I would do is replace all of your text objects with sprite fonts. You're using a lot of them and they are hard on performance. Also, it looks like you're updating some of them every tick. Instead you should only update them on an event where they would change.
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Fri Jan 30, 2015 6:09 pm

@Burvey Thank you so much for replying. I will replace the text objects with sprite fonts. Could you please tell me more about this line "Also, it looks like you're updating some of them every tick. Instead you should only update them on an event where they would change."

Which Layout and Event sheet you you talking about for this please?

Thank you
B
7
Posts: 41
Reputation: 359

Post » Fri Jan 30, 2015 6:52 pm

For example, I'm guessing that you only need your level text to update when you change levels. So instead of updating it every tick like you are now, just change it when your level changes. The same with the level score (time). Currently you're updating it every tick, but you could just update it every second instead and it would be much more performance friendly. Those are both from the Level_1_world sheet.

Also on the Main event sheet you are saving to webstorage every tick. Is there a way that you can set that up differently (In other words, does it really need to update every tick)?
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Fri Jan 30, 2015 8:49 pm

@Burvey Thanks for the reply.
- That every tick on Main event sheet was just for testing it is not needed at all and it wasn't included in the .apk file which I created using Intel XDK so the performance issue was before that.
- On the Level_1_world event sheet I now realize that the for loops are running every tick and even if it doesn't find true condition it still runs every time.

I will try to fix that as well as other suggestions you have made.

Thank you
B
7
Posts: 41
Reputation: 359

Post » Fri Jan 30, 2015 9:18 pm

I'm glad you noticed that. :) I was going to bring up the for each loops after you got the text stuff figured out as not to confuse you. Even better that you noticed it on your own!
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Fri Jan 30, 2015 9:33 pm

@Burvey
I have put the for loops under start of layout so they only run once as they are not required to run every tick but just once for the tiles placements in sequence then randomize their positions to start the game.

Thank you very much, I am almost done with it and then I will export the .apk file to see how it works.
B
7
Posts: 41
Reputation: 359

Post » Fri Jan 30, 2015 9:48 pm

Nice! Good luck.
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941

Post » Sat Jan 31, 2015 2:21 pm

@Burvey

I have done everything you have suggested and the game performance was a lot better but still had some lag issues so I exported it for CocoonJS and compiled it using Ludei compiler it seems to work without any performance issues but the only problem I am facing now is the screen size.
I used the window size to 600 x 800 and used Scale inner which takes a lot of game area out of the window and when I used Letter box scale the things are distorted like they are not on their proper places.

Please tell me how do I fix this screen size problem?

Thank you
B
7
Posts: 41
Reputation: 359

Post » Sat Jan 31, 2015 5:24 pm

I'm probably not the correct person to help you with that type of issue as I've never ran into it before.
B
60
S
20
G
56
Posts: 1,077
Reputation: 35,941


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 2 guests