Lagging frames, how do we deal with them?

I was watching a video yesterday and witnessed these ghosting/lagging frames.

Honestly, I just wrote them off, saying: "that is a limitation on our engine, we cannot expect more."




Today I was watching this video:



Notice how often the NPCs ghost out. Almost as if skipping frames.

I can recall in the NES Zelda, your entire framerate would slow down, if too many things happened at once(like many NES titles).

I had always assumed this was graphics attacking the processor and rendering a ation.

Looking at this NES SNK title, it almost appears they anticipated the ation and cut frames to help the processor deal with it.

Does anyone know how this actually works? I am just proffering as a poor witness, without any technical knowledge.



-GEA
It is true that it is the limitation of the engine.

I experienced the lagging with my games as well. The answer ... was a different engine. Basically, MV is limited to 30 FPS. That's the main cause of the lag. I came to realize this when I began to work with Wolf RPG engine which has 30 FPS and 60 FPS option.

When I chose the 30 FPS option with Wolf engine, I had the exact same lagging I experienced with MV. When I used 60 FPS option, it became smooth as butter.

So, your solution would be a sort of plugin that lifts the 30 FPS limit. Be aware that it could potentially break MV engine all together, like music sync for an example.
Isn't MV 60FPS?
On paper, yeah, but remember it runs behind a web browser framework.

The lagging symptoms are exactly the same ones I've seen from 30 FPS limitation which makes me believe that MV is built around 30 FPS internally.

Basically, I believe that it runs 30 FPS internally within 60 FPS framework. I could well be wrong but that is the conclusion I've come to after dealing with Wolf RPG Maker.

To put it another way, imagine a framed picture. The frame runs at 60 FPS but the picture itself runs at 30 FPS.
As far as I know...RMMV is designed to run at 60 fps but may run slower: if the system cannot handle the requested CPU/GPU operations at 60 fps, frames will be "skipped" by performing an appropriate number of updates for the internal data (e.g. character positions) before re-rendering the scene. Supporting technical stuff below~ 😤

The update method of SceneManager seems to be bound to the requestAnimationFrame method of PIXI.Ticker. Not totally sure how this works at the PIXI level, but the documentation I've linked suggests it's basically a setInterval kind of thing? 😴 Supporting code snippet from rpg_managers.js:
Spoiler: requestUpdate, update
Code:
SceneManager.requestUpdate = function() {
    if (!this._stopped) {
        requestAnimationFrame(this.update.bind(this));
    }
};

SceneManager.update = function() {
    try {
        this.tickStart();
        if (Utils.isMobileSafari()) {
            this.updateInputData();
        }
        this.updateManagers();
        this.updateMain();
        this.tickEnd();
    } catch (e) {
        this.catchException(e);
    }
};
A _deltaTime property is defined on SceneManager:
Code:
SceneManager._deltaTime = 1.0 / 60.0;
This property is referenced in the updateMain method, which performs one frame update per full interval elapsed since the previous call:
Spoiler: updateMain
Code:
SceneManager.updateMain = function() {
    if (Utils.isMobileSafari()) {
        this.changeScene();
        this.updateScene();
    } else {
        var newTime = this._getTimeInMsWithoutMobileSafari();
        var fTime = (newTime - this._currentTime) / 1000;
        if (fTime > 0.25) fTime = 0.25;
        this._currentTime = newTime;
        this._accumulator += fTime;
        while (this._accumulator >= this._deltaTime) {
            this.updateInputData();
            this.changeScene();
            this.updateScene();
            this._accumulator -= this._deltaTime;
        }
    }
    this.renderScene();
    this.requestUpdate();
};

Original thread: https://forums.rpgmakerweb.com/threads/lagging-frames-how-do-we-deal-with-them.115015/