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

SigmaSuccour

Dogmatic
Veteran
Joined
Mar 22, 2017
Messages
225
Reaction score
921
First Language
Urdu, English
Primarily Uses
RMMV
You mean....the performance is the same between MV and MZ when the NW.js is updated?

I am comparing running an MV game in the MV editor, versus running the same MV game in the MZ editor.
That's what the video I made was about:

MZ as a standalone, has better performance than MV. Performance that is not only dependent on the NWJS alone. (Since you also have an updated pixi and Javascript cores in MZ.)
Example: In my small test, where there was a delay in audio or image in MV while using a plugin. There was no delay in MZ while using that same MV plugin.


I think this would be true, why not give it a shot. It would make for a cool video.

Making that comparison doesn't seem relevant to me. Simply because the video I did comparing MV versus MZ. Was using the same maps, scenes, plugins in both cases. (So the difference is clear. I'm taking an actual game made in MV, and running it through an MZ editor. So it's a real life, practical example.)

Creating an artificial scene that would destroy performance, using only events in MV. (So it ports easily over to MZ) And then fully porting it over to MZ, and then running it there to test performance is... not actually anything usable. (In my view.)
Since... no one practically makes a scene like that.
If they did. They should honestly be running this test. XD
 

KillerGin

Freddie
Veteran
Joined
Dec 18, 2015
Messages
568
Reaction score
523
First Language
English
Primarily Uses
N/A
I thought you might be exaggerating, but... wow!

I did immediately notice the window is behaving a little differently, and my game no longer starts in full screen. I was using a call to Graphics._switchFullScreen() for that. It seems to try to start in full screen, then goes back to windowed.

Otherwise, it doesn't seem like anything else broke at all! And I haven't seen the game so stable and rock-solid at 60 fps since it was a blank project, if even then...

Question: I'm on PC, didn't have a nwjs-osx-test folder. If I deploy a MacOS version of my game, what version nwjs will it use?


Glad to hear that I was not exaggerating lol. JK.

It certainly is cool to hear and thanks for letting me know.

You know whats funny? As I posted this, I was wondering the same thing.
I actually use RPG Maker on a Mac, so I have the osx test folder that I do update.

I know by just updating the test folder, (and not touching the zipped folder at all) the mac certainly updates the test version and deployed version of the game.

So since the PC version does not have a osx test folder, would it still update the Mac Version? That's a great question...... it probably does lol. But I am not 100% sure.

One day, I could test this..... but its a bit tough to tell, my Mac runs games very well so its hard to see if there is any difference.

I am comparing running an MV game in the MV editor, versus running the same MV game in the MZ editor.
That's what the video I made was about:

MZ as a standalone, has better performance than MV. Performance that is not only dependent on the NWJS alone. (Since you also have an updated pixi and Javascript cores in MZ.)
Example: In my small test, where there was a delay in audio or image in MV while using a plugin. There was no delay in MZ while using that same MV plugin.




Making that comparison doesn't seem relevant to me. Simply because the video I did comparing MV versus MZ. Was using the same maps, scenes, plugins in both cases. (So the difference is clear. I'm taking an actual game made in MV, and running it through an MZ editor. So it's a real life, practical example.)

Creating an artificial scene that would destroy performance, using only events in MV. (So it ports easily over to MZ) And then fully porting it over to MZ, and then running it there to test performance is... not actually anything usable. (In my view.)
Since... no one practically makes a scene like that.
If they did. They should honestly be running this test. XD

Well, you can easily update the MV Pixi version to 4.9.8 (I do recommend it), perhaps that can bridge the gap somewhat.

Ah I see...... MZ has pixi 5.2.4....... I wonder if I can update that as well hehe.
 

TheTitan99

Veteran
Veteran
Joined
Nov 2, 2015
Messages
220
Reaction score
109
First Language
English
Primarily Uses
RMMV
Okay, haha, I officually have NO idea what I did wrong, but now I can't even play MV anymore. When I try to run a game, I get a message saying that my node.js is too new, and it doesn't run.

This... isn't happening to anyone else, so clearly I did something real bad somehow. I've uninstalled and reinstalled the game on Steam, and it's still not working. Yeesh. I've got a long night ahead,looks like.
 

Featherbrain

Prehistoric Gamer
Veteran
Joined
Jan 12, 2020
Messages
159
Reaction score
377
First Language
English
Primarily Uses
RMMV
Just to follow up, this version of nwjs seems to do something slightly different with the windows. If I call Graphics._switchFullScreen() or Graphics._requestFullScreen() in a plugin, when I start the game, it briefly flashes into full screen, then goes back to window. If I call those functions through a script call before the title screen (luckily I have pre-title events), the calls work just fine and the game starts in fullscreen seamlessly. (And F4 works fine either way.)

My guess is that the old nwjs used to set the window dimensions first and then process plugins, while this one loads the plugins before it sets the window, so the later call is resetting the plugin calls. But, just a guess.

In any case, if you were using those calls in a plugin to start in fullscreen, you might have to use them as a script call in-game (e.g. pre-title event)... or, this could be something with my set up only. I didn't actually test a blank project. YMMV.
 

cchmaster

Veteran
Veteran
Joined
Nov 3, 2020
Messages
71
Reaction score
42
First Language
Chinese
Primarily Uses
RMMZ
Well, you can easily update the MV Pixi version to 4.9.8 (I do recommend it), perhaps that can bridge the gap somewhat.

Ah I see...... MZ has pixi 5.2.4....... I wonder if I can update that as well hehe.

This may not relate to what you've mentioned, but
I was trying to use Visustella's impact and horror plugins, and it told me that I needed pixi to get it work, so I simply downloaded the latest version and installed it with plugin manager. That worked.

I'm at work so can't check my MZ now, but you mean a pixi is already included in MZ?
 

MikaTeapot

Veteran
Veteran
Joined
Mar 25, 2019
Messages
36
Reaction score
12
First Language
English
Primarily Uses
RMMV
Works lovely for me too, not that I've done any extensive testing with my project. I do have the issue someone said above though, here's the script I use for fullscreen;

Code:
FSInitStart = SceneManager.initialize;
SceneManager.initialize = function(){
FSInitStart.call(this);
Graphics._requestFullScreen();
};

It doesn't work now, is there a quick fix? Thanks ^^
 

KillerGin

Freddie
Veteran
Joined
Dec 18, 2015
Messages
568
Reaction score
523
First Language
English
Primarily Uses
N/A
Okay, haha, I officually have NO idea what I did wrong, but now I can't even play MV anymore. When I try to run a game, I get a message saying that my node.js is too new, and it doesn't run.

This... isn't happening to anyone else, so clearly I did something real bad somehow. I've uninstalled and reinstalled the game on Steam, and it's still not working. Yeesh. I've got a long night ahead,looks like.

Ah, I had that problem, but dont worry, it's not hard to fix. (I struggled with this updating process for like 2 days lol, I became a master at it, and thus I wanted to share it and help fellow devs.)

Basically whats happening is, when you replace the files with the new ones, there are 2 things that are causing the problems with STEAM being unable to fix these.

1) The files names are the same, so the new ones, when mixed with the old ones, do not work correctly. So STEAM incorrectly thinks that some are them are ok when they are not. SO it doesnt replace files that appear to be ok (because of the names)

2) Though STEAM tries to make corrections, the one fatal flaw is, it doesnt delete things for you. So if you have a file that causes things to break, it will never delete things that arent suppose to be there. (I had mine broken for a little, but then realized I had extra files, I incorrectly assumed STEAM would fix this with a validation check, it doesn't!)

THANKFULLY! There is an easy fix.

Just go to the original folders......

I assume you are using PC and you just messed with the folders I told you about.

Simply delete everything out of the folders (nwjs-win, nwjs-win-test, nwjs-linux)

and after you delete all files, just tell STEAM to revalidate the files, this should replace the files with the correct files, since now they dont exist, it will force steam to replace them all with the correct files (this will also eliminate any files you incorrectly may have added.)

AND you should be all set..... to try again lol.

Just follow these steps again if it breaks lol. (Also, you can make backups if you like, but this fix is so easy its not really needed, but do what floats your boat)

/////////////////////////////

Ah also! You might want to do the NW.JS fix I mentioned at the bottom (known issues, its an easy fix, this could be causing the problem, just have to delete a couple files)

This may not relate to what you've mentioned, but
I was trying to use Visustella's impact and horror plugins, and it told me that I needed pixi to get it work, so I simply downloaded the latest version and installed it with plugin manager. That worked.

I'm at work so can't check my MZ now, but you mean a pixi is already included in MZ?

Absolutely it is. Its hiding out in the js->lib folder of your game.

Works lovely for me too, not that I've done any extensive testing with my project. I do have the issue someone said above though, here's the script I use for fullscreen;

Code:
FSInitStart = SceneManager.initialize;
SceneManager.initialize = function(){
FSInitStart.call(this);
Graphics._requestFullScreen();
};

It doesn't work now, is there a quick fix? Thanks ^^

Ah I see there may be some issues with how people do certain things and thats to be expected.

I just use a yanfly script to change the dimensions of my game to 1280 x 720 and I didnt have any issues.

I use like........ 50+ scripts from 7+ different developers (35+ or so are Yanfly lol) with no issues (I am sooooo happy about that, I got lucky I guess).

I'm sure there are some work around to most of these issues.
 

Featherbrain

Prehistoric Gamer
Veteran
Joined
Jan 12, 2020
Messages
159
Reaction score
377
First Language
English
Primarily Uses
RMMV
Works lovely for me too, not that I've done any extensive testing with my project. I do have the issue someone said above though, here's the script I use for fullscreen;

Code:
FSInitStart = SceneManager.initialize;
SceneManager.initialize = function(){
FSInitStart.call(this);
Graphics._requestFullScreen();
};

It doesn't work now, is there a quick fix? Thanks ^^

See my last post in the thread! Something about the order of the start up process for creating the window seems to have changed, so you can't make this call through a plugin--the command gets overridden by the new startup process (apparently).

Instead, the quick fix for me was to make the call to Graphics._requestFullScreen() after the game has started through a script call.

If you have a plugin for pre-title events you can make this script call as the very first command in the very first event and it will happen when the game starts; it looks just like it did before.
 

cchmaster

Veteran
Veteran
Joined
Nov 3, 2020
Messages
71
Reaction score
42
First Language
Chinese
Primarily Uses
RMMZ
Absolutely it is. Its hiding out in the js->lib folder of your game.

Oops, I was wrong. The plugin that Visustella needs is " Pixi JS Filters", not pixi.js.
That's different.
 

gRaViJa

Eniko Ghosts of Grace Dev
Veteran
Joined
Mar 16, 2012
Messages
982
Reaction score
630
First Language
Dutch
Primarily Uses
RMMV
@KillerGin "This is due to your NW JS version having been changed at one point and then changed again after that. This is actually on your system and reinstalling/deleting the game won't fix it as the problem persists in your appdata, especially if you play multiple RPG Maker games by multiple people it may cause this if people play around with NW JS files."

Does that mean that updating MV to NW.js 49.2 might give issues to people who want to play my game but have other rpg maker games installed already or rpg maker MV itself already installed on their computer?
 

Kalombi

Veteran
Veteran
Joined
Oct 10, 2018
Messages
63
Reaction score
43
First Language
English
Primarily Uses
N/A
Hi, so is this advantageous to use in MZ ? That's the one we are going with, so I'm curious to know.
 

ThinkN

Villager
Member
Joined
Aug 11, 2020
Messages
13
Reaction score
16
First Language
English
Primarily Uses
RMMV
@KillerGin "This is due to your NW JS version having been changed at one point and then changed again after that. This is actually on your system and reinstalling/deleting the game won't fix it as the problem persists in your appdata, especially if you play multiple RPG Maker games by multiple people it may cause this if people play around with NW JS files."

Does that mean that updating MV to NW.js 49.2 might give issues to people who want to play my game but have other rpg maker games installed already or rpg maker MV itself already installed on their computer?

Try filling in the name field of your game's package.json. Using a unique value here should prevent your game's appdata from being saved in the same place as someone else's.

Edit: whoops, edited to fix an incorrect file name.
 

KillerGin

Freddie
Veteran
Joined
Dec 18, 2015
Messages
568
Reaction score
523
First Language
English
Primarily Uses
N/A
@KillerGin "This is due to your NW JS version having been changed at one point and then changed again after that. This is actually on your system and reinstalling/deleting the game won't fix it as the problem persists in your appdata, especially if you play multiple RPG Maker games by multiple people it may cause this if people play around with NW JS files."

Does that mean that updating MV to NW.js 49.2 might give issues to people who want to play my game but have other rpg maker games installed already or rpg maker MV itself already installed on their computer?

Well this is an issue that has little to do with RPG Maker (but games in general) but can pop up when playing lots of different RPG Maker games. I included a link in the write up to a post in STEAM where I learned about this and how to fix it.

Hi, so is this advantageous to use in MZ ? That's the one we are going with, so I'm curious to know.

I would imagine that it would work...... though I have not tried it yet with MZ. If you want to try it, I would suggest making backups of everything lol.

I will give it a try in a bit..... I wanted to create a big DLC package for KillerGin before I moved on to MZ to make my next game.

Works like a charm thank you!

Great to hear! I use tons of different scripts and I have people playing and play testing my game on STEAM. I just had a player say they beat my game with 70 hrs of play and so far everything works great. They noticed the dramatic improvement due to updating NW.js

That doesnt mean others wont experience issue with their games. I just means they might have to work on some small updates or work arounds.

Anyways glad to hear it worked great for you! Thanks!
 

Semolous29

Veteran
Veteran
Joined
Feb 13, 2017
Messages
54
Reaction score
6
First Language
English
Primarily Uses
RMVXA
I got an error. It said failed to load actors.json. How do I get around this?
 

KillerGin

Freddie
Veteran
Joined
Dec 18, 2015
Messages
568
Reaction score
523
First Language
English
Primarily Uses
N/A
I got an error. It said failed to load actors.json. How do I get around this?

hmmmm Im not sure if that is a nw.js issue.......

Try an empty project and see if you still have the same issue.
 

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
535
Reaction score
95
First Language
Italian
Primarily Uses
I've tried to upgrade nwjs on the test, but i always get a blurry window Like this:

It seems that the windows doesn't open in the right size...

Test.JPG


Characters are all blurry. And if i press F4, fullscreen mode doesn't work. The window go in the top-left screen and the blurry effect disappear. But it doesn't go to fullscreen. (but if i press another button the blurry appear again. I taked the screenshoot but the blurry appeared again as i said, but when i press f4 and the windows go there, it's all ok :/

Test2.JPG

I'm using Yanfly too. I tried even to use only the core. Same problem... I can't really understand why it happens. In deployed version it's all ok... only in the editor it's like this.

EDIT: I see now that this is a thread for MZ, DAMN XD I'm on MV... but i think that it's the same thing? Do you have this type of problem?
 
Last edited:

KillerGin

Freddie
Veteran
Joined
Dec 18, 2015
Messages
568
Reaction score
523
First Language
English
Primarily Uses
N/A
I've tried to upgrade nwjs on the test, but i always get a blurry window Like this:

It seems that the windows doesn't open in the right size...

View attachment 174377


Characters are all blurry. And if i press F4, fullscreen mode doesn't work. The window go in the top-left screen and the blurry effect disappear. But it doesn't go to fullscreen. (but if i press another button the blurry appear again. I taked the screenshoot but the blurry appeared again as i said, but when i press f4 and the windows go there, it's all ok :/

View attachment 174378

I'm using Yanfly too. I tried even to use only the core. Same problem... I can't really understand why it happens. In deployed version it's all ok... only in the editor it's like this.

EDIT: I see now that this is a thread for MZ, DAMN XD I'm on MV... but i think that it's the same thing? Do you have this type of problem?

Actually this is a post for the MV version.

Which version of NW.js did you update to? 50? 49.2?

Hmmmm. The editor version has the "chrome..." file and doesnt have the package file or www folder. Those are the other differences. Soon, Probably tomorrow, I will record a video version of the guide and perhaps that will help.
 

DarkSearinox92

Veteran
Veteran
Joined
Jan 8, 2013
Messages
535
Reaction score
95
First Language
Italian
Primarily Uses
Actually this is a post for the MV version.

Which version of NW.js did you update to? 50? 49.2?

Hmmmm. The editor version has the "chrome..." file and doesnt have the package file or www folder. Those are the other differences. Soon, Probably tomorrow, I will record a video version of the guide and perhaps that will help.

Yes, i just didn't see that it was in MZ space. However, 49.2. I've done exactly all things. In Deployed version it works all things. In Test no. It has that damn bug... However i don't want to go off topic...
 

KillerGin

Freddie
Veteran
Joined
Dec 18, 2015
Messages
568
Reaction score
523
First Language
English
Primarily Uses
N/A
Yes, i just didn't see that it was in MZ space. However, 49.2. I've done exactly all things. In Deployed version it works all things. In Test no. It has that damn bug... However i don't want to go off topic...

Yeah, I updated the beginning of the write up so people know its basically a step by step write up for MV users though MZ users can still learn and update their MZ (I just updated my MZ to NW.js version 50, everything is working great. Deployed and test games run just fine)

Anyways.....

Um, everything should work just fine. Why not give it another try? Reset MV back to 29.... make sure it works, then retry the steps in the guide.

Remember, the normal (nwjs-win) and test (nwjs-win-test) folders are set up a bit differently.

1) Normal - contains package and www folder, test does not.

2) Test - contains "chrome..." file.
 

Latest Threads

Latest Posts

Latest Profile Posts

Holy cow, I have made Row Formation work again with OTB!

Now, my devious machinations can finally be born...
finished the second chapter of deltarune today, I gotta say that the 3 years wait was worth it lol

Forum statistics

Threads
115,148
Messages
1,087,640
Members
149,676
Latest member
jewjood
Top