[CGMZ] Anti Lag (Patreon)
Downloads
Content
Optimizes your game to try and reduce lag. Note that this does not prevent lag, if you try your hardest you will be able to make your game lag. What this does do is provide some options to address common areas that cause lag and make it easier to optimize your game.
! SEE BOTTOM OF POST FOR UPDATES !
Hi all, introducing [CGMZ] Anti Lag!
This plugin provides some options to optimize your game or help make it easier to avoid situations that can easily lead to lag. While [CGMZ] plugins are all optimized for performance pretty thoroughly already, other plugins or even default RPG Maker events that are poorly optimized can easily cause lag. This plugin tries to reduce such lag in the following ways:
Reduced Map Refreshes
By default, whenever a switch, variable, or self switch changes, it requests a map refresh which will cause every event on the map to check its event page to ensure it is on the correct page. However, this may not always be necessary. You may have a common event that constantly increases a variable by 1 to track time or some other metric, which is not used in any event page conditions. This plugin allows you to set switch and variable IDs that do not cause map refreshes to occur. It also allows you to only refresh the event that had its self switch changed rather than every event.
Pathfinding
Pathfinding can be expensive, especially if you use it frequently in your event move routes. This plugin allows you to shorten the search limit which will trade off the path finding algorithm's smartness for more performance.
Skip Event Update
Some events you just don't need to update, for example a static event that is meant to add a graphic somewhere or serve as a blank event to block other events, or many other scenarios. This plugin comes with a note tag that can disable certain events from updating, reducing the performance impact of updating when it is not necessary. Events without the note tag will function as normal.
Parallel Common Events
It is a common issue that someone makes a parallel common event that causes lag due to forgetting to include a wait event command at the end for at least 1 frame. This plugin comes with the option to automatically add a wait event command at the end of your parallel process common events, ensuring you do not forget to do this yourself and making it easier to create common events without needing to worry about performance. Common events that are not parallel are not affected.
All Features Optional
This plugin's anti-lag features can be completely disabled if needed. This will ensure it is compatible with just about every plugin out there, and it also provides you the option of choosing which anti-lag features you want to use. If a certain feature has no or very little impact on your game's performance, you can simply turn it off and not need to worry about it impacting your game's code or compatibility with other plugins.
Quick Facts
✅ RPG Maker MZ✅ No obfuscation✅ No AI used at any point in the creation of this plugin
Support
Casper Gaming provides quick support to any user who needs it. You can leave a comment below with your question or issue, I try to check my Patreon at least once a day. For even quicker support, you can come into the Casper Gaming Discord and ask for help in the #support channel.
Roadmap
This plugin should already cover the most common areas that cause lag in RPG Maker games. I plan to continue to monitor performance issues people post about on the forums or elsewhere to see if there is a way I can make it easier to deal with.
This plugin will rely a lot on user suggestions. If your game lags, and this plugin does not solve it, you can let me know and I can look into what is causing the problem and update this plugin to address it (if possible).
Casper Gaming plugins are made better through community suggestions. I am always happy to hear any features you'd like to see added that I may not have thought of already. Please leave any suggestions you have in the comments below, or in the #suggestions channel of the Casper Gaming Discord. I add all suggestions to my to-do list.
Happy RPG Making!
This version improves the skip update functionality for events, allowing you to skip update for individual pages by using a comment event command. Event pages with the comment present will have their update skipped, while event pages without the comment will not have their update skipped. Note that update will always be skipped if the note tag is present.
This update also added a plugin command to turn event update on/off manually. You can have your event call this plugin command to turn any event's update status to either on or off. Note that this is an additional check, using either the note tag or comment will prevent event update even if you use the plugin command to turn it ON. Event update status from the plugin command is not part of save data.
This version adds an option to skip playing sound effects if the player has the volume set to 0, or if the sound effect object is set to 0 volume. This skips creating the sound effect buffer and loading the file, which can be a decent performance gain if your game uses a lot of sound effects but your player has turned the sound off. This could also benefit if you use a spatial audio plugin that attempts playing far away sounds at 0 volume.
This was not added to BGM or BGS because chances are you are not playing too many of those, and it is still important those get created since they are typically long where the player may unmute their sound during its play time.