What are your experience on trying to boost a MV project on an, say, an Android 7+ phone with Snapdragon 625 and 720x1440 px to a constant 60 fps?
I know that something like Snapdragon 625 is nowhere powerful nowadays, but I still want to cater for such phones, at least because my phone's using an even worse Snapdragon 450, and I want my projects to run fast there(so I know mine will run even faster on most of the others) 😀
Right now it's still very hard for me to do that in battles(while it's easy outside battles) even with WebGL mode, especially with an ATB system plugin, which is already heavily optimized by me(otherwise the fps can't even reach 15 in the worst case).
Even with only several plugins(nothing too complicated nor convoluted) and without that ATB plugin, I can still only barely stay close to 60fps most of the time in battles(when skill/item animation plays that's even much worse).
The best minimum I can get is usually 30+ fps with Pixi 4.5.4(with occasional drop to around 15fps), and usually 45 fps+ with Pixi 5.3.0(with occasional drop to around 30fps).
While 45fps most of the time might still be tolerable(assuming that I could ever fix all Pixi 5.3.0 issues I'm facing), I still wonder whether anyone's managed to keep a constant 60 fps on what mobile phones with what kind of project size, and how that can be done 🙂
Optimizing is tough after a game is well established in the development cycle, I think the best option is to see where your bottlenecks are and focus your attention there. You say the battle scene is the culprit, so the next step is to figure out which part of battles are most taxing to the system. If I had to take a wild guess(not actually a guess) it would most likely be the animations. Animations use Bitmap and Bitmap uses CPU, the less CPU we use on mobile the better, especially for older devices.
The solution would be to make sure the animations are drawn using the GPU. The best way to do that would probably be to write a whole new class for battle animations that utilizes PixiJS and strays very far away from the dreadful Bitmap class lol But manipulating the current class may very well be possible and maybe even a quicker route to go.
As a test you might want to try and disable animations from rendering in the battle scene and then test your game again on the mobile device to see if you gain that precious fps or not.
I think there is actually a plugin to help optimize performance a bit. I can't recall exact name but try searching it and giving it a try
Mobile has the weirdest issues. I had one battle in my game just cause immense lag, despite being nothing really different from anything else. Even when I removed pretty much everything, including all eventing, and reduced enemy sprites to mono-colour squares, it still lagged on that one simple encounter.
First of all, thanks for all of your invaluable replies 😀
Upon more investigations, I realized that a significant cause of low FPS in my snapdragon 450 phone is memory leaks from Pixi 5.3.0 and/or its adaptation to the default RMMV, because its memory usage noticeably increased even if there were no memory leak, and memory allocations usually consumes time, especially on phones.
I've tested that Pixi 5.3.0 and/or its adaptation to the default RMMV caused the extra memory leaks in the following plugins I'm using:
1. MOG_BattleHud.js(v5.04) - About extra 13 - 23MB per battle in my PC
2. Yanfly Engine Plugins - Battle Engine Core(v1.51) - About extra 1 - 5MB per battle in my PC
3. The ATB system plugin I'm using - About extra 7 - 18 MB per battle in my PC
Also, Pixi 5.3.0 and/or its adaptation to the default RMMV can leak as much as 50 - 61MB memory per battle from the 2nd battle onward.
I've factored out the fact that audios and images might be cached, as all battles are identical, meaning that all audios and images involved are already appeared in the 1st one(and thus cached if they're to), so there should be no valid reason to have such a significant increased memory usage after the ends of subsequent battles.
With Pixi 4.5.4, the default RMMV doesn't leak memory at all, and each of those plugin only leaked 1 - 2MB per battle in my PC(sometimes even less), which is good enough for me.
However, I still want to adapt to Pixi 5.3.0 as it does boost performance if there were no memory leak, so I think I'll have to fix this memory leak issue.
Right now, with either just the ATB system plugin, or with all the other plugins excluding that ATB system plugin, I managed to barely touch 60FPS most of the time and 45 FPS when playing animations in battles, all with the Pixi 5.3.0 upgrade(I finally managed to get all those upgrade issues out of my way for now) but without the use of a preloader plugin.
I've also used an audio/image resource preloader plugin in my project(with the audios/images already compressed without that plugin of course), and upon testing in my snapdragon 450 phone, the minimum FPS when playing animations in battles have slightly increased from nearly 45 to nearly 50, but now the app takes close to 8 seconds to load and the memory usage has increased by around 256MB.
Of course, that's because it's the result of a stress test involving 851 preloaded audios and images in total lol
On the other hand, with all plugins including the ATB system plugin and resource preloader, nearly 45FPS most of the time and close to 30FPS when playing animations in battles is still all I can get(my adpatation to Pixi 5.3.0 was broken but that broken version "boosted" the FPS by around 5) 🙂
As for the other things, I don't use parallax at all and I only use very few script calls.
Regarding on optimizing the default MV codebase to draw images using GPU instead of CPU, I might have to have a try, but it's unlikely that I'm this capable yet, let alone not creating some other issues like compatibility and/or breaking some other default behaviors(even just my use of an adaption to Pixi 5.3.0 has caused such a ridiculous memory leaks already) 😛