Here is a benchmark test for the NW.js/PIXI upgrade that you can download and run yourself. This is a MAJOR performance boost. Let's compare scores.

HankB

Actual size
Veteran
Joined
Mar 5, 2021
Messages
115
Reaction score
64
First Language
English
Primarily Uses
RMMV
If you don't already know, you can greatly increase RMMV's performance by upgrading NW.js and Pixi. @KillerGin figured this stuff out and posted an extremely helpful tutorial here about a year ago (there's a video and everything). So huge thanks to @KillerGin!

I decided that before I did the upgrade for myself, I would create a "stress test" project for RMMV and deploy it, then do the upgrade and deploy it again, which would allow me to compare the the two and get a measurable benchmark for each. I wanted to make the before-and-after deployments available to the community so that others could run it if they want. It would be very interesting to see how well each version performs on different systems.

HOW IT WORKS:

Download the tests here and unzip. The first test is without upgrades, and the second is with upgrades. First run one and then the other and compare scores.

Basically you just start the "game", press ENTER or SPACE, select "begin test" and let it run. It will cycle through 5 different stress tests, and then automatically start over again. Between each round, it pauses briefly so that you can stop and check performance scores if you want.

The five tests are meant to cover different things that affect RMMV's framerate. Each test is based on a different character from the 70's sitcom Happy Days, so there's Potsie, Marion, Howard, The Fonz, and Ralph the Mouth. (Pinky Tuscadero is also in there, but she doesn't really do anything, she just likes hanging out with Fonzie.)

All of these tests rely on Galv's Event Spawner plugin to gradually spawn in more and more events. Whenever the framerate drops below 30 for more than 1/10th of a second, a log is made of how many events were spawned in, and then moves on to the next test. At the end of each round, the scores for each test are averaged together. For me, the averages were pretty stable after about 30-40 rounds, so that's probably a good target to shoot for. Here's what the different tests do:

Potsie: He simply moves around the map and shows an effects animation at semi-random intervals.

Marion: She just displays a new picture every 12 frames. For some reason RMMV is REALLY bad at showing pictures.

Howard: He is the only event that uses a "walking" (or in his case "flying") animation. He is a parallel process, and is also changing the value of a variable and running a conditional branch.

Fonzie and Pinky: They don't really do anything, they just spawn in every 3 frames, so this is mostly testing having a LOT of events on the screen at once.

Ralph the Mouth: Ralph is a parallel process that just does some heavier math stuff and also conditional checks. Similar to Howard, but more complex calculations and much different results.

MY RESULTS

I'm running Windows 7 (I know, I know) with 8 gigs of RAM and an AMD 760k quad core processor, so nothing fancy. The numbers represent averages of how many new events were able to spawn in before the fps dropped below 30.

Before upgrade:

Potsie: 14
Marion: 28
Howard: 209
Fonzie: 680
Ralph: 152

After upgrade:

Potsie: 55
Marion: 35
Howard: 947
Fonzie: 2088
Ralph: 573

Performance increases:

Potsie: 393%
Marion: 125%
Howard: 453%
Fonzie: 307%
Ralph: 377%

So, yeah. This is a very significant performance boost. Not so much with Marion, who was simply displaying a picture, but everything else was 3+ or 4+ times better. So if you haven't performed the upgrade yet, you should seriously consider it. Obviously, you can download my before-and-after "games" and run them to see how much of a difference it makes on your system. I only made it for windows, as I don't have a Mac or Linux.

Also I would be interested to know how other people scored in the tests on their own systems, so if you do run the tests, please post your scores and how many rounds you let it run. To get meaningful results, I suggest around 40 rounds each. It can be a little time consuming, so just start it up and go do something else for a while. The more powerful your system, the longer it will take.

Also, keep in mind that the above results are averages taken from a sample of tests. Individual test scores can vary WILDLY. For whatever reason, RMMV's framerate issues often seem completely random. Even with the upgrade, my FPS will just suddenly bottom out for no apparent reason, so this may not "fix" that problem, but should make it noticeably less frequent (AKA YMMV).

I hope this is useful for anyone interested. Let me know if you have any questions or ideas.

UPDATE: Here's the original project file you can download if you want to see exactly what's going on under the hood, or if you want to make any changes: Project File
 
Last edited:

C64_Mat

System Masters
Veteran
Joined
Apr 3, 2021
Messages
112
Reaction score
93
First Language
English
Primarily Uses
RMMV
This is... Amazing. And we can integrate the updated pixie engine into our own games / MV?
 

HankB

Actual size
Veteran
Joined
Mar 5, 2021
Messages
115
Reaction score
64
First Language
English
Primarily Uses
RMMV
And we can integrate the updated pixie engine into our own games / MV?

The pixi upgrade is actually fairly minor, as far as I can see. The major upgrade is NW.js. But yes, you can do the upgrade as KillerGin instructs and see the results in your current projects. It won't affect projects that have already been deployed, so for finished projects you'll need to perform the upgrade and then deploy your project again to get the improved performance.
 

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
331
Reaction score
115
First Language
English
Primarily Uses
RMMV
I haven't bothered writing the results down but several were definitely above the thousands (over 2000) and that's testing without the upgrade.

Though I got to say, I wouldn't want to dream being there with a vast amount of the green flyers moving around like multiplying!
 

HankB

Actual size
Veteran
Joined
Mar 5, 2021
Messages
115
Reaction score
64
First Language
English
Primarily Uses
RMMV
@RK DracoRoy
If I were you I would lay off the weed/psychedelics for a couple of weeks.
 

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
331
Reaction score
115
First Language
English
Primarily Uses
RMMV
@HankB
That was just for humor, you know. Well, I do have a few to ask based on this. About the parallel process especially the math one, did you have them in multiple if-else statements like 5, 6, or more?

What if one transferred maps back and forth with events already in place? Example being you're in a castle hub and going through different spots, each with numbers of NPCS to talk to.
 

Arthran

Veteran
Veteran
Joined
Jun 25, 2021
Messages
103
Reaction score
72
First Language
English
Primarily Uses
RMMZ
This is really cool, but I can't help but wonder whether or not the fail condition is appropriate:
Whenever the framerate drops below 30 for more than 1/10th of a second
Like, what if the game is just doing garbage collection, or some kind of caching business, or something, and the framerate would have shot back up and been smooth sailing afterwards? Since you said yourself that the framerate drop can seem completely random, I think it's maybe safe to assume that there is a lurking variable at play here.

I'm admittedly no expert on benchmarking, but it seems to me that it might give more meaningful results to measure for an extended period of low framerate, rather than what could simply be a momentary lag spike that might not be directly related to the test.

*Edit* Btw, I ported this project to MZ just now, because I thought it'd be cool to get some type of tangible measure of the performance difference between the two engines. Do you mind if I share it?
 
Last edited:

Makeratore

Veteran
Veteran
Joined
Feb 9, 2014
Messages
246
Reaction score
91
First Language
Italian
Primarily Uses
RMMV
Does the upgrade break plugins?
 

HankB

Actual size
Veteran
Joined
Mar 5, 2021
Messages
115
Reaction score
64
First Language
English
Primarily Uses
RMMV
That was just for humor, you know.
Same here, haha. I couldn't resist.

About the parallel process especially the math one, did you have them in multiple if-else statements like 5, 6, or more?
I'm not completely sure what you mean, but I'm going to go ahead and upload the actual project file so that you can see exactly what's happening. That way you can add/change stuff if you like for your own needs. I'll edit my original post and put the download link to that there when I'm done with this.
What if one transferred maps back and forth with events already in place? Example being you're in a castle hub and going through different spots, each with numbers of NPCS to talk to.
That's a good idea, I didn't think about that. I don't know that the transfering itself would make any difference, but maybe.

Like, what if the game is just doing garbage collection, or some kind of caching business, or something, and the framerate would have shot back up and been smooth sailing afterwards? Since you said yourself that the framerate drop can seem completely random, I think it's maybe safe to assume that there is a lurking variable at play here.
Basically I had to choose something, and I settled on that because it was a noticeable lag, which I only rarely see on most of the non-RMMV games I play. I'm definitely no expert on benchmarking either. As I mentioned to RK DracoRoy, I'll post a download for the project file, so you can go ahead and adjust it to whatever you like, or make any other changes. I'll edit the original post and put the download link there.

Btw, I ported this project to MZ just now, because I thought it'd be cool to get some type of tangible measure of the performance difference between the two engines. Do you mind if I share it?
No, that's great, please do.

Does the upgrade break plugins?
It hasn't broken any for me so far, but there is one effect I noticed that I don't like. I use a "full screen" plugin, which still works, but now it shows a little bar across the top, like you would see in a normal browser window. It's still full screen, so not broken, but I don't like that bar. I haven't even begun to try to solve it yet, though, so that's all I can tell you.

Also, this whole process is reversible, so if you do find something that you can't live with, you can just put it back the way you had it.
 

KillerGin

Freddie
Veteran
Joined
Dec 18, 2015
Messages
569
Reaction score
529
First Language
English
Primarily Uses
N/A
Oh hey! That's cool! Glad I could help!
 

jjraymonds

Veteran
Veteran
Joined
Feb 1, 2020
Messages
65
Reaction score
7
First Language
English
Primarily Uses
RMMV
Alright, I'm pretty much a n00b when it comes to Pixi and NW.JS, but I really want to see if these upgrades could do anything for MZ (I would really really like to get my art heavy game to run at 1080p)

If I wanted to try this on my own project... I would just swap the Pixi and NW.JS files right? The Pixi one can be found in Game File > js > libs > pixi.js correct? Where is the NW.JS one? :blush: Sorry like I said this is a little out of my field.

Edit: I tried converting the provided demo project to MZ but I run into this error:

1637129724822.png
 
Last edited:

HankB

Actual size
Veteran
Joined
Mar 5, 2021
Messages
115
Reaction score
64
First Language
English
Primarily Uses
RMMV
If I wanted to try this on my own project... I would just swap the Pixi and NW.JS files right? The Pixi one can be found in Game File > js > libs > pixi.js correct? Where is the NW.JS one?

(TL;DR: This is for MV, not MZ)

The pixi.js file, yes, that one you can swap out on a per-project basis. It's literally a matter of replacing a single file within your game project. But as for the NW.js upgrade (which is by far the most significant upgrade in terms of performance improvement), that requires several steps, and involves making changes to the actual program. You have to follow KillerGin's tutorial. It took me 20-30 minutes to do it myself, but I was taking it slow and being very careful. It's involved.

But you want to apply this to MZ, which is a whole other can of worms. I don't know what version of nw.js MZ is using, but I can guarantee it isn't the same as MV. That would be insane. I could be wrong, but my guess is that if you're using MZ, then you probably already have about the best performance you're going to get, at least for a while.

MV is old, and over its lifespan there were a lot of improvements made to the basic javascript engine that ran it (nw.js), but the makers of MV never bothered to update the software to take advantage of any of those things. Perhaps a business decision. MZ came along and had better performance and a couple of other new features. So basically if you are already using MV, then this upgrade makes it perform more like MZ.

It's possible that MZ's version of NW.js is now outdated enough that upgrading it might make a noticable difference, but I have no idea.
 
Last edited:

jjraymonds

Veteran
Veteran
Joined
Feb 1, 2020
Messages
65
Reaction score
7
First Language
English
Primarily Uses
RMMV
(TL;DR: This is for MV, not MZ)

The pixi.js file, yes, that one you can swap out on a per-project basis. It's literally a matter of replacing a single file within your game project. But as for the NW.js upgrade (which is by far the most significant upgrade in terms of performance improvement), that requires several steps, and involves making changes to the actual program. You have to follow KillerGin's tutorial. It took me 20-30 minutes to do it myself, but I was taking it slow and being very careful. It's involved.

But you want to apply this to MZ, which is a whole other can of worms. I don't know what version of nw.js MZ is using, but I can guarantee it isn't the same as MV. That would be insane. I could be wrong, but my guess is that if you're using MZ, then you probably already have about the best performance you're going to get, at least for a while.

MV is old, and over its lifespan there were a lot of improvements made to the basic javascript engine that ran it (nw.js), but the makers of MV never bothered to update the software to take advantage of any of those things. Perhaps a business decision. MZ came along and had better performance and a couple of other new features. So basically if you are already using MV, then this upgrade makes it perform more like MZ.

It's possible that MZ's version of NW.js is now outdated enough that upgrading it might make a noticable difference, but I have no idea.
Thank you so much for the detailed explanation!
 

Arthran

Veteran
Veteran
Joined
Jun 25, 2021
Messages
103
Reaction score
72
First Language
English
Primarily Uses
RMMZ
I ported this benchmark test to MZ. You guys can grab it here if you're interested in testing it out to see how MZ's performance stacks up against MV's on your own PCs. I took HankB's original project and replaced the core scripts and libraries with those from MZ 1.3.3, and then I made the minimal amount of changes necessary in order to get the plugins and script calls compatible with MZ. I did not change the logic of the benchmarks, or make any other types of changes that would stop this from being a fair comparison against HankB's MV versions.

Here are the results of my benchmarks for about 20 rounds each (Windows 10, 16GB RAM, Core i5 4670K OC to 4.6Ghz, Radeon R9 290X):

MV - Before Upgrade

Didn't test. I was more interested in comparing MV (with upgrades) against MZ (without upgrades).

MV - After NWJS and Pixi Upgrades

Potsie: 314
Marion: 349
Howard: 3,382
Fonzie: 6,840
Ralph: 2,622

MZ - Out of the Box (a.k.a. the default NWJS and Pixi)

Potsie: 780
Marion: 10,000+ *(see my note below)
Howard: 3,429
Fonzie: 7,245
Ralph: 3,240

Performance Increases

Potsie: 248%
Marion: 2,865%+
Howard: 101%
Fonzie: 106%
Ralph: 124%

* The benchmark has a 10,000 Max Picture limit, so it is unable to test beyond that. I was still at 60 FPS when I reached 10,000 so I assume I could have gone further if the limit didn't exist. It is possible to increase this limit, but I chose not to do so, since the original project has the limit in place. I didn't want to risk introducing any unforeseen side effects that could potentially stop the results from being directly comparable with those from the original project.

As you can see, the performance increases for the more graphically inclined tests are pretty massive. This is especially true for the second test. The increases for the more processor/RAM inclined tests are much more minor, but still existent.

Since there are often naysayers who like to claim that "MZ is just MV with an updated NWJS", it's nice to have some quantifiable evidence that the performance difference between the two engines does actually go beyond that. In light of this, and with the fact that MV has stopped supporting Mac, and with the fact that MZ's sale price has started dipping down to about half price sometimes... I think it's maybe time for the stragglers to seriously start considering migrating to MZ.

@HankB - While I was porting this, I noticed a pretty serious bug. You've got variable #18 named "Self Sw rando". However, since it's a variable, and not a switch, it needs to be named "Self Var rando" in order for the YEP_SelfSwVar plugin to recognize it as a self variable. As it is now, it's just being treated as a regular variable. I left the bug as-is in my port, because I wanted to keep my results consistent with yours, and changing it would probably have a very pronounced affect on some of the benchmarks. If you wind up fixing it in your project, please let me know and I'll fix it in mine as well.
 
Last edited:

HankB

Actual size
Veteran
Joined
Mar 5, 2021
Messages
115
Reaction score
64
First Language
English
Primarily Uses
RMMV
While I was porting this, I noticed a pretty serious bug. You've got variable #18 named "Self Sw rando". However, since it's a variable, and not a switch, it needs to be named "Self Var rando" in order for the YEP_SelfSwVar plugin to recognize it as a self variable. As it is now, it's just being treated as a regular variable.
Wow, that was a big oversight on my part, I never noticed that. Thanks for pointing it out. Fortunately, it doesn't seem to make any difference. That particular variable was only used to run some math functions in the background, and I believe that—because javascript is a single-thread language, and all operations are run consecutively—all those math equations were run one at a time, so I really didn't even need a self variable in that case. (I think that's how it works, but if anyone who understands this better than me sees that I'm wrong, please let me know.) Anyway, I've corrected the mistake and have run it a few rounds, and it seems about the same so far, but I'll have to run it for a few hours to see if there's any real difference.

I'll be bach.
 

Arthran

Veteran
Veteran
Joined
Jun 25, 2021
Messages
103
Reaction score
72
First Language
English
Primarily Uses
RMMZ
Wow, that was a big oversight on my part, I never noticed that. Thanks for pointing it out. Fortunately, it doesn't seem to make any difference. That particular variable was only used to run some math functions in the background, and I believe that—because javascript is a single-thread language, and all operations are run consecutively—all those math equations were run one at a time, so I really didn't even need a self variable in that case. (I think that's how it works, but if anyone who understands this better than me sees that I'm wrong, please let me know.) Anyway, I've corrected the mistake and have run it a few rounds, and it seems about the same so far, but I'll have to run it for a few hours to see if there's any real difference.

I'll be bach.
I tested it just now, both on MV and on MZ, and it made a night and day difference on my system. I only did tests 3 and 5, because the change shouldn't really affect the others, and I didn't wanna spend too long. But here are the results:

MV
Before -> After

3.) 3382 -> 1311
5.) 2622 -> 527

MZ
Before -> After

3.) 3429 -> 1520
5.) 3240 -> 667

The reason why the change is so drastic for me is because the basic nature of the tests was changed. Before, my CPU frequency was more of a factor in those two tests. But now, it's more of a matter of RAM speed.

It is true that Javascript is usually single-threaded. But that's not really too important here, because the bottleneck lies elsewhere. Generally speaking, memory operations are a lot slower than processor operations. And allocating new memory is a lot slower than writing to memory that has already been allocated.

Before, the different events were all writing to the same pre-allocated location in memory. But now, they're constantly allocating new memory, so they can each have their own memory locations to write to. And it's not only that. IIRC, the way Yanfly implemented it, the creation of each new self variable actually requires the allocation of like 5 variables under the hood. And he's even got it set up so that it has to create 4 new variables every time you want to read one of the existing self variables. So there's basically a crap ton more memory operations going down now.

But there is also more processing happening too. There are more functions being called during the creation/retrieval of these self variables. And while I don't know exactly how Chromium handles arrays and objects under the hood, I believe that simply accessing a self variable *should* require more processing (under the hood) than a regular variable, since the self variables are using an array as a key.
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Micro rant. The worst part of working from home when you live with your family is seeing how inconsiderate they are. "Hey, you're sitting in front of your computer, that means you're not doing anything! I want to put the TV at 200 decibels!"

If I was working in the office would you still talking me like that?
It's definitely discouraging when streamers give a try-to-say-it-nicely (i.e. bad) review of your game demo. It's like jumping into a cold pool. Bad initally, but it gets better with time. And you are now more alert and see better.
Some screenshots of the pub and lodging with the beginnings of clutter taking shape
TTp8uCw.png

jtC202e.png

bSXgyVl.png

eRx9PUF.png
Backgrounds are not my strong suit... :kaodes:
DazI8jt.jpg

Just realized I forgot doing the clouds... woops
Went to get some stuff for February 10, the birthday of my favorite ink monster...
I have a little one-person party for Bendy every year, complete with the life-size plushie I made. And yes, I bake a birthday cake!

Forum statistics

Threads
118,499
Messages
1,116,417
Members
155,495
Latest member
sarberten
Top