Performance Optimization for Mobile games - More FPS and less Ram - Better fps

3 favourites
  • 1 posts
From the Asset Store
Create a game inspired by great arcade classics as Operation Wolf
  • Hey, I have always struggled with the fps of my game, so I did a lot of research and looked through many forum posts as well as Ashley's guides (that I can really recommend!) for optimizing your game. I have stumbled across a few "magic settings" you can use to get instantly higher fps, will explain them quickly and show you other ways to improve the performance of your (mobile) game. I managed to get my game from 2.5GB of ram to just 250, as well as getting it from crashing instantly to stable > 60 fps on my older galaxy s8.

    ---

    Project Settings:

    Sampling: Does not make a big performance difference at all.

    GPU Preference: High Performance makes a slight difference, use it instead.

    Downscale quality: for my game, this made quite a big difference, but it really depends on your game, so do proper testing. I recommend putting it on low for you mobile game, if the textures are high resolution.

    Max Spritesheet size: A smaller size is worse for cpu performance, however it really decreases ram usage. The switch from 4096 to 2048 saved a lot of memory for me while only very slightly impacting cpu performance - recommended!

    Fullscreen Quality:

    Basically, due to scaling, setting this to low will make the game a bit more pixelated (which you can't see on my 1440p phone display!) but can make quite a difference regarding performance. Setting it to high will render the game at the screens resolution while low will render it at the set viewport resolution and simply scale it to fix the screen. So depending on whether your game has a higher or lower resolution than your target device, either setting can be beneficial.

    Anti-Aliasing: Makes a bit of a difference when it comes to performance, so for mobile games if your game uses very detailed sprites you might want to turn it off.

    ---

    Ram usage:

    Bigger sprites use way more ram than smaller ones. You might think a 4000x4000 image only uses double the amount of ram as a 2000x2000 one, but actually it uses 4 times that. This is due to the amount of pixels in the 4000x4000 image. Make sure to downscale images to the smallest size that still looks pleasing. For pixel art, this is of course not an issue. For buttons, 250x250 is enough in most cases. Try to downscale all images by alot.

    Spritesheets work in a way, that for example a 400x400 image occupies a 512x512 space and a 600x600 image actually uses a 1024x1024 spritesheet space so make sure they are always under these numbers if possible. For example, a button that is 258x258 needs a 512x512 space, so rather go for 256x256. Compressing images to a smaller size ONLY makes your game smaller, not the ram usage as they are converted into a different format in ram so they can isntantly be displayed when needed.

    You can also use SVG images for static sprites - not moving sprites, cause then this will be very cpu intensive. When you downscale an image in the animation editor, try to use smoothing as it makes edges less rough so the image actually looks smoother and higher resolution.

    In the DEBUG Layout you can see, which layers use the highest amount of ram, so use this for detecting large sprites.

    You might wonder, how much ram these new phones can even handle.

    My S8 struggled a bit with 500mb of ram, while new flagship phones can even handle 1.5GB, however it is really bad for gpu performance so try to minimize ram usage as much as possible. If your game has many scenes, it might be worth it to unload certain sprites out of memory, there is an action under "system" for this.

    CPU Usage:

    This is a bit more interesting. Here, you can use the Debug Layout too to find out which groups use a high amount of cpu, however, make sure to put the frame rate mode to unlimited if testing!

    You might have already heard that for example "every tick" uses a lot of cpu power, so rather go for someting like "if variable<7" etc instead. Also, settting a text to something every tick or very often uses a lot of cpu too.

    You might want to use a sprite font for that. Very handy is "trigger once" for certain actions that only need to be triggered once when a certain condition becomes true. For Triggers (the ones with the green arrow) this is done automatically and they only trigger once. For other actions (for example, "if text="0" " you might want to use "trigger once" instead if the action only needs to activate once the condition becomes true (or becomes true again). Another trick is, to turn of certain groups in your code when you don't need them. For example, if my shop menu isn't opened, I can turn off most of it's code.

    GPU Usage:

    This is pretty straightforward. All effects except of simple color changes etc. consume quite a lot of gpu power. For example the water shader, when applied to bigger sprites, uses a lot of gpu performance. When you use particles, you can test if they are still "on screen", and if not, destroy them, as they still use cpu (?) performance if they are outside of the layout. Using small sprites as described under Ram Usage also helps a lot.

    On static layers you can also activate "render cellls", I did that on my background layer. Do NOT do this on layers with particles or moving objects though, it reduces performance significantly. Adding more layers itself does not decrease performance. Objects that are 0% opacity still use some gpu power, so make sure to destroy them or set them to invisible.

    Final words:

    I hope this short guide was able to help you. Of course, this can't fix messy code or gigantic layouts, but can still improve your fps by a lot. So make sure to optimize your code and keep it as short as possible, also you can try using java script in construct as it also has a better performance that the actions but you should be fine with visual scripting (like I use) too. If you have any other tricks or tips to improve performance, make sure to let me know in the comments!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)