Need help with game lagging on phone...

Get help using Construct 2

Post » Mon Sep 22, 2014 12:34 am

i hade same performance problems as you in the begining ,here are some performance tips :
- manually make your collision polygons and reduce the points if possible.
- don't make very big objects , i know when you are a begginer you just drop 2000x1000 image to be a backdround
just split it for example the background for the sky used a tiled background using small 32x32 single color image.
and the backgrounds element as sprites for examples the trees and clouds and moutains each one of them in a sprite , that would be usefull to make parallax too to make the game looks nice.
- reduce the loops and timed events as much as you can , when you know the score will change only when action happens for example player passes an obstacle , there is no need to make everytick set text....that uses a lot of the devices resources with no need.
- if you need an object with 64*64 size don't make 256*256 then scale it down in the editor thats not helpful to save the platform resources.
- try not to make more than 20 sprites in a single layout. if you need something to be used in another layout don't make another oobject just use that one, to minimise the number of used assets and the app size and the loading time.
- don't use text object use sprite-font instead.
- some proprities are helpful , like pixel rounding , enabling opengl , not clearing background, fullscreen scaling.
- try not to make more than 100 event in eventsheet.
- there are some very helpful features in C2 like importing eventsheet into other layout. and making groupes and functions when you don't need some event tests to happen yet just put them in a inactive groupe and activate them when needed the same for function when you need some some actions to happen in my conditions just put them in a fonction and call it when you need it.
- use as less physic as you can you know it need a lot of mathematic calculations.

and finally in export process don't forget to compress Png even brute compression isn't bad C2 suggests normal compression because it takes less times i didn't have problems with brute compression. and don't export to phonegap it kills the game performance.

when you make project be sure to do all the above and i'm sure it's going to be fine.

ohh i mostly forgot , don't forget to destroy objects outside of layout or when it not needed anymore. some people spawn a lot of objects like in autorunner the obstacles will randomly generated and keep moving until they leave the layout view. it's not helpful at all t have 100 ojects keep moving to the infinity , and the apps makes the calculations for them while you don't need them anymore.

i hope this helpful , i'm sure you have read the performance tips in the tutorial but i have mentoned other things that might be very helpfull too.
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Mon Sep 22, 2014 5:18 am

The next power of two value after 512x512 is 1024x1024 after that 2048x2048 etc..

Anything over 512x512 is gonna (just check in debug mode, notice how much cpu is beeing used and what is taking up the most memory) .

you can also do stuff like 512x256 and such if it helps maintain , and if its still looking distorted change your game to pixel rounding: ON & sampling to Point
B
6
S
2
Posts: 151
Reputation: 1,366

Post » Mon Sep 22, 2014 6:43 pm

Thanks for the replies, i've tried the power of 2 for my background but my background sizes are a bit awkward, as i have 4 different sprites for my background working as a parallex. Each one of these has a width of 960 but different heights (my game layout is 960,540). This could seem a little confusing so rather than attempt to try explain, i'll just post a capx.

With this capx, i've stripped my game down completely. I've changed the sprites from my game to random ones i've found on the net. This is more or less my game but i've taken some things out, but the main parts such as platform movement etc are there. I've actually left the sizes of the sprites so that its as similar as my actual capx as it can get.

Would be grateful for any help.
You do not have the required permissions to view the files attached to this post.
B
5
S
2
Posts: 126
Reputation: 876

Post » Wed Sep 24, 2014 3:10 pm

Anyone?
B
5
S
2
Posts: 126
Reputation: 876

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests