Laggy game

Hello guys,

RMMV
Straight to the point, my game is lagging. Not imediately. It works well for a while with no laggs but after a 10-15 minutes it starts lagging a bit. Sometimes even crashes. (No crash report or anything just closes the game at a bigger lagg). If you save, reboot the game it works fine again for a while.
I was searching in the topic and i found parralel events might cause this. I have 1-2 parralel effects on each map like (clear weather, map tinting, switch turning off events).

There is a fight that is very laggy in the game. You can reach it after a 10 minutes gameplay. I thought maybe there is something on that map. So when the player reach that part i transfer the actor to a full empty map to start the fight there. There is nothing on that map so i thought the lagg will disappear but not, it was the same.

The skill animations are lagging too during fights and as i said sometimes the game crashes at a bigger one.

I have usually 1 or maximum 2 parralel events on map with 1-2 commands.
My maps are around 40x40 some are bigger a bit some are smaller but 40x40 is the the average.
I use terrax lighting on some maps (i read lighting plugins can cause lagg problems too)


So my qeustion, the paralell events of other maps (or maps im touching when i play) can cause constant lagg?
Or maybe the order of my plugins? I use these. (I know its a bit mess, dont really now what the good order is)

Thank you for the answes.
This sounds like memory problems. How much RAM does your computer have?

1-2 parallel events on a map wouldn't cause lag unless they were also doing intensive calculations, which it doesn't sound like they're doing.

Nothing on another map can affect your game, you only have one map loaded at a time.

Do you use parallax maps? Large parallax images can annihilate memory.
This sounds like memory problems. How much RAM does your computer have?

1-2 parallel events on a map wouldn't cause lag unless they were also doing intensive calculations, which it doesn't sound like they're doing.

Nothing on another map can affect your game, you only have one map loaded at a time.

Do you use parallax maps? Large parallax images can annihilate memory.
Hi!
Thank you your answer!
16giga. I dont think its the pc because others tried it out too from different computer and they had the lagg too 🙂
parallel processes create constant lag if they work - they do not become slower over time.

what you describe sounds like a memory leak - which means memory is allocated to functions but never released even after the function ends, resulting in less and less memory available the longer the game runs.

what is the version of your rpg_core.js file? Please open it in a text editor and check the number at the title line, no number means 1.0
The early core version had memory leaks, but those have been updated years ago. But if you never updated your project, you might still carry the bad code in your project.

if it is one of the newer core versions then the memory leak is most likely in one of your plugins, and you'll have to update and check them to find the cause.
I might turn off large chunks of plugins and see if a plugin is the problem. Then narrow it down to which one(s). Unless you did something sloppy It's probably a plugin. Hopefully just bad order and you don't need to get rid of it. I'd guess this is it especially if the problem is wide spread, like, the performance drop is both in and out of battle and on multiple maps.

When you figure it out, or, either way I suppose, there are a bunch of ways to boost performance. Some that almost everyone should do and others that should be considered. keeping your njws to best current version (I can't remember the version but I do whatever MZ is on), update pixi to 4.8.9 (highest version 4, which is 100% compatible for MV), update pixi_filters to highest 3 (i think). Irinas performance upgrade plugin, DONT use SRD's performance plugins or tools (outdated and memory leak issues, SRD is awesome BTW). For a heavy game like yours use Yanflys fps synch plugin. umm... there's a few code changes out there too but those are usually for boosting already high framerates.

Oh and a preloader. Definitely if you have lot's of assets. I use Chaucer's Scene Stabilizer cause it's plug and play but there's a bunch to choose from and more current I'm sure.
a preloader.
just keep in mind that a preloader is a memory leak by design - it loads data into memory before needed and keeps them there, often much longer than needed.
this is usually done to reduce loading lag, but if you already have lag from memory leaks then a preloader can only help if configured and used in a very precise way - otherwise it will make the memory leak worse by removing even more RAM.
just keep in mind that a preloader is a memory leak by design - it loads data into memory before needed and keeps them there, often much longer than needed.
this is usually done to reduce loading lag, but if you already have lag from memory leaks then a preloader can only help if configured and used in a very precise way - otherwise it will make the memory leak worse by removing even more RAM.
Hello guys thanks so mich for the answers. I tried a preloader plugin already but didnt help.
parallel processes create constant lag if they work - they do not become slower over time.
So other map’s parralells can cause my problem too?

I’ll check rpg cores once im home 🙂


I might turn off large chunks of plugins and see if a plugin is the problem
If i turn off the plugins the game will stops when i reach a plugin command or script command :/

Hopefully just bad order and you don't need to get rid of it.
i have no idea what the plugin order should be for these ones. Do you have any idea?
So other map’s parralells can cause my problem too?
no, they can't - only the common events and the current map events exist at any time, other map events do not exist.
If i turn off the plugins the game will stops when i reach a plugin command or script command :/
that is why you have to turn them off selectively, and in those specific cases have to change the events where the commands are used for that test.
i have no idea what the plugin order should be for these ones. Do you have any idea?
no one has - not for such a mix of plugins. you can only experiment after you found the plugins involved.
no, they can't - only the common events and the current map events exist at any time, other map events do not exist.

that is why you have to turn them off selectively, and in those specific cases have to change the events where the commands are used for that test.

no one has - not for such a mix of plugins. you can only experiment after you found the plugins involved.
Okay, thank you for the answers 🙂
I’ll see if i find something
I'm going to second the recommendation to make sure that NWJS and Pixi are updated. Updating NWJS in particular, is the very first thing that any MV user should do. I'd personally recommend version 0.48.4, since that's also what MZ uses. You can go higher, but I personally prefer to operate under the assumption that there's some reason for why the devs are keeping MZ's version where it's at.

If you haven't already updated NWJS, then just doing that should increase your framerates all across the board. It will also improve the garbage collector, which could potentially help with your possible memory leak issue.

Otherwise, as everyone else has said, a likely culprit is going to be your plugins. But figuring out which is going to require some work on your part, in order to narrow it down.

Parallel events can surely cause lag, but if you're legitimately only using two small parallel events per map, that's probably not your issue. Regardless, it's still a good practice to try to make your parallel events as low-impact as you can. For example, if you don't *need* a parallel event to be executed 60 times per second, then add a Wait command in there, to make it only execute as often as needed.
I'm going to second the recommendation to make sure that NWJS and Pixi are updated. Updating NWJS in particular, is the very first thing that any MV user should do. I'd personally recommend version 0.48.4, since that's also what MZ uses. You can go higher, but I personally prefer to operate under the assumption that there's some reason for why the devs are keeping MZ's version where it's at.

If you haven't already updated NWJS, then just doing that should increase your framerates all across the board. It will also improve the garbage collector, which could potentially help with your possible memory leak issue.

Otherwise, as everyone else has said, a likely culprit is going to be your plugins. But figuring out which is going to require some work on your part, in order to narrow it down.

Parallel events can surely cause lag, but if you're legitimately only using two small parallel events per map, that's probably not your issue. Regardless, it's still a good practice to try to make your parallel events as low-impact as you can. For example, if you don't *need* a parallel event to be executed 60 times per second, then add a Wait command in there, to make it only execute as often as needed.
Thank you very much for the answer. I’ll do the updating on monday! Just one more qustion. Updating Pixie or NWJS does not make some of my plugins unusable? (Like when i upgrade the RPGMV and some plugins is not working with the newer version).
Updating Pixi won't affect any plugins, as long as you don't go above version 4.8.9. Don't go higher than that though. Setting plugins aside, the engine itself isn't compatible with Pixi 5+.

For NWJS, it shouldn't break any game-related plugins. But if you have any plugins that affect the window itself, it is possible for upgrading NWJS to affect those. For example, I've heard of some people's full screen plugins acting weird after updating NWJS. But AFAIK, those people all upgraded NWJS way higher than the 0.48.4 that I recommended to you. I think that if you stick with 0.48.4, it'll probably be fine.

But if some plugin *does* break, I promise that the NWJS upgrade is going to be way more valuable than that plugin. It basically yields a 300% performance increase.
(Like when i upgrade the RPGMV and some plugins is not working with the newer version).
what is your core version? you never answered that question when I asked above, and that sentence does make someone suspicious whether you still have a core with memory leaks, in which case you can't do anything but update the corefiles no matter the consequences....
what is your core version? you never answered that question when I asked above, and that sentence does make someone suspicious whether you still have a core with memory leaks, in which case you can't do anything but update the corefiles no matter the consequences...
Well, im not home so i couldnt check it yet
Hi, so i checked. My core cer is 1.6.1
parallel processes create constant lag if they work - they do not become slower over time.

what you describe sounds like a memory leak - which means memory is allocated to functions but never released even after the function ends, resulting in less and less memory available the longer the game runs.

what is the version of your rpg_core.js file? Please open it in a text editor and check the number at the title line, no number means 1.0
The early core version had memory leaks, but those have been updated years ago. But if you never updated your project, you might still carry the bad code in your project.

if it is one of the newer core versions then the memory leak is most likely in one of your plugins, and you'll have to update and check them to find the cause.
then all memory leaks are in the plugins.
the core had its last memory leaks fixed at 1.4.x or so
Thanks so much! NWJS Solved my problem!
Updating Pixi won't affect any plugins, as long as you don't go above version 4.8.9. Don't go higher than that though. Setting plugins aside, the engine itself isn't compatible with Pixi 5+.

For NWJS, it shouldn't break any game-related plugins. But if you have any plugins that affect the window itself, it is possible for upgrading NWJS to affect those. For example, I've heard of some people's full screen plugins acting weird after updating NWJS. But AFAIK, those people all upgraded NWJS way higher than the 0.48.4 that I recommended to you. I think that if you stick with 0.48.4, it'll probably be fine.

But if some plugin *does* break, I promise that the NWJS upgrade is going to be way more valuable than that plugin. It basically yields a 300% performance increase.
then all memory leaks are in the plugins.
the core had its last memory leaks fixed at 1.4.x or so
Hi its me again. Since the memory leak is still exist i tried to find which plugin causes it as you said. (Performance is much better but afte 1 hr gameplay it starts lagging again :'()
So i dont know if its a good way to figure out, but i turned off all the plugins and start clicking esc (calling menu) button. The memory usage was constantly rising when ABS Alpha was turned on. If it was turned off then it was good so i guess it must be the reason of the memory leak.
But this is the most important plugin in my game. (Of course...)
I dont really want to turn it off, is there any other way to solve the problem?
A memory leak has to be precisely identified - down to the code line where it happens - before it can be solved.
So yes, it can be solved with a patch to the plugin, but that requires a programmer to analyse the plugin code. And ABS-type plugins are among the most complex plugins out there.

you can try to request such a patch plugin in plugin support, but to get someone other than the original plugin writer to solve this will be a lot of work and unlikely - and I don't know who wrote that plugin and if he/she is still active.

Original thread: https://forums.rpgmakerweb.com/threads/laggy-game.144836/