I've just spent hours testing and the lighting engine is 99% of the problem, the rest of it is actually having a pretty minimal impact (like in the ballpark of 0). But thank you for that, I may end up using that if I make something more intensive with parallax and such.
My game's memory usage increases after every battle
RPG Maker MZ SupportAs of right now it's just a parallel process that looks like this.
Wherein it checks if the player's x and y is the same as this events x and y, which DOES go off if the player is currently being controlled by a movement route, whereas the "Player Touch" option does not.
Is this check constantly running with no wait frames?
Because that's the number one source of lag in RPG Maker.
So instead of having this on every event and using a script call to check if the player is standing on it, you have one parallel event that checks whether the player is standing on a given region ID...then use a script call to set the A self switch of the event on that tile.
And, as I said multiple times and RCX just said, you should have a Wait command on this. At least, like, 5 frames.
And, as I said multiple times and RCX just said, you should have a Wait command on this. At least, like, 5 frames.
Can do, that's a simple fix.
Also, @RCXGaming, you have no idea, they are everywhere. BUT, as I've now found out it's not the source of my issue, because somehow my game isn't lagging, it's just got that issue because of the lighting. I've messaged the plug-in author and will fix this while I wait for an answer though because obviously I'll be better off if I do it properly, even if it's not the source of my current problem.
What I recommend doing is troubleshooting how deep this RAM utilization goes with the lighting plugin. From reading your responses, it sounds like the map that is causing the problem is making heavy utilization of the lighting plugin, which may be a non-standard, unintended use case outside the scope of the plugin.
Try making a more normal map with a normal amount of lighting on it and see if the problem persists there too.
Try making a more normal map with a normal amount of lighting on it and see if the problem persists there too.
It does, just to a lesser degree. A map with the player's light and 5 more light sources makes the memory go up by about 100MB or less whereas the map I discovered the issue on it goes up about 3-400MB.
Also I don't think it's non-standard because the demo project has lights EVERYWHERE, which leads me to believe the problem is on my end and I've set something up wrong.
EDIT: I added a battle to the demo project and exiting the fight DOES make the memory go up, but by a tiny amount compared to mine, and there's a LOT more lights in the scene, idk if it has to do with the small size of the map but fights are having a pretty negligible effect on the memory usage.
Turn off wait for completion and they will.
THANK YOU, that's an easy fix.
Original thread: https://forums.rpgmakerweb.com/threads/my-games-memory-usage-increases-after-every-battle.161287/