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

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,829
Reaction score
977
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

Indie Studio
Veteran
Joined
Jun 25, 2015
Messages
708
Reaction score
638
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
2,033
Reaction score
1,513
First Language
Portuguese - Br
Primarily Uses
RMMZ
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
668
Reaction score
164
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,877
Reaction score
2,048
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,829
Reaction score
977
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
 

furkan2

Villager
Member
Joined
Feb 8, 2020
Messages
12
Reaction score
2
First Language
Turkey
Primarily Uses
RMMV
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
Hello. Did you find solutions to memory leaks?
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,829
Reaction score
977
First Language
Chinese
Primarily Uses
N/A
Hello. Did you find solutions to memory leaks?
I still haven't completely solved the memory leaks from Pixi 5.3.0 adaptation with RMMV yet.
However, you can check this post :)
 

Latest Threads

Latest Posts

Latest Profile Posts

Have spent too much time hammering out with a friend just how to make a reoccurring enemy that permanently learns skills you use against her.
I know what I want in a loose sense. Maybe I should just make a post asking for opinions and suggestions.
Shoot Enemy Off-Screen, Run RPG Maker Game as a Web Server, & Thai Keyboard | RPG Maker News #109

Some people have too strong of an opinion about what maker is the best, I've seen discussions like:
- I prefer VXAce because I like the style of the RTP better than the older releases
- You're worse than Hitler
My number one take away from this game jam is to make small games that are as polished and bug free as possible. Far less dev time, and if the game flops, it matters less because my time investment is much lower. Also, whatever ambitions I have... aim for about 10% of them. They are clearly too high, and will involve stuff that likely won't matter.

Forum statistics

Threads
113,729
Messages
1,076,995
Members
147,760
Latest member
Hattalu
Top