MZ SkipUpdate - A targeted notetag plugin that significantly eases the processing load of compatible, static events.

Introduction:

This plugin was a collaborative effort between myself and SnakekillerX, who is my custom plugin programmer, and buddy.

The core principle of this plugin is very simple: It suspends the Game_Event.prototype.update function on any event that you have given the notetag <SkipUpdate>. The reason this has been created is that some plugins, notably Visustella Events Movement Core MZ, add notetag features that are checked for in a way that is tied to that function's process.

It does not matter what the content of the event is: so long as those features are tied to that function, they are constantly checking every single one the map for the full list of possible notetags. On maps with high event volume (hundreds), you can begin to have seriously noticeable framerate/overall performance issues.

This is a well documented phenomenon, and the common advice up until now has been to chop your maps up, reduce eventing, or change your plugins. Not anymore! There was no way to natively, or with VS plugins, filter out events that don't need to be checked by Game_Event.prototype.update, so it had to be created.

Link to the plugin (This will always be the most up-to-date one):



Proof of Concept:

I am including an example of it functioning in a zip file.

This is a new project, with two 140x100 maps - each having a block of 620 default (Blank image, no data, action button, below characters, etc) events at the top left. One map has all of these events with no notetag, and the other has all of these events with <SkipUpdate>.

There is one extra event for transferring between the two maps. I have added Plugin Common Base, Visustella MZ Core Engine, VisuMZ 1 Events and Movement Core, and SkipUpdate. All have been enabled with no parameters changed. There are no other alterations from a fresh project outside of writing LAG and NO LAG with the RTP tiles. The results of this are a massive difference in FPS on one map vs the other. For my hardware, it's ~30fps on the lag map and ~144 (capped) on the no lag map.

The ZIP file has screenshots and a video of this, and the project (sans the visustella plugins). You have to install them yourself, to test the project and see how much framerate chug is mitigated on your own hardware when Visustella Events and Movement Core is running. I've included a link to the Visustella Sample Project in the ZIP file as well, as line four of their terms of use forbids me from redistributing their plugins. Note also that the version of the plugin included here is out of date.


I will also include the screenshots, and two frames from the video, attached to this post itself. Snake also put the video on his Youtube page.




Use Cases:

If you're like me and:

-Rely on the functionality of a plugin that has this issue/provides event notetag features
-Refuse to chop up your larger maps
-Often use events like they're tiles, with static image character sets, and with no intention of moving them, and/or sometimes displacing them to achieve an effect similar to modified parallax mapping
-Often use events when you've run out of tile layers and use events when you want to put an additional tile graphic on top
-Often use decorative events with multiple pages, with conditions that are dependent on things (in universe) like the passage of time
-Often use blank events to modify passability of a tile without creating a new tile
-Have a high volume of action button, player touch, or event touch events that are never subject to a movement route

You may be not only my soul brother, but could very well benefit in a massive way from utilizing this plugin, when it comes to your game's performance. You may even get relief for framerate issues without having a plugin that causes issues, if you have extreme event volume.

The use case that motivated this plugin was a 140x100 map with 300 events (in my game) bringing Snake to ~30 FPS. This only occurred while Events and Movement core was active. Using this plugin, and labelling all compatible events with the <SkipUpdate> brought him back up to the FPS cap (144) without changing anything else.


Important Information:

An event with the <SkipUpdate> notetag has significantly reduced functionality compared to one without, but myself and other developers with a similar design philosophy make use of a great number of visually static events that do not appear to be disturbed in any way by suspending Game_Event.prototype.update for it. This plugin does not modify any event that lacks the notetag, so you can very specifically target ones that benefit from a lack of processing.

Plugin order is unlikely to matter for this plugin, but please do let us know if there's an issue.

Please CAREFULLY read the information below. What is written appears to be accurate to our testing, but is likely incomplete and might not be perfectly correct in all contexts.


=Rules of thumb=


-This notetag is suited for visually static (unanimated) events that do not need to move in any way, outside of automatic turning toward activation direction and then resetting, and/or use 'one-and-done at render' type notetags.
-This notetag is not suited for events that move in any way, events that use Parallel or Autorun triggers, do anything autonomously, or have separate, dynamic notetag features.



=Specifics of our testing=


This plugin's notetag seems to be compatible with events that have these properties, or these event properties themselves:

-Events with 'Below characters' Priority
-Events with 'Same as characters' Priority
-Events with 'Above characters' Priority
(Collision and layer placement from this setting, on all 3 options, still seems to function without issue)

-Events with Conditions to appear
(This appears to not cause issues here, regardless of condition type)

-Events with the "Direction Fix" option, on or off.
(This appears to not cause issues here)

-Events with the "Through" option, on or off.
(This appears to not cause issues here)

-'Action Button' Trigger Events
(Functionality seems unchanged, and event image is still capable of turning and resetting at/post interaction)

-'Player Touch' Trigger Events
(Functionality seems unchanged, and event image is still capable of turning and resetting at/post interaction)

-'Event Touch' Trigger Events
(Basically becomes the same as player touch, as <SkipUpdate> events can no longer move)

-Events that initiate a movement route on a DIFFERENT event that has no <SkipUpdate> tag.
(This appears to not cause issues here)

-Events with multiple pages, with conditions.
(This appears to not cause issues here, even if the images, direction fix setting, orientation, and trigger mechanism are different between them.)

-Events that transfer the player.
(This appears to not cause issues here)



This plugin's notetag will either partially or entirely break events that have these properties:

-Events with the "Walking" option on.
(Will prevent the event's movement entirely, so this does nothing. It won't break the event to turn this on, it just won't walk because it can't move.)

-Events with the "Stepping" option on
(Will prevent the stepping animation entirely, so this does nothing.)

-Parallel Events
(Will never, ever initiate)

-Autorun Events
(Will initiate only once, ever, even if you leave and come back to the map it will not fire again.)

-Events that are the target of a movement route of any kind, autonomously or from any other event
(Will brick the movement route entirely, doesn't matter what's in it.)

-Events with any automatic pathing.
(Will brick the movement entirely)




You can use <SkipUpdate> notetags on events that have SOME other notetags, without impairing their functionality. Others will no longer become functional if you place <SkipUpdate> alongside them.

Unimpaired Visustella Notetags (This list is certainly incomplete and might not be fully tested to all use cases):

-Sprite Offset
(This appears to work without issue, still displacing the event as instructed. That function is probably not tied to Game_Event.prototype.update)

-Activation Radius/Square/Circle/Whatever
(This appears to work without issue, still triggering event and player touch events from the instructed distance. That function is probably not tied to Game_Event.prototype.update)

Confirmed Impaired Visustella Notetags (This list is certainly incomplete):

-Ambience SFX:
(Will prevent the SFX from being played entirely)

-A whole host of others that we haven't tested.
(You can assume that anything dynamic will be broken by being on the same event as <SkipUpdate>)




This plugin could have some otherwise unforeseen and undocumented issues, so please comment any that you come across so that they can be addressed.




License:

MIT License. Open Source.

Attribution is nice, but not necessary. If your format prefers to credit one person, I myself prefer that you credit SnakekillerX and not me.
I'm glad you found your solution.
I'll add it here if you need it. Great!
I decided to test the plugin on a large map and immediately discovered a compatibility error with "Galv Event Spawner". Regardless of whether there is a notetag.

Spoiler: error
er.png

By the way. Without other plugins (i.e. only Galv and this one), nothing changes, the error is still the same.
(Writing this just so that questions don't arise along the lines of "remove other plugins" (even if they're not the reason)) XD

1245.png
I decided to test the plugin on a large map and immediately discovered a compatibility error with "Galv Event Spawner". Regardless of whether there is a notetag.

Spoiler: error

@NinefoldSpirit Please remove the forwarding of your note/meta attributes in initialize, there's too much risk that it breaks with other plugins.

Code:
// upper block was removed

const Alias_SkipUpdate_Game_Event_update = Game_Event.prototype.update;
Game_Event.prototype.update = function() {
    if(!this.event() || !this.event().meta || !this.event().meta.SkipUpdate){
        Alias_SkipUpdate_Game_Event_update.call(this);
    }
}
When it still breaks, then you can blame Galv/Visustella/any other plugin creator for not processing notetags when cloning events 😉
I had contemplating adding the meta data to the event that way, but I didn't notice that .event() existed, only that .note and .meta seemed to be missing from the event's data itself. So this is good to know, thanks.

I'll push an update to this and remove it as it's no longer necessary.

I've done very little testing with this so I don't know what it's interaction with duplication from other event plugins.
Code:
// upper block was removed

const Alias_SkipUpdate_Game_Event_update = Game_Event.prototype.update;
Game_Event.prototype.update = function() {
    if(!this.event() || !this.event().meta || !this.event().meta.SkipUpdate){
        Alias_SkipUpdate_Game_Event_update.call(this);
    }
}
I've changed he syntax a little here to && instead of || as otherwise it'll still try and process the event update when there is no event data (might as well just stop it).
this.event() && this.event().meta && !this.event().meta["SkipUpdate"]
@NinefoldSpirit Please remove the forwarding of your note/meta attributes in initialize, there's too much risk that it breaks with other plugins.

Code:
// upper block was removed

const Alias_SkipUpdate_Game_Event_update = Game_Event.prototype.update;
Game_Event.prototype.update = function() {
    if(!this.event() || !this.event().meta || !this.event().meta.SkipUpdate){
        Alias_SkipUpdate_Game_Event_update.call(this);
    }
}
When it still breaks, then you can blame Galv/Visustella/any other plugin creator for not processing notetags when cloning events 😉
Since this is MZ, can you not streamline that check to if (!this.event?.().meta?.SkipUpdate)
Since this is MZ, can you not streamline that check to if (!this.event?.().meta?.SkipUpdate)
Yes, but I left it this way in case the structure is similar in MV and anyone wanted to test it there.
?. is not valid in MV.
Yes, but I left it this way in case the structure is similar in MV and anyone wanted to test it there.
?. is not valid in MV.
its valid for MV too as I use it in my html manipulation.

it require MV 1.6.x and probably higher nwjs to be able to get it done.

so it does work for me though =)
its valid for MV too as I use it in my html manipulation.

it require MV 1.6.x and probably higher nwjs to be able to get it done.

so it does work for me though =)
Good to know, I had someone else test ?. for me and they were getting errors, so could be they have an older version. I'll just leave it as is though as it doesn't really save much processing time.
I do love using ?. though, so much cleaner.
if they use lower MV version, it might, some use the old way and longer
to make it compatible with older version like Aerosys said, but with "&&"
as you pointed out.

if you use chaining like Trihan said, they need MV 1.6.x minimum as it
support ES6, with nwjs 0.48.4 (which I use) its should work.

so you can ask their version if it crash for them. so you know for sure 🙂
MZ version shouldn't get problems with chaining anyway as its shorter and
more powerful to use in my opinion ^^
I have noticed that just having the VisuMZ Events and Movement Core plugin activated significantly impacts load times on large maps. But as soon as you deactivate the Events and Movement Core plugin, then even maps that are 256x256 tiles will load very quickly (at least on my computer).

I've also discovered that the massive load times happen regardless of how many events are on the map. In fact, even if there are NO events on the map, if the map is very large and the Events and Movement Core plugin is activated, then the map will take about 3 seconds to load, and occasionally lag.

I could tolerate that, but the real dealbreaker is when you open the menu on a large map--you get that same long loading time every time you close out of the menu. That to me is untenable.

All that to say, I'm still looking for a solution to the core issue of the plugin making large maps kinda unusable. I don't really want to give up the Events and Movement Core plugin, as I like having it on the project and need it for some of the Tier 2 VisuMZ plugins I'm using. If in your dev journey you happen to find a way to address it, I'd love to hear about it.

Until then, I'm very happy you found a solution to your problem!

Original thread: https://forums.rpgmakerweb.com/threads/skipupdate-a-targeted-notetag-plugin-that-significantly-eases-the-processing-load-of-compatible-static-events.178429/