How to Update NW.js to Dramatically improve Game Performance!

● ARCHIVED · READ-ONLY
Started by KillerGin 273 posts Page 10 of 14 View original ↗
  1. Blackfield said:
    Help anyone?

    Really want to get the most out of the engine before release :)
    My best guess is that since you have nw-commit-id there, perhaps you downloaded a preview or nightly build rather than a stable one? Sometimes those are versioned with timestamps or git commit ids.
  2. contentdeleted said:
    My best guess is that since you have nw-commit-id there, perhaps you downloaded a preview or nightly build rather than a stable one? Sometimes those are versioned with timestamps or git commit ids.
    Hmmm that is strange. To the very best of my knowledge I never changed any of the source files.

    I am running MV version 1.5.1 as it is the only one compatible with the plugins I use. Could that be a reason?
  3. Blackfield said:
    Hmmm that is strange. To the very best of my knowledge I never changed any of the source files.

    I am running MV version 1.5.1 as it is the only one compatible with the plugins I use. Could that be a reason?
    Ah no sorry, this is not related to MV, the process.version information is set by NW.js. So this would be related to which version of NW.js you downloaded. When I say nightly build I mean you may have downloaded a version of NW.js that wasn't published with a major version number. Again though thats just a guess.
  4. There was so many pages, that the answer I seek may be there somewhere, but I didn’t find it.
    I used this excellent guide to get my game project working properly on my mac (big sur). I still have one issue. Running the deployed game always starts with error message:
    ”Your profile can not be used because it is from a newer version of NW.js. Some features may be unavailsble. Please specify a different profile directory or use a newer version of NW.js.”

    Did I miss some step or is this normal? This is on Mac, haven’t tested on PC.

    I’ve heard this message can be pretty common with MV games, but it kind of puts a damper on the game beginning with error message. The game itself runs well.

    (Edit: and to clarify because this tutorial was on MZ category, my game is made with MV)
  5. contentdeleted said:
    Hi there, you may have already figured this out, but this is a macos specific issue (well Im like 50% sure it is, either that or its issue from nwjs73 that wasnt present in 70). Either way I helped a friend upgrade to 73 on macos earlier today and the fix is extremely simple.

    Find the `package.json` file on the root of your project folder. There should be a name field at the top, go ahead and put the name of your project there (though it doesnt really matter what you fill it with). Then you should be able to launch normally.

    Hope that helps for anyone else who runs into this.

    I had the same issue and it seems to have worked. I wanted to check though: will I need to do this for every new project?
  6. ftzpltc said:
    I had the same issue and it seems to have worked. I wanted to check though: will I need to do this for every new project?
    Glad its working for you now! Unfortunately yes, you'll have to do this for every project. I believe you can go into the program files for RMMV and change the default project files to include it though if you really want, but Im not sure that would actually save any real time
  7. Hi, KillerGin! After I update to the version you mentioned according to your method (including nw.js and pixi.js), I ran into some issues like "Unable to preventDefault inside passive event listener", there are also warnings like "DevTools failed to load SourceMap: Could not load content for chrome-extension://odlameecjipmbmbejkplpemijjgpljce/js/libs/pixi-tilemap.js.map: System error: net::ERR_FILE_NOT_FOUND", I downloaded pixi.js.map and put in the libs folder, this helped me to solve a warning of pixi.js, but I can't find one that solves the warning of pixi-picture.js and pixi-tilemap.js files document, my system is macOS Monterey 12.4, my RPGMaker MV version is v1.6.2, please help me bro.
  8. Arrose said:
    Hi, KillerGin!...please help me bro.
    If you mouse over their username, you can see they haven't been here in over a year. The bro is unlikely to help you.

    I'm sure you know this from posting in the other thread, but MV is officially not compatible with Mac OS for several versions back. I know you're trying to find a workaround, but there may not be one that makes the editor and games run properly.
  9. Arrose said:
    Hi, KillerGin! After I update to the version you mentioned according to your method (including nw.js and pixi.js), I ran into some issues like "Unable to preventDefault inside passive event listener", there are also warnings like "DevTools failed to load SourceMap: Could not load content for chrome-extension://odlameecjipmbmbejkplpemijjgpljce/js/libs/pixi-tilemap.js.map: System error: net::ERR_FILE_NOT_FOUND", I downloaded pixi.js.map and put in the libs folder, this helped me to solve a warning of pixi.js, but I can't find one that solves the warning of pixi-picture.js and pixi-tilemap.js files document, my system is macOS Monterey 12.4, my RPGMaker MV version is v1.6.2, please help me bro.
    Hi, the source map errors are warnings, these are only relevant for some of the chrome debug tools and won't prevent your game from launching or effect its performance.
    The preventdefault message is an error though and is likely the relevant problem. From what I can tell it should just require adding some css to tell the browser that the page isn't scrollable but it's strange that I haven't seen this before myself so there may be some other issues.
    Is this on a new project?
  10. contentdeleted said:
    Hi, the source map errors are warnings, these are only relevant for some of the chrome debug tools and won't prevent your game from launching or effect its performance.
    The preventdefault message is an error though and is likely the relevant problem. From what I can tell it should just require adding some css to tell the browser that the page isn't scrollable but it's strange that I haven't seen this before myself so there may be some other issues.
    Is this on a new project?
    Hi, contentdelete! It's just a blank new item.
  11. ATT_Turan said:
    If you mouse over their username, you can see they haven't been here in over a year. The bro is unlikely to help you.

    I'm sure you know this from posting in the other thread, but MV is officially not compatible with Mac OS for several versions back. I know you're trying to find a workaround, but there may not be one that makes the editor and games run properly.

    Hi, ATT_Tura. I ran into a MV crash today after I updated NW.js and Pixi.js.
  12. ATT_Turan said:
    If you mouse over their username, you can see they haven't been here in over a year. The bro is unlikely to help you.

    I'm sure you know this from posting in the other thread, but MV is officially not compatible with Mac OS for several versions back. I know you're trying to find a workaround, but there may not be one that makes the editor and games run properly.
    I don't know if I should transfer the project I'm working on from MV to MZ, which means I need to find the MZ plugin that can replace the current MV plugin, and I have done a lot of work on MV now, I really don't really want to replace the engine
  13. @Arrose Just as a note, we're not supposed to double post, and you have three in a row. You can reply to multiple people at once by using the Reply or +Quote buttons, and if you need to add something to your post you can click the Edit button.

    I am not a Mac user, I can't help you with your project.

    The information in this thread's first post about trying to make MV Mac-compatible is almost two years out of date, an older version than you said you're using.

    All I can tell you is that MV has publicly stated that it's not compatible with MacOS for years now. If you don't have the technical knowledge to modify it yourself, it is a much safer bet for you to use MZ if you plan to make and distribute a game you want to be playable on Macs.

    If contentdeleted can give you more specific information to accomplish what you want, then you'll have to wait for their replies.

    Just note that nothing talked about here will affect the actual software. I believe you mentioned in another of your posts that MV itself is crashing on your Mac, and NW.js doesn't affect that.
  14. Thanks for your work and this tutorial !

    I upgraded MV to Pixi 4.8.9 and nw.js 78.1 and I've got a huge performance upgrade.

    My game runs on primarily browser (for computer and mobile) and I saw this:
    KillerGin said:
    This should dramatically improve game performance when you run the game in both the editor and deployed versions of the game (PC, Mac, and Linux). So not the editor.

    I am not 100% sure about a browser version since it just spits out the www folder. I guess it all depends on what version of nw.js your comp is set to run. The “Web Data” and “Web Data-journal” may play a role in that.

    The whole point of replacing these folders is to replace the old slow MV NW.js version 29 with a much improved version.

    Did the Nw.js upgrade impact web exports or only apply to the editor and windows .exe deployment ?
    I saw Hudell mentioning mobile doesn't use nw.js but what about browser ? If I play the browser version game on
    browser or mobile I mean.
    I saw a performance boost event on mobile but maybe It's only caused by the Pixi update to 1.8.9


    Also about those warnings, is it possible to remove them safely ? seems related to chrome updates, in the editor I only got the "Canvas 2d multiple readback" but in browser I get the "Audiocontext was not allowed" and "getGamepad" too.
    Seems like "Audiocontext" is related to having sound auto starting without any player input (chrome got more strict)

    1692471067968.png

    I tried to modify the rpg-core.js but not sure if It could break something (related to web-gl for canvas for exemple)
    Thanks
  15. jay_adams__ said:
    Thanks for your work and this tutorial !

    I upgraded MV to Pixi 4.8.9 and nw.js 78.1 and I've got a huge performance upgrade.

    My game runs on primarily browser (for computer and mobile) and I saw this:


    Did the Nw.js upgrade impact web exports or only apply to the editor and windows .exe deployment ?
    I saw Hudell mentioning mobile doesn't use nw.js but what about browser ? If I play the browser version game on
    browser or mobile I mean.
    I saw a performance boost event on mobile but maybe It's only caused by the Pixi update to 1.8.9
    NWjs essentially replaces the web browser for running javascript so if you run your game in browser, it's using the browser run instead of NWjs. So the version would not affect your game if you only run in browser.

    However, pixi is a js library imported by rpgmaker and so the version of that would affect your game while running in browser.

    Also about those warnings, is it possible to remove them safely ? seems related to chrome updates, in the editor I only got the "Canvas 2d multiple readback" but in browser I get the "Audiocontext was not allowed" and "getGamepad" too.

    Seems like "Audiocontext" is related to having sound auto starting without any player input (chrome got more strict)
    You can ignore those warnings, the Audiocontext thing will prevent sound from playing before the player puts any input in the game context frame on browser but it should be fine
  16. contentdeleted said:
    NWjs essentially replaces the web browser for running javascript so if you run your game in browser, it's using the browser run instead of NWjs. So the version would not affect your game if you only run in browser.

    However, pixi is a js library imported by rpgmaker and so the version of that would affect your game while running in browser.

    Thanks that's what I thought, so my improvements on browser were only from the pixi update, and it explain why my game performed better on browser than on my computer (editor) before the pixi and nwjs updates I just made.

    So the nwjs update will only impact my finished game if deployed to windows in .exe format right ?
    The only way to improve performance on browser is by pixi updates ? (seems like 1.8.9 is the best stable one tho)

    contentdeleted said:
    You can ignore those warnings, the Audiocontext thing will prevent sound from playing before the player puts any input in the game context frame on browser but it should be fine

    For this one I did make it disappear by adding a click condition on my website window, for the "Canvas2D multiple readback" no risk or way to erase it safe too ? I did find a way by adding this where the error shows in rpg-core.js

    function init() {

    canvas = document.getElementById("canvas");
    canvas.getContext('2d', { willReadFrequently: true });

    anim_container = document.getElementById("animation_container");

    But I'm not sure if it will conflict with Webgl or more..
    Tho this warning mention resolve it can improve performance so I'm intrigued.
  17. duy123a said:
    Well, you guys can try my stable setup for Pixi 5, it works well with NW 0.72.
    Currently using Pixi 5.3.12 now. And btw not all NW versions are stable, some of them have various annoying bugs (like 0.68.1).

    Are there any special instructions here or just paste all your files into my project?
    EDIT: I got it to work but Pixi 5.3 seems to give me worse framerates. So unless there's an easy way to fix that I'll be sticking with 4.8.9. I went from decent 60fps with mode 7 and multiple full screen filters to around 40-50 fps with pixi 5. darn.

    contentdeleted said:
    Hi there, you may have already figured this out, but this is a macos specific issue (well Im like 50% sure it is, either that or its issue from nwjs73 that wasnt present in 70). Either way I helped a friend upgrade to 73 on macos earlier today and the fix is extremely simple.

    Find the `package.json` file on the root of your project folder. There should be a name field at the top, go ahead and put the name of your project there (though it doesnt really matter what you fill it with). Then you should be able to launch normally.

    Hope that helps for anyone else who runs into this.
    It's a Win problem too, thanks for the fix though! I've got 79.1 working now! So far so good and running silky smooth.

    . . .

    Is this a bad thing?:
    DevTools debugger is disabled because it is attached to a process that hosts multiple top-level frames, where DevTools debugger doesn't work properly. Please relaunch the browser with --disable-features=ProcessPerSiteUpToMainFrameThreshold to enable debugger.

    And:
    Not a game breaker but can I make it go away?
    Screenshot 2023-08-24 172854.png
  18. jay_adams__ said:
    For this one I did make it disappear by adding a click condition on my website window, for the "Canvas2D multiple readback" no risk or way to erase it safe too ? I did find a way by adding this where the error shows in rpg-core.js

    function init() {

    canvas = document.getElementById("canvas");
    canvas.getContext('2d', { willReadFrequently: true });

    anim_container = document.getElementById("animation_container");

    But I'm not sure if it will conflict with Webgl or more..
    Tho this warning mention resolve it can improve performance so I'm intrigued.

    According to the Mozilla docs it looks like this option will save memory at the cost of performance. I think its likely a bad idea for your game but I've only done cursory research
    HTMLCanvasElement: getContext() method - Web APIs | MDN
    willReadFrequently
    A boolean value that indicates whether or not a lot of read-back operations are planned. This will force the use of a software (instead of hardware accelerated) 2D canvas and can save memory when calling getImageData() frequently.
  19. I update pixi.js to 6.0.4 and it seems to work with no issues.
  20. Dark_Ansem said:
    I update pixi.js to 6.0.4 and it seems to work with no issues.
    I just tried with v6.0.4 as well as the latest version 6: v6.1.0-rc.4
    In both cases I have errors from engine code in the tilemap and sprite files
    Did you port the engine files to the latest APIs? There are several breaking changes v4 -> v5