Inconsistent framerate drops on different devices

Hi, I'm making a game on RMMV for the purpose of being playable on browser (computer and mobile)
and I've got a steady 60fps on play test and deployment version to browser too on my computer and mobile
(google chrome), but when I tried it on friends setups on google also (same update 118) I found different fps shutters
and the weirder part is the game runs smoother on my small mobile or a tiny portable pc than on a high end gamer pc or another mac (also tested on google not safari).

I tried to search the source of the problem, disable plugins or check any parallel event without wait times and even delete them to see but nothing changes and on some setups the framerate vary and move alone even if I don't do anything but on my setup everything is stable even when doing a lot of stuff.

I've also made a RMMZ version of this project, tried with different pixi versions, original and up to 6.5.2 for MZ and 4.8.9 for MV
but it doesn't seems to solve this problem .
No error in the console log of course.

I thought it might be related to refresh rates of the monitors but all setups where set on 60hz, but It was the best lead I've had so far and don't really know how to search now but it's problematic because It make this browser version really instable.
Any lead on where this problem possibly came from ?

Thanks again for reading

Edit:

Spoiler: Screen comparison
here this is on my setup (I spawned a lot of stuff and weather active to show that I get constant 60fps still even when a lot is loaded)
Untitled.png


and here this is on my friend setup same scene
394436552_662991608952506_1413063890425785524_n.png

but even when there's less or nothing happens the same fps instability occurs
367276785_866892064807897_2390394393168419615_n.png

so I don't know what can cause this even more when both are played on the same browser.
The first thing I would suggest is checking if it is the computer and not your game.
For example if a computer has a rather aggressive setting for its antivirus, it will continuously scan the game (website) while the browser is active, and that will cause additional lag.

And different computers have different reserves for lag due to different hardware and different background programs.

Then it can depend on the internet connection. Depending on where you live and where said friend lives, you can have different connectivity to your server.

In my opinion it is not impossible but rather unlikely that the effects are caused by your game.
The first thing I would suggest is checking if it is the computer and not your game.
For example if a computer has a rather aggressive setting for its antivirus, it will continuously scan the game (website) while the browser is active, and that will cause additional lag.

And different computers have different reserves for lag due to different hardware and different background programs.

Then it can depend on the internet connection. Depending on where you live and where said friend lives, you can have different connectivity to your server.

In my opinion it is not impossible but rather unlikely that the effects are caused by your game.
Thanks, on this exemple the internet connection is the same (roommates) but I didn't checked antivirus, gonna check this, as the problem occurs also with RMMZ build it make sense.
But if this happens to random setups is there a way to optimise my game and minimize thoses kind of risks ? as it is impossible to verify any setups my game will be played on.
yes and no

the problem is that "lag" is a summary of dozens of different causes. That creates some problems in two ways:
first you need to identify the cause of the lag before you can optimize that specific cause.
second sometimes the lag is caused from opposites and you can only do the best compromise instead of finding a solution.
Does the lag occurs like micro-stutters every 3-5 seconds? I had that with my game and tried the fix from this Reddit comment by Psychronic Games and game is working like a charm ever since.
yes and no

the problem is that "lag" is a summary of dozens of different causes. That creates some problems in two ways:
first you need to identify the cause of the lag before you can optimize that specific cause.
second sometimes the lag is caused from opposites and you can only do the best compromise instead of finding a solution.
Yes, it's the way I try to optimise my project by lots of playtest and compatibility checks and I already corrected lots of lag caused by plugins incompatibility, size of map number of events and ressources management, update of corescript, nwjs and pixi.
But this is harder to troubleshoot as a good computer sometimes have more trouble than a bad one to run the game so It's seems like I'm missing something.

I've check for antivirus but there was none except some mcafee google plugins that I disable and same results.

Does the lag occurs like micro-stutters every 3-5 seconds? I had that with my game and tried the fix from this Reddit comment by Psychronic Games and game is working like a charm ever since.
Yes sometimes more often and the spikes are biggers when lots of events or actions happens.
I just tried the fix you recommend (thanks for that) with pixi 4.8.9 but it didn't fix the inconsistent fps, and stranger too when I tried to put "1" instead of "600" like it was or "12000" recommended it didn't stutter more like he said it did for him.

Spoiler: Screenshots
1697841124102.png

I tried to export a windows build, and same problem so it doesn't seem only related to browser but the game itself.

Spoiler: Screen windows build
394561632_1716353648871671_1673872865787491639_n.png

387472149_265915249252603_7246607134218657060_n.png

I also tried browser in canvas mode, and same problem so it doesn't seem only related to webgl.
(I tested collect garbage in the console but same thing no effect on fps drops)

Spoiler: screen canvas mode
394512877_2429811223869773_1909664340471239280_n.png


And finally I also tried something strange but I upload the master demo of ocram plugins, as it is kind of heavy lighting and weather plugins but stable 60fps on my computer) to see if the same problem occurs only on one computer but not the over and it did.

Spoiler: ocram master test
394586527_696634435739706_2628474985474412131_n.png
394732786_800480048425998_5956710576238901857_n.png

So maybe it's related to the monitor ? as browser and windows nwjs build have the same fps random drops on one computer but everything work great on mine.
I know if I put my monitor to 50hz instead of 60hz le max fps I will get is 50 so I was thinking maybe it's related.

Anything else than the refresh rate of the monitor can impact an rpg maker game ?
Just made a lot of different tests and It's hard to locate the problem, seems to have maybe a link with processor and rm not support multicore ? but not very sure the game work great on my computer and some crappy ones from work but not on some good pc gamer..

Here's some performance screenshots on my computer working well steady 60fps



Spoiler: Screenshot
383086494_845908653903646_3428633774648654919_n.png
387477906_3595278364093779_4665874305538592677_n.png

And here on a good gamer pc with framerate problems
Spoiler: Screenshoot
380280102_866418211778519_7865160367931754255_n.png

368003665_727633539224695_8564854976602789181_n.png

This is on the same scene without doing nothing but when playing the game the gap increase and the stability is compromised on the second exemple..
Don't really know what to do about it and when searching for it I found another weird bug on rmmz where sometimes fps blocks at 30 and comes back to 60 when menu is display or less action are performed.. strange and never saw that on mv.

If anyone have any knowledge or help on this I would be grateful, thanks again !
Hey, I actually made a copy-pasta finally!

RPG Maker is a single-core/single-threaded, and MV is a 32 bit application (MZ is 64 bit, whoop), but both woefully under utilizes the GPU.
Doesn't matter how much ram or how many cores/threads your super CPU has as the application cannot take advantage of that. Everything is running on a single thread, so things can quickly bottleneck. Because of its single-core/single-thread preference, RM likes fast CPUs, not multi-core CPUs.

If it changes system to system, then it sounds like a hardware issue, and I would assume that it may be memory related; either the RAM is slow or single channel RAM, or the system may be using a slower drive, such as an old hard drive or a SSD without a DRAM cache (these type of SSDs tend to have a really high burst performance like most SSDs, but once saturated in transfer, some of the cheaper ones can slow to a crawl - slower than a hard drive).

I didn't read your full post, it's a lot to go through. I did see someone mention the reddit post about editing the garbage collection.
This is a bad idea. Garbage collection is RM's memory management. I will concede and say by default the garbage collection is rather aggressive for desktop purposes, but for mobile purposes it makes sense.
Really be careful following people's advice on prodding around files when you or the person posting doesn't know what they are talking about.
The garbage collection is going to clear unused references in memory every x number of frames.
When you tried setting it to 1, that means every frame it clears unused references in memory, this is likely going to cause the game to stutter more.
When you set it to 12,000 frames this is 3 minutes and 20 seconds. Every time you load a map new references are created and old ones are released. If you can walk across a map in 3 minutes, you are basically storing 2 maps worth of data in RAM when you only need 1 - and keep in mind, usually the largest RAM spike is loading new scenes.. While the default garbage collector I think is a little bit too aggressive, I would probably make it wait no more than 10 seconds between clean ups.



Other things that could be related are preloaders. Preloaders keep things in reference in the memory. Depending on how much you are preloading it could potentially cause problems (again, depending on the user's hardware).

If I missed specific bits of information you have pointed out, let me know. To me, this doesn't sound necessarily like a game problem but more of a hardware problem, but you could always take steps to improve the game's performance.
Hey, I actually made a copy-pasta finally!

RPG Maker is a single-core/single-threaded, and MV is a 32 bit application (MZ is 64 bit, whoop), but both woefully under utilizes the GPU.
Doesn't matter how much ram or how many cores/threads your super CPU has as the application cannot take advantage of that. Everything is running on a single thread, so things can quickly bottleneck. Because of its single-core/single-thread preference, RM likes fast CPUs, not multi-core CPUs.

If it changes system to system, then it sounds like a hardware issue, and I would assume that it may be memory related; either the RAM is slow or single channel RAM, or the system may be using a slower drive, such as an old hard drive or a SSD without a DRAM cache (these type of SSDs tend to have a really high burst performance like most SSDs, but once saturated in transfer, some of the cheaper ones can slow to a crawl - slower than a hard drive).

I didn't read your full post, it's a lot to go through. I did see someone mention the reddit post about editing the garbage collection.
This is a bad idea. Garbage collection is RM's memory management. I will concede and say by default the garbage collection is rather aggressive for desktop purposes, but for mobile purposes it makes sense.
Really be careful following people's advice on prodding around files when you or the person posting doesn't know what they are talking about.
The garbage collection is going to clear unused references in memory every x number of frames.
When you tried setting it to 1, that means every frame it clears unused references in memory, this is likely going to cause the game to stutter more.
When you set it to 12,000 frames this is 3 minutes and 20 seconds. Every time you load a map new references are created and old ones are released. If you can walk across a map in 3 minutes, you are basically storing 2 maps worth of data in RAM when you only need 1 - and keep in mind, usually the largest RAM spike is loading new scenes.. While the default garbage collector I think is a little bit too aggressive, I would probably make it wait no more than 10 seconds between clean ups.



Other things that could be related are preloaders. Preloaders keep things in reference in the memory. Depending on how much you are preloading it could potentially cause problems (again, depending on the user's hardware).

If I missed specific bits of information you have pointed out, let me know. To me, this doesn't sound necessarily like a game problem but more of a hardware problem, but you could always take steps to improve the game's performance.
Thanks a lot for detailed feedback, I did a lot of research and that's what I thought about hardware issue rather than the game itself as I was pretty careful about optimization when making it.

Already upgraded nwjs too (using curently the last v0.82 version) and tried a lot of pixi updates both on mv and mz (up to 6.5.4 for both) but not always the best results (most stable one on mv seems 4.8.9 and 6.0.4 on mz).

As I'm making an action rpg with abs I need some performance speed and fluidity using lots of scripts, systems and commons events (I have currently 5 versions of the game on mv and mz).
So the only way to optimize the game is to limit the game possibilities, content and actions ?
Do u recommend some stable base to use as nwjs, pixi and rmmv or rmmz version ?

Edit*
Also do u know what can cause the fps to cap at 30 on mz when the system has a lot to deal with and come back at 60 by itself or when changing scene (open menu or change map) ?

And on mv, on the second setup I showed who isn't stable, I saw a stable 60fps at first (sometimes for a minute or two) and after a while even if doing nothing it start to stutter. Seems weird too, I don't know why.
Hi everyone,

I did of lot of testing to try to understand this issue of unstable fps drops and stutter of the same project who runs at 60fps constant (5~12ms max) on my config and inconsistent fps drops and stutter on another better gamer config (5~35ms max)..

Here are some screens on the problematic config
Spoiler: screenshot
2e3c20e0-f609-421d-b1da-464289990b84.jpeg

9ec1cc8e-68e1-41d0-8ea3-365d59843c4f.jpeg


5da38112-6a08-4490-aec8-23dfe18baa09.jpeg


71d23ecf-7c72-4221-9fbf-af1e2873fbde.jpeg

172fcc56-0ee9-4ef1-a7b0-435160dcf9c1.jpeg


31063ed7-d6b7-4d1d-98d8-ee6bc3282a3b.jpeg


cdbac32c-0a4a-48d0-a436-b2a74db0084f.jpeg

a69f6b97-fe87-43ab-b806-51670292b4f9.jpeg

And here is on my config with no fps drops or issue

Spoiler: screenshot
me1.jpeg

me2.jpeg

also something weird is when I use the profiling in the performance tab on the problematic config, some stutter seems to disappear and the game became more fluid...


af69cbe6-7f9a-40d7-b667-a9ad14d56fe6.jpeg


I'm still trying to understand what can be the issue but don't have a clue (no antivirus installed on the problematic config)
On an rather empty map, on my config it's 4~5ms latency and on the other config it's 4~19 without doing anything..
And the fact that it become more fluid when I perform profiling with the dev console is really strange too..

Does anyone have an idea what can cause the stutter and inconsistent fps ?

Thanks again a lot !
Do you actually notice the stutter while playing? If you don't have the fps counter.
Do you actually notice the stutter while playing? If you don't have the fps counter.
Yes I do that's why I started searching the cause of it, but weirdly it seem to be more smooth when launching "profiling" in the dev console but the latency ms is still very instable compared to my config
Still need help if anyone knows why the game is instable on this config ,
just tried again and at start it works 60fps steady but after 20sec the stutter comes and the fps become instable, also the fact that doing profiling smooth out the stutter during the process..

Also I noticed on MZ when too much happen the fps seems to lock to 30 before coming back to 60 when It can, didn't seem to work the same on MV (the fps could tank to 50 not going directly to 30..)
Does anyone knows why ? can it be set off ?

Thanks again
In my opinion, you are experiencing lag due to ABS. If it works smoothly at 60 fps, it should continue to work at this demo standard.

I think there are plugins that improve ABS performance.

The drop in frame rate may be due to reading game data as variables, which is normal.

Avoid automatic map executions, parallel processes, and try to reduce the size of the game maps, reduce the number of events on the maps.

And use common event calls or scripts to read and end the process.

By doing this, you can have significant gains in your game systems.
In my opinion, you are experiencing lag due to ABS. If it works smoothly at 60 fps, it should continue to work at this demo standard.

I think there are plugins that improve ABS performance.

The drop in frame rate may be due to reading game data as variables, which is normal.

Avoid automatic map executions, parallel processes, and try to reduce the size of the game maps, reduce the number of events on the maps.

And use common event calls or scripts to read and end the process.

By doing this, you can have significant gains in your game systems.
Thanks for your answer, the problem is the game is working great at 60 fps on my config with the dev console open and 15 google chrome pages open at the same time, but isn't stable on another better config so I don't think it is only related to the game performance itself but rather rpg maker mz code or nwjs or something I missed
So I did more testing, and tried to launch performance profiling on my old original MV version of my game and same as the new MZ version, during the profiling the game is fluid so the computer can run the game (old mv and new mz versions) at 60fps like on my computer, but when I stop the profiling the game start to stutter again..

Maybe the profiling kinda make a diversion so the game isn't blocked or scanned ?
I tried to disable the firewall and removed anti virus or put avg but it didn't change anything
I tried also on an uploaded website and same issue so I doesn't seems to be nwjs but not sure

I tried to put some arguments in the package to see if I can bypass this weird problem but didn't find any solution

Seems like I miss something obvious and having the confirmation the game can run fluid on this config make this problem frustrating, as It could appears on other devices.

Anyone ever had this kind of issue ?
Any links or working demo so we can test? I don't think there is much new information from your post.
Thanks for your answer, not really have a demo ready yet but having tested on two different version of the game (mv and mz) as well as
on Ocram Demo it doesn't really seems linked to my game but rather to hardware and html applications (as the stutter disappear when doing a performance profiling in the console)

Based on thoses screens I made with both versions I'm wondering what can cause this stutter to prevent this
to happen randomly on some configs (like maybe arguments in the package or some compiler or packing system to make the game not be considered as a false positive if the problem come from something like this)

​

Hi everyone, I'm still having this issue, any idea what can cause this ?
Thanks again
According to the author of this thread, they have very high-end hardware but have very low performance. So the problem is not always on your side.

Original thread: https://forums.rpgmakerweb.com/threads/inconsistent-framerate-drops-on-different-devices.162215/