How do I check a log of what's going on when there's an error?

Hey everyone,

Disclaimer - I don't know code.

My game is freezing at seemingly random moments when the player is walking around on a map. Not only does this happen on maps with a few parallel processes going on, but it also happens on maps that don't have much going on at all. I'm starting to suspect a plugin is the culprit - but the trouble is, systematically going through the list - I still can't find out which one it is as the game doesn't necessarily freeze with any particular regularity.

Sometimes when there's an actual error that the test-play engine informs you off, I get this Adobe Edge window come up with a list of things that the game is doing. I imagine that if I could check this log at the points in which the game freezes it would help identify what's going on.

Another thing, about the nature of the freezing - I don't know if this is standard for MV, but it's as if only the IMAGE of the game freezes, but the sound and key inputs all still carry on. So even if I could get some kind of log, it may be hard to identify when the freeze actually occurs if things are still being processed as normal.
It is very likely your events and nothing to do with plugins at all. Unless the game crashes, there is no log to check.

The number of times people have said "it's not a parallel process" and that's turned out to be exactly the cause, I've lost count. So yes, check your parallel processes - even a single one that is badly designed can cause the game to lag terribly.
Even if the freezes are happening in battles as well?
Probably not, but then you didn't say it's also happening in battle.

Do you use troop events in your battle? Do you have a plugin that allows common events to run in battle?

Start a brand new project and set up some events/battles as they are in your current game, but don't use ANY plugins. See if the issue is still happening there. Or disable all of your plugins and then re-enable them again one at a time (or in small groups if you have a lot of them), saving and playing after each one/group. See if the issue still happens when all plugins are disabled. If it doesn't, it'll start happening after you enable one of your plugins. This is how you figure out what's causing it.
Probably not, but then you didn't say it's also happening in battle.

Yeah, this happened on a more recent test play after making my original post. News to me as well. I've gone through every map in which a crash has occurred and checked the parallel events. There was one suspect one, and I've fixed that. Haven't experienced a crash on that map since but I'll have to keep testing.

As for the others - everything seemed fine so I looked at parallel running common events. I think one or two didn't have wait times at the end of their command windows, so I've fixed that up. I haven't had any on-map crashes with one (almost) complete play through thus far. If I can get through two play throughs back to back with no freezing, I think that'll be a pretty good sign that the problem is resolved.

Do you use troop events in your battle? Do you have a plugin that allows common events to run in battle?

No and yes. There is an instance in which I call a common event inside a Yanfly action battle sequence. I've had a look at the text and added a small wait period after the common event is called. I've narrowed the freezing down (at least in battles) to troops involving one enemy in particular that uses the aforementioned skill. It doesn't always happen in the same spot though, which is a little perplexing. I've checked that no other parallel common events are running as well (if they were - would they have an effect in battle anyway?)

Start a brand new project and set up some events/battles as they are in your current game, but don't use ANY plugins.

I'll get to the battle part, which will be interesting, but walking around on a blank map with no plugins - no problems there, not surprisingly. I could try removing that skill from the enemy question and see if the freezing still occurs.

Thanks for the help, I'll post an update on the rest of my findings.

EDIT: An additional question related to the above.

So, regarding wait times - if the idea that a parallel process with no wait time can cause the game to have issues, does this also mean that multiple parallel events with wait times that, eventually may coincide with each other - this will also cause issues?

For instance, if I have an parallel event that has a wait of 5 frames at the end of it, and another parallel event on the same map that has the same command list but has a 15 frame wait at the end of it - eventually these events will be forced to activate at the same time. Does this cause the issues?

The above is not an example I actually include in my game, but there are multiple processes running on certain maps with a complex series of wait times that I fear had I done the math - I'd find that their execution would be coinciding with one another.
Common events would only affect battle if you attach them to an item or a skill. Parallel/autorun common events would only affect battle if you have a plugin that allows common events to run during battle apart from being attached to an item or a skill.

The more events you have running at the same time, the more impact it will have on performance. Parallel process events are ALWAYS running until/unless you turn them off by erasing them or making a different page active that is not set to parallel processing. One event with no waits can cause lag. Many events with waits can cause lag simply due to the number of them. No matter how many you have, the more poorly designed they are, the bigger the impact can be.

Think, "how many times does this need to happen every second?" If it's something that happens every time the player moves onto a new tile, how many tiles can the player cover in a second? Divide 60 by that number to get the number of frames you should wait, and then maybe reduce it by a little bit.

Interesting that the only battle where this happens is against that one enemy, who uses the skill that's attached to a common event. Feel free to post screenshots of the common event here if you'd like us to take a look and see if it can be improved.
Well, the common event that's called is literally this:

Spoiler
◆Control Variables:#0101 E.Skill: Witchery = Random 2..5
◆Wait:5 frames

So, nothing amazing happening there. It's not a parallel event, trigger is set to 'None'.

And, as it turns out, the battles are freezing with other enemies too.

I think I've fixed the on-map freezes though. Pretty sure.
Got to be something else then.

When you say "freezing", what exactly do you mean? You can't do anything at all, and have to kill the game? Or does it just get slow and laggy but you can still do stuff? Or does it freeze temporarily, and for how long?

What battle-related plugins are you using? Disable them all and see if the issue still happens. If it doesn't, re-enable them again one at a time, saving and playing between each one, until the issue happens again. The last one you enabled before it started happening is likely the one that's causing the issue, or it's clashing with another.

If you have Yanfly's plugins, make absolutely sure they're in the right order, according to his website.
When you say "freezing", what exactly do you mean?

Okay, so when I say 'freeze' - it's an odd variety of such.

See what happens is, the game IMAGE freezes. Everything on the screen goes still, like a freeze frame. But the game sound and processes are still occurring. I know that I can still navigate the menus in battle because I can hear the corresponding sounds. The game itself keeps going - it's just that you can't see anything but the frame the game froze on. Literally - I can complete the battle and keep playing the game even after the battle has finished if my guesswork is good enough.

This *may* have been the same case with the on-map freezing too. If it happens again, I'll double check.

What battle-related plugins are you using?

I've changed a few things in the running order like you mentioned, so before listing them all I'll just see if this fixes the problem. In terms of the last plugin added sorta stuff, I actually couldn't tell you. The problem is, I've come back to development after a few months off and I don't have a written record of my progress and changes. From what I can tell, this has been an intermittent problem for a while now.
It sounds like you have a plugin that's not updating graphics as it should be, which means it's probably doing its own update loop and not relying on the update loop of the base class.

I don't mean what plugin did you add last. I mean disable all of them, save and play. If the issue doesn't happen, enable the first one, save and play. If the issue doesn't happen, enable the second one, save and play. Keep going until the issue happens. The last plugin you enabled will probably have something to with the issue.

If it ONLY happens in battle, you could shortcut the process by only looking at the battle-related plugins. But if it's still happening on-map as well, you'll have to consider all of them.

What plugins do you have that are running ALL the time? Any HUD plugins?
I'm just gonna screen shot all of those little guys for you as they are at the moment:

upload_2017-11-6_11-28-1.png

upload_2017-11-6_11-28-41.png

upload_2017-11-6_11-29-0.png


So, in anticipation of the question "Do you really need to use *all* of those?"

I think so. All of the ones that are on at the moment have something that's used in-game. Some of them are only used for a single note tag because of my inability to script, or because there are no other resources available that do the specific trick. I've tried to stick primarily to YEP plugins.

Also, just confirmed that the 'freezing' issue is still happening on map, and it DOES only freeze the game image. I can still open the menu, get transferred to different maps etc, even though all I can see is the frozen image.
Are you certain ALL those Yanfly plugins are in the correct order?

Interesting that you have mapshot and overlay - it almost sounds like you've got something that's taken a picture of the map, and you're displaying it as an overlay - or a picture. I'm curious about the Foreground plugin as well, though from its description it doesn't sound like it'd be the culprit. If you do go to a new map, does it still show the frozen image from the last map, or does it refresh?

I think you're just going to have to bite the bullet and disable all those plugins, then start re-enabling and testing, one by one. There's really not much more I can say - if I was having this problem, that's exactly what I'd be doing. No point putting it off - the sooner you get started, the sooner you'll find out what the problem is. The only thing that makes it a bit difficult is that it seems to be a bit random.
Yeah, so the periods of time between freezes can vary.

But fair enough, that's what I'll do after making sure the plugins are in the right order.

As far as I know, foreground came by default with RMMV, or maybe it was in the bonus DLC for it. I'll disable it, I have no use for it.

Orange Mapshot just takes a picture of the map, it's usually off. I only turn it on when I need to take a snap shot.

Anyway, thanks very much for your help. I'll hopefully have some good in later updates.

EDIT: Cautiously optimistic that I've identified the problem.

Inside my 'pictures' folder under 'img', guess what was sitting in there, nice and cozy? An entire installation of RPG Maker MV. My uneducated and baseless theory is that when the engine was indexing, there may have just been too many unexpected files in that directory, causing issues.

Played the game right the way through (about half an hour's worth) without issues. If I can get through it again without a freeze, I'll call it a win.
I just wondered if you have something fancy that takes a picture of the map, and then uses that in the overlay plugin or something.
Confirmed - it was the unintentionally added directory of an RMMV installation in the pictures folder that was doing it. Bit of a sneaky one.

Closing topic, thanks for the help!
you need to report your first post to close it 😉
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-check-a-log-of-whats-going-on-when-theres-an-error.86653/