Core Engine optimizations for Mobile Deployment

Koder

Veteran
Veteran
Joined
Oct 23, 2016
Messages
30
Reaction score
22
First Language
Polish
Primarily Uses

KODERA optimization 1.0.4
by Mariusz 'koder' Chwalba

 


Introduction
This plugin exchanges various elements of core RPG Maker engine with faster counterparts. No functionality is lost or gained. Function most noticeable on low-end phones / tablets / netbooks.


Features

  • Improves framerate and decreases battery usage on mid-range mobile devices.
  • No other effect on game whatsoever.


How to Use

  1. Download KODERA_optimization.js into js/plugins directory.
  2. Activate in plugin manager (F10)



Changelog

  • 1.0.0 - initial release
  • 1.0.1 - fixes incompatibility with YEP_X_VisualHpGauge
  • 1.0.2 - hotfix for another incompatibility with YEP_X_VisualHpGauge
  • 1.0.3 - fixes in-animation SE not playing
  • 1.0.4 - fixes game freeze when using skill targeting all allies



Terms of use
Plugin is FREE to use in both FREE and COMMERCIAL products. No guarantee, implied or otherwise, is given. Attribution required in reasonable place (credits). 


Bugs and feature requests


Bug reports and feature requests are accepted on GitHub issue tracker.


Compatibility


Tested with RPG Maker MV 1.3.2, 1.3.3 and 1.3.4.


Notes and recommendations


Plugin was made to enable deployment of RPG Maker games to mid-range mobile devices. My reference devices were Samsung GT-I9300 (galaxy S3) and MyPhone Q10 Premium. Both devices shown improvement in framerate from 20% (idle map, from 23 FPS to 30 FPS) to 500% (combat animations, from 1 FPS to 5 FPS). Your experience may wary depending on devices and plugins used and general structure of game. No other changes made to functionality of game engine - just replaces some functions with faster variants.


I recommend also updating PIXI.js rendering engine to latest version. You can get latest stable release here: http://pixijs.download/release/pixi.min.js 


Latest release of PIXI.js - v4.2.2 - is not compatible with RPG Maker as of 1.3.4; I have confirmed compatibility of v4.1.1 which can be downloaded from https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.1.1/pixi.min.js
 
Last edited by a moderator:

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,261
Reaction score
1,563
First Language
PT - EN
Primarily Uses
RMMV
When i download the pixi update its named as "pixi.min.js", is this a problem?


Changing the pixi.js screws up with Yep Grid Free Doodad


There's also issues with combat plugins

TypeError: Cannot read property 'height' of undefined
    at Window_VisualHPGauge.makeWindowBoundaries (/D:/Drive/Project%20TimeWarp/Project%20Timeless/js/plugins/YEP_X_VisualHpGauge.js:511)
    at Window_VisualHPGauge.updateWindowSize (/D:/Drive/Project%20TimeWarp/Project%20Timeless/js/plugins/YEP_X_VisualHpGauge.js:502)
    at Window_VisualHPGauge.updateWindowAspects (/D:/Drive/Project%20TimeWarp/Project%20Timeless/js/plugins/YEP_X_VisualHpGauge.js:484)
    at Window_VisualHPGauge.update (/D:/Drive/Project%20TimeWarp/Project%20Timeless/js/plugins/YEP_X_VisualHpGauge.js:480)
    at Sprite.update (/D:/Drive/Project%20TimeWarp/Project%20Timeless/js/plugins/KODERA_optimization.js:26)
    at Spriteset_Battle.Sprite.update (/D:/Drive/Project%20TimeWarp/Project%20Timeless/js/plugins/KODERA_optimization.js:26)
    at Spriteset_Battle.Spriteset_Base.update (rpg_sprites.js:2141)
    at Spriteset_Battle.update (rpg_sprites.js:2448)
    at Spriteset_Battle.update (/D:/Drive/Project%20TimeWarp/Project%20Timeless/js/plugins/YEP_BattleEngineCore.js:2986)
    at Spriteset_Battle.update (/D:/Drive/Project%20TimeWarp/Project%20Timeless/js/plugins/MOG_ComboCounter.js:167)
 
Last edited by a moderator:

Koder

Veteran
Veteran
Joined
Oct 23, 2016
Messages
30
Reaction score
22
First Language
Polish
Primarily Uses
When i download the pixi update its named as "pixi.min.js", is this a problem?
It should be named pixi.js in your project. The .min means that it is minimised (removed whitespace), but with .min infix engine won't pick that up.

There's also issues with combat plugins
Confirmed incompatibility with YEP_X_VisualHpGauge; I'm taking a look at it right now.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,948
Reaction score
3,034
First Language
French
Primarily Uses
RMMV
@Koder interesting! 


did you tried to contacts Degica devs for propose those fix for MV? I think they could be implement inside of MV new update if this help improvement.


I did noticed your removed the forEach lol wich is a good thing's ForEach is horrible haha
 

Koder

Veteran
Veteran
Joined
Oct 23, 2016
Messages
30
Reaction score
22
First Language
Polish
Primarily Uses
@kovak Managed to isolate edge-case problem with YEP_X_VisualHpGauge (children added in update), recently released 1.0.1 works with it. As for  Yep Grid Free Doodad incompatibility with new pixi.js - can't promise anything, but keep in mind that update of pixi in core engine is likely in new releases, so i would suggest contacting plugin author to take a look at it.


@nio kasgami forEach is a quite elegant solution, but not in android environment - it's just slower, especially if spawning new functions inside a loop. As my initial experienced with android deployment were terrible I did my own profiling. As you can see in posts above, despite similarity this is not 100% identical solution. Problem of YEP_X_VisualHpGauge was caused by plugin adding sprite children within update itself (which my opt handled and original did not), there is also problem with another execution context (this). I think right now suggestion to include this into RPG maker update itself is premature - especially if plugin has exactly same effect and can be easily opted out if problem occur.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,948
Reaction score
3,034
First Language
French
Primarily Uses
RMMV
@kovak Managed to isolate edge-case problem with YEP_X_VisualHpGauge (children added in update), recently released 1.0.1 works with it. As for  Yep Grid Free Doodad incompatibility with new pixi.js - can't promise anything, but keep in mind that update of pixi in core engine is likely in new releases, so i would suggest contacting plugin author to take a look at it.


@nio kasgami forEach is a quite elegant solution,am but not in android environment - it's just slower, especially if spawning new functions inside a loop. As my initial experienced with android deployment were terrible I did my own profiling. As you can see in posts above, despite similarity this is not 100% identical solution. Problem of YEP_X_VisualHpGauge was caused by plugin adding sprite children within update itself (which my opt handled and original did not), there is also problem with another execution context (this). I think right now suggestion to include this into RPG maker update itself is premature - especially if plugin has exactly same effect and can be easily opted out if problem occur.
you actually marks a points here I didn't think about possible bug.


I think the most possible ways to maybe optimize but keepings the ForEach methods would be to use For of equivalent (typescript did a great job to it) Wich do the same jobs than ForEach but without is inconvenient.
 
Last edited by a moderator:

Koder

Veteran
Veteran
Joined
Oct 23, 2016
Messages
30
Reaction score
22
First Language
Polish
Primarily Uses
Last edited by a moderator:

doranikofu

Veteran
Veteran
Joined
Oct 4, 2015
Messages
113
Reaction score
31
First Language
Chinese
Primarily Uses
nice work.


I have noticed an issue for animation. The in-animation SE won't play if I have the plugin on.


Once I disable the  Sprite_Animation.prototype.updateFrame function in the plugin the SE plays as normal.


The SE called by other plugins (battle voice, SE played upon char action) are normal.
 

peter8031983

Warper
Member
Joined
Nov 23, 2014
Messages
3
Reaction score
2
First Language
Russian
Primarily Uses
N/A
Hi, Koder . I found the bag. I used animation without image. As in the screenshot. Just to mark the target. But it's not showing.


 

Koder

Veteran
Veteran
Joined
Oct 23, 2016
Messages
30
Reaction score
22
First Language
Polish
Primarily Uses
@doranikofu Good catch, that was an embarrassing oversight. Just released 1.0.3 should not be affected by this issue.
 

Koder

Veteran
Veteran
Joined
Oct 23, 2016
Messages
30
Reaction score
22
First Language
Polish
Primarily Uses
@peter8031983 please kindly re-check this issue with 1.0.3; it was being released just as you posted your bug report.
 

Koder

Veteran
Veteran
Joined
Oct 23, 2016
Messages
30
Reaction score
22
First Language
Polish
Primarily Uses
I have confirmed compatibility of my plugin with recently released RPG Maker MV 1.3.4. There Is a compatibility issue with latest version of PIXI.js rendering library, so I have edited original post to point to a compatible version (v4.1.1).
 

doranikofu

Veteran
Veteran
Joined
Oct 4, 2015
Messages
113
Reaction score
31
First Language
Chinese
Primarily Uses
just noticed another issue. The edit to Scene_ItemBase.prototype.applyItem causes the game to freeze if I use item/skill in menu that targets all ally. Once I disable this edited function everything works again.
 

watermark

Veteran
Veteran
Joined
Dec 25, 2012
Messages
612
Reaction score
540
First Language
English
Primarily Uses
RMMV
@Koder Hello Koder. Your optimization script has been used in the iOS build of our game Shinobi. You can find the game here: 




You have of course been credited. We're not memory experts so we are not really certain how much improvement the script changed the iOS build. But thanks anyway and feel free to test it out! Also if you need the source code for the game please feel free to PM me.
 

doranikofu

Veteran
Veteran
Joined
Oct 4, 2015
Messages
113
Reaction score
31
First Language
Chinese
Primarily Uses
just curious, are there any changes in MV 1.3.5 that necessitate an update for this plugin?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I wrote a nice animated preloading system for mv+mz today. It only supports graphic assets atm, should it support audio too? See it in action in my recent minigame @
I posted my first commercial game on the forums, and now waiting for approval.
fingers crossed.
TMW the air quality is so bad, your hair changes color every time you wash it. :LZYyuck:
Finished two animations today. :kaojoy:
Sigony wrote on Ksi's profile.
Just wanna say that I love your videos.
When are you fighting Floyd Mayweather?

Forum statistics

Threads
102,998
Messages
996,631
Members
134,482
Latest member
Kartof
Top