[RMMV]Your tricks on optimizing MV projects on mobile phones?

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,600
Reaction score
659
First Language
Chinese
Primarily Uses
N/A
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) :D

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 :)
 
Last edited:

LTN Games

Code Sorcerer
Veteran
Joined
Jun 25, 2015
Messages
687
Reaction score
585
First Language
English
Primarily Uses
RMMV
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.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,418
Reaction score
669
First Language
Portuguese - Br
Primarily Uses
RMMV
There is a lot of things(or little things) you can do:
- Use TinyPng on all your image files.
- Avoid parallax.
- Avoid script calls.
- Smaller resolutions work better.
- Don't use many plugins(Unless you know what you are doing, I mean, knowing what your plugins is doing on the codes).
- Particularly, I would suggest a preload plugin too. I think it is better to wait some seconds on the loading screen(when the player expects loading) than play a lag game(when the player expecting play, but it is lagging).

But honestly, Mv code is not the best for mobile, especially the battle scene. I had tried a lot for mobile and made several tests. If you are really trying to aim at low phones, you will have a hard time. =/
(Let's hope MZ fixes that...)
 

J-G

Veteran
Member
Joined
Oct 4, 2019
Messages
554
Reaction score
128
First Language
English
Primarily Uses
RMMV
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
 

Milennin

"With a bang and a boom!"
Veteran
Joined
Feb 7, 2013
Messages
2,353
Reaction score
1,499
First Language
English
Primarily Uses
RMMV
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.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,600
Reaction score
659
First Language
Chinese
Primarily Uses
N/A
First of all, thanks for all of your invaluable replies :D

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) :p
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Small rant: While using SRD Hud maker for a battle hud, I typed in the wrong script call and got an error, but then forgot to delete the piece that caused the error before closed the Hud maker and hit F5 to restart the game. Now everytime I engage in a battle my game crashes...
:kaolivid:
Would Jump into Javascript be best off continuing to break down the MV core files, or would people prefer a quick detour to cover everything that's changed in the core from MV to MZ?
Not going to lie... PIXI Particles make fantastic graphics... But predicting the hitbox of something with a "fixed size" but whose graphics can stick out past that, is quite challenging. :kaoswt:
Would you like a glass of spiders?

Forum statistics

Threads
100,530
Messages
976,897
Members
132,081
Latest member
Kaezyelnatz
Top