Edited by vb66r55, 21 November 2019 - 04:58 PM.
The game can run 60FPS on a PC, but only 30FPS on the phone?
Nov 21 2019 11:30 AM
5 GB of ram seems like an odd number (brilliant, I know, this works on two levels!)
This isn't purely a question of your device's RAM though. I'm also expecting that the 1.3 to 2 GB that you are talking about refers to the game's installation size, not its texture memory usage. The most likely answer as to why a much larger game performs much better is that it is simply optimised better. Your computer probably has a dedicated GPU with sufficient RAM to run everything by itself. Phones rarely do. Even if your game is poorly optimised, a standard computer packs so much more power than a standard phone that it should have no problems with running poorly optimised mobile games.
Now, over 800MBs of texture memory usage is very large, especially for a mobile game, but if I'm not mistaken, we've talked about this before. In order to hit that, you could simultaneously load 13 images that are 4096 x 4096 pixels in size, which is really excessive.
The easiest solution is to optimise your image sheet usage. You can do things like trimming down the existing image sheets, being smart about when and where to load them (and when to unload them), as well as knowing what images are often used together.
For instance, if you have some UI assets that are required everywhere, then put those in a sheet of their own so that you don't need to load any more than you absolutely have to. Then again, you'll most likely have lots of assets that will only be required in specific scenes, so be sure to load and unload them when necessary. When you properly split your assets based on where they'll be used, you can reap significant performance boosts.
Finally, since you are working with animations, one of the most significant things that you can do is to literally optimise your art. I'm assuming you have a player character with a walk cycle? A simple, effective and good looking walk cycle can often be done with 3 frames. If you instead want to go for "perfectly smooth", then you'll require around 15-20 frames. So, knowing where to cut and how can save you significant amounts of space. Same goes with attack animations. If your player character has a gun and you animate a sequence where the character pulls out their gun, aims and fires, and then the blast effect fades away, you'll be looking at a lot of unnecessary and wasteful frames. If the gun were in a sequence of its own, at least partially, you could cut the firing sequences frames in half again, etc.
So, simply put, there's a lot that you can do. Then, the reason why there is a significant performance hit with keeping animations running when they aren't needed is because they require the engine to keep handling large image files. If you don't need to run something, then don't. It's as simple as that.
- pixec likes this
@pixec Yes,I have set up in the initial production.
The big game I played, the installation size is 3.5GB, I detected that it memory consumption is 1.3~2GB in actual operation, it is amazing.
But it is extremely smooth, except for a little power problem.
This makes me wonder how it did it.
In addition, we did discuss it before, but in the end I changed it to 2048*2048, after all, there seems to be restrictions on the phone on the document.
However, the image is really a big problem. I have to make a choice. I am currently testing on my mobile phone and found that the main cause is Local and Gobal. I am trying to cancel Gobal and use Local. Thank you, I have learned a lot.