Sudden (and mysterious) performance drop

● ARCHIVED · READ-ONLY
Started by Kenode 12 posts View original ↗
  1. So I've been poking with RMMV on this project for a while, I have a good bunch of plugins installed (relevant one seems to be Yanfly's Grid-free doodads) and about two or three common events running, (relevant one seems to be the footstep event).

    I have a specific map that I've been coming and going, constantly touching it from time to time. It always ran smooth, 60 fps, not a single frame dropped. But suddenly, the game began to do something weird in this map, as soon as I enabled the footstep event, with a serious performance drop that makes the frame rate go down to 15~20 fps.

    Here's the weird thing: I haven't really changed anything, if anything I did add a few plugins, but I already tried removing them, with no performance difference. I've removed Yanfly's Grid-Free doodads, and I get the butter smooth 60 fps again. But, with it enabled, I've tried removing all doodads, and there's no actual difference in performance, still on 20 fps. It is a really weird case, because, seems like the doodads plugin is causing the frame rate to drop, when combined with the footsteps event, but it never did this before, it started doing it all of the sudden. And it doesn't seem to be an excess of doodads what's causing it, because clearing all doodads from the map doesn't improve the frame rate at all.

    I've tried other maps in the game, with doodads and all, and it runs fine. But in this particular one, it goes crazy, but only when I enable the footstep event.
    The footstep event basically is a piece of code which detects the region, an if that goes to one or another piece of code where the sound is played, and another piece of code that makes the event wait approximately 30 frames before playing the event again.

    So, to sum it up, even if I re-enable all the new plugins I installed, but just disable the doodads plugin, I get the butter smooth 60fps with the footsteps. If I have all plugins on, with Doodads plugin, but without the footsteps, I get the butter smooth 60fps.
    If I enable both, even in a small area that has absolutely no doodads, the frame rate drops down. And the weirdest part is, it didn't do this before, and I haven't changed anything except some new plugins that I already tried disabling, with no improvement. It's driving me crazy.

    [EDIT] I've just tried disabling Terrax Lighting, leaving doodads and footsteps on, and it's also butter smooth 60fps. I've been using TL since the beginning of the project, and I never had a problem with it before as well, and, other maps which also use both TL and Doodads and footsteps don't have the problem.

    [EDIT 2] I've tried using an event to activate the footstep variable instead of using F9, and it's back to smooth. But if I use F9 to activate it, the framerate slow downs. What.

    [EDIT 3] Looks like simply accessing a menu is causing it. I guess I can discard it being the footstep event causing it. Even pressing ESC, and then returning to the game drops the framerate down.
  2. Are you saying it ONLY happens when you access a menu? Activating the footstep variable using F9 or using an event doesn't cause the slowdown, unless you also access the menu?
  3. So if you access a menu it causes slowdown after? Sounds like you have a menu plugin that maybe isnt clearing the objects created by the menu scene after exiting it.. Btw does it also happen on the other maps when you open the menu on them or still just on this one map?
  4. @Shaz It only happens when I access the menu (It still runs at 60 fps while in the menu, once I exit the menu, it slows down), F9, would also count as a menu in this case, because it causes the slow down too. If I enable the footsteps through an ingame event, the game still runs butter smooth until I access a menu, be it F9 or escape.

    @Engr. Adiktuzmiko It happens only in that specific map. I have other maps, but it doesn't happen in them (although they are smaller, and have less doodads, but one of them has a lot more light sources) I've tried disabling SRD's HUD maker, but it doesn't seem to help with the issue.
  5. So since you discovered it was accessing the menu, have you tried to disable TL, and the footsteps plugins and see if it makes a difference? Still need to find out which plugin is causing it.
  6. Shaz said:
    So since you discovered it was accessing the menu, have you tried to disable TL, and the footsteps plugins and see if it makes a difference? Still need to find out which plugin is causing it.
    I did try disabling Terrax Lighting, as I explained in the original post. The FPS problem disappeared. Same goes for the doodads plugin.

    The weird thing is that this hasn't happened before, it started happening out of the blue. The footsteps isn't a plugin, but an event that happens every 30 frames. It basically checks for the tile ID the player is standing on, then another block of code chooses and plays the sound, then another block of code stops the script for approximately 30 frames.

    I've tried removing the wait and I've also tried extending the wait a lot more to see if the event was happening too often for RMMV to handle it, but it didn't make a difference at all. It's just accessing the menu in that map, then exiting it, what causes the slow down when everything is up and running.

    If I never hit F9 to access variables, and enable footsteps via an ingame event, it runs at 60fps. If I access a menu, be it F9 or ESC, it slows down to 15~20 fps, even if I don't enable footsteps.

    Update: Disabling YEP_LoadCustomFonts seems to fix the menu problem, too. But it's really weird, it doesn't use any different font other than default, since that's used in the dialogues only. And when loading a dialogue with a different font, it doesn't happen either. But it is the only menu related plugin I can think of, other than SRD's HUD maker. (Which doesn't do anything if I disable it)

    Update 2: Okay, maybe it isn't YEP_LoadCustomFonts, but YEP_MessageCore. This sets me back, as I had Message Core working smoothly before this began.

    Update 3: Ironically, accessing the YEP's Grid-Free Doodads menu doesn't cause the slow down. This menu doesn't make the game pause, although, I don't know if that could have anything to do with the issue. So far, it looks like default RPGMaker menus are causing it.
  7. Kenode said:
    I did try disabling Terrax Lighting, as I explained in the original post.
    When you said that, you hadn't yet determined that it was caused by entering the menu. You didn't state whether you tested entering the menu without the plugins on.

    I can't see how it could possibly be Message Core, as entering menus does not invoke any messages, and heaps of people use that plugin without any issues.

    You seem to be jumping around a lot, suspecting one plugin, then another. I suggest at this point you take a more structured approach - disable ALL your plugins, see if you can reproduce the problem. If it happens, then it's nothing to do with the plugins, and it's something to do with the map or events. If you can't get it to happen, start enabling the plugins again, one at a time, and testing after each one. If you get it to happen, disable the last-enabled plugin and confirm that it no longer happens with that plugin disabled. Then leaving that one disabled, continue through the list, just in case there might be more than one plugin contributing.

    Perhaps start a brand new project with just one or two maps, replicate the plugins and the events, and see if it happens with the new project. Make one map large and one small, with no other changes (same events, same plugins active) and see if it makes a difference.

    You have to identify the exact plugin first.
  8. Shaz said:
    You seem to be jumping around a lot, suspecting one plugin, then another. I suggest at this point you take a more structured approach - disable ALL your plugins, see if you can reproduce the problem.
    The reason it seems like I am jumping around a lot is because I am trying to provide as much information as possible (I keep seeing cases where it's difficult to narrow down an issue posted here because people don't provide enough information about the issue)
    I've decided to do a complete run through each of the plugins I have, no matter their function, even if there's nothing menu related, and I've narrowed the issue down to having these three active at the same time:
    • Terrax Lighting
    • YEP's Grid-Free Doodads
    • YEP's Message Core
    Also, when removing the summer tree doodads by PandaMaru, the framerate goes back to normal even after a menu. (But why doesn't it do that before I open a menu? It doesn't make sense). But I don't know if this could be an acceptable solution. I've read of people who place hundreds of doodads without performance problems. All I can think of doing for that is removing all the doodads and put them all in a single parallax image, but I'm worried about the size of the resulting file.

    Shaz said:
    You have to identify the exact plugin first.
    That is the exact thing I can't figure out. I've tried disabling all plugins already, and the problem goes away. Here's the thing, the problem seems to happen only when I have TL, MessageCore and Grid-Free doodads enabled at the same time. If I disable any of those three, while leaving the other two on, the problem disappears.
    It can be any of those three causing it, but it only happens in this particular map.

    Event wise, there's a bunch of static events that happen, but they don't have any code running, nor they are moving around the map. They are just static pieces/animated tiles. (Animated waterfalls and some lens flares. There's also a chest that I haven't scripted yet)
  9. okay, so maybe it's a combination of those three plugins along with something on this map.

    I don't have a lot of time, but if you can duplicate your project, remove all unnecessary maps (keep this one and one or two others where you have the same doodads, events, plugins active) and as much unnecessary other resources as possible, I might be able to take a look and see what's going on.

    I doubt it's got anything to do with removing a couple of particular doodads - I suspect it's more coincidence. But to confirm, do you have the summer tree doodads by PandaMaru on the other maps? If you add some to one of the other maps, does the problem start happening there as well?
  10. Shaz said:
    okay, so maybe it's a combination of those three plugins along with something on this map.

    I don't have a lot of time, but if you can duplicate your project, remove all unnecessary maps (keep this one and one or two others where you have the same doodads, events, plugins active) and as much unnecessary other resources as possible, I might be able to take a look and see what's going on.
    I've been working on this and removing as many resources as possible. I had to include a few for the events (I had to blank them out, and remove a lot of tilesets, as a bunch of them were under a license where I couldn't redistribute them like this, so, excuse the mess)

    How do I send you the file? Do I post it here in the forums, publicly?

    Shaz said:
    I doubt it's got anything to do with removing a couple of particular doodads - I suspect it's more coincidence. But to confirm, do you have the summer tree doodads by PandaMaru on the other maps? If you add some to one of the other maps, does the problem start happening there as well?
    I've been trying more stuff, seems like it happens with the static events, too. Not just the doodads.
    It looks like setting up a light with a very large radius in Terrax Lighting (I was doing this so I wouldn't end up with a large black map, while still being able to use lights, in a map with subtle light) is causing this, when there are a lot of objects in the map, be it doodads, events or even tiles.

    Oddly, this didn't happen before, which is the weirdest thing. And it still only happens after I access a menu (most notably, the F9 menu).
  11. I would expect lag with the lighting plugin. I played the demo game in the FSM resource pack, and every map that had lighting lagged, even though the maps were small.

    Does the lag continue? Or does it lag for a bit and then come good if you stay on the map without going back into the menu again?

    Something you could look at is to open your Task Manager to the performance tab. Play on that map for a bit and check the CPU and Memory. Then go into a menu, back out again, and watch the CPU and Memory. See if either of them spike as you exit the menu.
  12. I didn't have any issues with the FSM demos myself, although I have a somewhat decent rig.

    Yes, the lag continues. I've let it sit for over 10 minutes and it was still lagging.

    I did try the Task Manager, the CPU usage stays between 5% to 17% at most, but I've noticed every time I go into the menu, and leave, the RAM usage spikes.