Core Engine optimizations for Mobile Deployment

● ARCHIVED · READ-ONLY
Started by Koder 20 posts View original ↗

  1. 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
  2. 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)
  3. kovak said:
    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.

    kovak said:
    There's also issues with combat plugins

    Confirmed incompatibility with YEP_X_VisualHpGauge; I'm taking a look at it right now.
  4. @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
  5. @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.
  6. Koder said:
    @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.
  7. nio kasgami said:
    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.



    @nio kasgami According to this benchmark - on my test machine - for..of is 98-99% slower than simple for. 
  8. 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.
  9. 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.


  10. @doranikofu Good catch, that was an embarrassing oversight. Just released 1.0.3 should not be affected by this issue.
  11. @peter8031983 please kindly re-check this issue with 1.0.3; it was being released just as you posted your bug report.
  12. Koder said:
    @peter8031983 please kindly re-check this issue with 1.0.3; it was being released just as you posted your bug report.

    Thank you very much. Everything works as it should! :guffaw:
  13. Koder said:
    @doranikofu Good catch, that was an embarrassing oversight. Just released 1.0.3 should not be affected by this issue.

    thank you! it is fixed now.
  14. 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).
  15. 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.
  16. @doranikofu Please re-test this issue with newly released v1.0.4.
  17. Koder said:
    @doranikofu Please re-test this issue with newly released v1.0.4.

    yes it is fixed now, thanks~
  18. @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.
  19. just curious, are there any changes in MV 1.3.5 that necessitate an update for this plugin?
  20. @doranikofu , I tested with MV version 1.4.1, and it still works.