Abrupt crashes -What have I been doing wrong?

Hi, I'm a newb.

I've been having strange crashes where my finished/deployed game's window shutdowns abruptly without any warnings/prompted bug report. What is more surprising is that the game shutdowns in random places, no matter how high or low end the computer is (I tested both). Usually when there's a mistake in programming, the game shows a warning bug report while crashing, right? Mine just shutdowns; let's say randomly in every 10-20 minutes in-game.
I also realize some symptoms appear (but not always) before abruptly shutting down, such as BGMs suddenly disappearing.

My questions:
a)
What have I been doing wrong? I've made sure every file doesn't have a space/unnecessary symbols except for _ and -
b) Could it simply be caused by my events being "messy"? But I don't use parallel events.
c) Could it be due to my plugins' order? Here it is:
help for crashes des 2022.png

I've put YEP's plugins in order based on web, if any of them seem odd, may I know which one or how to make it better?

Thank you in advance
😢
It's very hard to diagnose without any kind of error or specific situation you can reproduce.

The idea that things start to go wrong before the crash lean toward it possibly being a RAM usage problem, but hard to tell.

The very best thing would be for you to spend some time with it in playtest mode from the editor. That way, if it crashes, you should get an error message and should be able to hit F8 and go to the Console tab to screenshot the error trace.

Do you use parallax mapping?
It's very hard to diagnose without any kind of error or specific situation you can reproduce.

The idea that things start to go wrong before the crash lean toward it possibly being a RAM usage problem, but hard to tell.

The very best thing would be for you to spend some time with it in playtest mode from the editor. That way, if it crashes, you should get an error message and should be able to hit F8 and go to the Console tab to screenshot the error trace.

Do you use parallax mapping?
I see. If it's related to my RAM, how do I overcome it?
This is my PC specification:

help for crashes des 2022 2.png


I wish I knew more about about editor mode/window. My lack of knowledge in programming makes me feel like looking at a nuclear deterrent code. LOL.
Is there any way I can learn how to understand the f8 feature while being a noobie?

I dont use paralax mapping except for 1 map only
there are several ways this could be related to file- or foldernames, having the project and game stored in the wrong folders or with illegal letters in the names.

can you give us the full folderpath for both your project directory and where you stored your deployed game? Beginning with the drive letter and ending on the index.html of your game.
can we see some recordings? it may help.
Keeping the Task Manager (Ctrl+Shift+Esc) open and keeping an eye on your game's RAM consumption could help you determine if it really is a RAM issue or not. When playtesting, your game may be listed under the name "nwjs".

If it is a RAM-related problem, you should see your RAM consumption steadily increase until it crashes. Since MV uses a 32 bit build of NWJS, that means it will crash when its RAM consumption reaches the 2-4 GB range (depending on OS and settings). So if your game's RAM consumption crashes as it approaches (or surpasses) 2 GB RAM, that means you've encountered an OutOfMemoryException.

Fixing an OutOfMemoryException is not easy. If it's caused by a memory leak, then finding out where the memory is leaking is a huge challenge in and of itself. If it's caused by simply using too much RAM, then fixing it requires rethinking your game's design and/or assets, which only gets harder the closer you get to release (and you've already released it).

If it really is an OutOfMemoryException, then one possible workaround would be to use a 64 bit build of NWJS instead of the default 32 bit build that MV uses. If you do that, you'll probably want to update your game's minimum specs to include at least 4+ GB RAM.
there are several ways this could be related to file- or foldernames, having the project and game stored in the wrong folders or with illegal letters in the names.

can you give us the full folderpath for both your project directory and where you stored your deployed game? Beginning with the drive letter and ending on the index.html of your game.
That would be amazing to do/seek. But because I'm still a newbie, how do I give a full folderpath with the driver letter index.html that you mentioned? (Sorry for being oblivious)
can we see some recordings? it may help.
for evidence when it crashes in a form of a video will be quite tricky because it happens randomly and inconsistently. But I surely will try recording and I might get lucky to capture one.
Keeping the Task Manager (Ctrl+Shift+Esc) open and keeping an eye on your game's RAM consumption could help you determine if it really is a RAM issue or not. When playtesting, your game may be listed under the name "nwjs".

If it is a RAM-related problem, you should see your RAM consumption steadily increase until it crashes. Since MV uses a 32 bit build of NWJS, that means it will crash when its RAM consumption reaches the 2-4 GB range (depending on OS and settings). So if your game's RAM consumption crashes as it approaches (or surpasses) 2 GB RAM, that means you've encountered an OutOfMemoryException.

Fixing an OutOfMemoryException is not easy. If it's caused by a memory leak, then finding out where the memory is leaking is a huge challenge in and of itself. If it's caused by simply using too much RAM, then fixing it requires rethinking your game's design and/or assets, which only gets harder the closer you get to release (and you've already released it).

If it really is an OutOfMemoryException, then one possible workaround would be to use a 64 bit build of NWJS instead of the default 32 bit build that MV uses. If you do that, you'll probably want to update your game's minimum specs to include at least 4+ GB RAM.
I truly hope the issue isnt OutOfMemoryException, because I wouldn't know how to solve it with my mediocre programming skills. If I may ask several questions:
a) how do I make it 64 build of NWJS?
b) how do I update my game into a 4+ GB RAM minimum specs?
c) do these random crashes happen to most of RPG MV users or it's just a matter of how neat we write our events?
(thank you in advance)
It's a long shot but can you try checking your Windows event logs? You will find them in the Event Viewer in the Windows Logs in the left hand pane.

Application related logs will appear in the Application log. What you will be looking for are any events that occur around the time the game crashes. Generally applications don't generate a lot of noise in that log and what you would be looking for are error or warning events around that time. No guarantee that it will have logged anything as it is dependent on how the application crashed and whether the code in RPG Maker has the hooks in deployed apps to generate the logs.

There 'might' be clues in the System event log but it's a very 'busy' log which logs a lot of activity behind the scenes. It's less likely to have anything there unless something about your game hits system resources.

As @Nolonar has said, using the Task Manager and monitoring memory usage of your game may help identify if it's consuming too much memory in the user space. You can keep it open and there is an option to keep it on top of the other apps so that it's always visible.

There are other ways to monitor memory use but then we get into the dark arts of using perfmon to monitor memory usage. Memory leaks and high CPU issues were the bane of my existence as a system administrator.
It's a long shot but can you try checking your Windows event logs? You will find them in the Event Viewer in the Windows Logs in the left hand pane.

Application related logs will appear in the Application log. What you will be looking for are any events that occur around the time the game crashes. Generally applications don't generate a lot of noise in that log and what you would be looking for are error or warning events around that time. No guarantee that it will have logged anything as it is dependent on how the application crashed and whether the code in RPG Maker has the hooks in deployed apps to generate the logs.

There 'might' be clues in the System event log but it's a very 'busy' log which logs a lot of activity behind the scenes. It's less likely to have anything there unless something about your game hits system resources.

As @Nolonar has said, using the Task Manager and monitoring memory usage of your game may help identify if it's consuming too much memory in the user space. You can keep it open and there is an option to keep it on top of the other apps so that it's always visible.

There are other ways to monitor memory use but then we get into the dark arts of using perfmon to monitor memory usage. Memory leaks and high CPU issues were the bane of my existence as a system administrator.
I see. I thank you for your vivid explanation. Suddenly, it occurred to me that If I were to make a new game in the future, what should I do to avoid these issues?
That would be amazing to do/seek. But because I'm still a newbie, how do I give a full folderpath with the driver letter index.html that you mentioned? (Sorry for being oblivious)
If you're on Windows, you right-click that file and select Properties. On that first screen that comes up, it's Location.

a) how do I make it 64 build of NWJS?
b) how do I update my game into a 4+ GB RAM minimum specs?
I think this is the wrong direction for you to be going in - you should always clearly diagnose the problem before trying to throw solutions at it. Otherwise, you may have problems from changing your NWJS and game applications and still have the random crashes you're experiencing now.

c) do these random crashes happen to most of RPG MV users or it's just a matter of how neat we write our events?
I have never had a random crash in dozens of hours of playtesting my game.

Suddenly, it occurred to me that If I were to make a new game in the future, what should I do to avoid these issues?
Again, logically, it's impossible to answer that question without knowing exactly what is causing it now.

It's like telling the mechanic, "My car doesn't work - how do I avoid my next car breaking down?" Well, it could be your battery, your spark plugs, you're out of gas, you have no tires...

Your only real option at this point is to troubleshoot. Play test until it crashes to see if you get an error. The only thing I see in your plugins that has anything to do with memory is the ImageCache, you could try turning that off to see if the crashes stop.
there are several ways this could be related to file- or foldernames, having the project and game stored in the wrong folders or with illegal letters in the names.

can you give us the full folderpath for both your project directory and where you stored your deployed game? Beginning with the drive letter and ending on the index.html of your game.
Hi, with the help of ATT_Turan above, I hope these are what you're requesting:
1) The location of my deployed game
help for crashes des 2022 3.png

2) My file directory
help for crashes des 2022 4.png

help for crashes des 2022 5.png


3) My project directory after beginning a project

help for crashes des 2022 6.png


(my "F" is named "F@z", could the "@" that I have for all these years be the reason of my crashing or that doesn't have anything to do with it?")
If you're on Windows, you right-click that file and select Properties. On that first screen that comes up, it's Location.


I think this is the wrong direction for you to be going in - you should always clearly diagnose the problem before trying to throw solutions at it. Otherwise, you may have problems from changing your NWJS and game applications and still have the random crashes you're experiencing now.


I have never had a random crash in dozens of hours of playtesting my game.


Again, logically, it's impossible to answer that question without knowing exactly what is causing it now.

It's like telling the mechanic, "My car doesn't work - how do I avoid my next car breaking down?" Well, it could be your battery, your spark plugs, you're out of gas, you have no tires...

Your only real option at this point is to troubleshoot. Play test until it crashes to see if you get an error. The only thing I see in your plugins that has anything to do with memory is the ImageCache, you could try turning that off to see if the crashes stop.
I thank you very much. This is very helpful as I am learning my way through. The ImageCache could be the one as the developer said something of it still being unstable in some parts. I will keep trying and put all your responses in my personal notes. Bless you,Sir.
it's more the name inside img/picure img/tileset etc with filenames
without spaces.

but if it crashes, you should see a error log to see them with %20 for spaces.
if it closes without any error log, than it could be harder to pinpoint what
the cause can be, as it can be the game, can be windows, can be ram/memory
or even deeper than that.

so to know the exact cause is to check and play test to see whats going on.
(my "F" is named "F@z", could the "@" that I have for all these years be the reason of my crashing or that doesn't have anything to do with it?")
No, the name of your drive is irrelevant. It's only displayed by Windows to you for your convenience.

Technically speaking, it's best to avoid spaces in your project name when you're deploying for other people (so Culture_Shock would be better). But if that were the cause of your problems, you should be crashing at predictable times, when the game is trying to load a specific file (and you should see an error for it).
No, the name of your drive is irrelevant. It's only displayed by Windows to you for your convenience.

Technically speaking, it's best to avoid spaces in your project name when you're deploying for other people (so Culture_Shock would be better). But if that were the cause of your problems, you should be crashing at predictable times, when the game is trying to load a specific file (and you should see an error for it).
I will definitely keep that in mind. Thank you so much for that reminder.
@ATT_Turan is correct, you shouldn't use my solution as a first resort. I called it a "workaround", because it is a last resort, when you can't fix the problem in any other way and need to work around it. Upgrading to nwjs-64 to fix an OutOfMemoryException is the equivalent to: "I'm using too much RAM, so I'll just throw more RAM at it". It might work, but it might also simply delay the problem (for example, instead of crashing after 20 minutes, your game might crash after 3 hours instead).

And that's only assuming your game really does consume too much RAM. If it doesn't, upgrading to 64 bit will be a waste of time, and there's a small risk it could break your game in various other ways. For all we know, the actual problem might be some other piece of software running on your system (I've seen my fair share of apps causing random problems with other unrelated apps, including crashes).
@ATT_Turan is correct, you shouldn't use my solution as a first resort. I called it a "workaround", because it is a last resort, when you can't fix the problem in any other way and need to work around it. Upgrading to nwjs-64 to fix an OutOfMemoryException is the equivalent to: "I'm using too much RAM, so I'll just throw more RAM at it". It might work, but it might also simply delay the problem (for example, instead of crashing after 20 minutes, your game might crash after 3 hours instead).

And that's only assuming your game really does consume too much RAM. If it doesn't, upgrading to 64 bit will be a waste of time, and there's a small risk it could break your game in various other ways. For all we know, the actual problem might be some other piece of software running on your system (I've seen my fair share of apps causing random problems with other unrelated apps, including crashes).
Reminds me of the time some developers had us keep adding memory to their database and eventually application servers to improve performance at a time when RAM was horrendously expensive (especially server RAM) and there were database servers in multiple states. Developers first instinct in many cases was to throw more RAM, then CPU's at a problem rather than look at a potential architecture/coding issue

Eventually someone in head office listened to us grunts and got an external consultant to do a code review - only because upgrading the RAM in the app and database servers was going to hit into a million or so dollars. Their application had no indexing (every time someone did a search it would start from the first record and work its way until it found the one it needed). Almost every field in the database was equivalent to a memo field (normally used for 'descriptions' or notes, not things such as a persons name.) After some significant changes and indexing introduced the performance was much better and memory usage was much better.

Then the only problem with that dodgy app was one of us sysadmins had to do a manual process for the re-index roughly once a month or the database could crash - initially had to be done on weekends because it would take anywhere up to 24 hours to complete. That was until one of us discovered through independent research of the underlying product that the application developers instructions were wrong. The re-indexing process was wasting cycles on unnecessary debug logging that the developers had included when they were working on the system. Vendor laughed when we explained the issue and said it shouldn't be used on a production system unless there was an issue with re-indexing. We removed the command from the process and the re-index would take under an hour.

Software conflicts are not fun to troubleshoot but is a possible avenue to follow given that their game just crashes. Nowadays it should happen less than in the days long past due to the memory protections put in place by modern OSes but it still does happen.
I turned off the "Galv_ImageCache" plugin but it still abruptly closed without a warning. After having thought of this for a while, could it be because I use 600 images constantly and simultaneously for dialogue purpose? For example, I create my characters' having 5 different images for their expressions, so I use their images on and off for every convo.

Example:
help for crashes des 2022 7.png

Could the way I write it be the reason why it crashes? When I looked at my memory while the game was being played, it reached 350-1.800MB, up and down.
Is there a reason you're using that method rather than a plugin? I'm not sure whether your images are large busts or the regular portraits, but both ways have plugins that will integrate it into your dialogue.

I would personally not think so, it's not like you're showing 600 pictures at a time so the number of images involved is irrelevant - that's like saying you have a hundred sound files in your BGM folder. But perhaps the engine caches more than is safe for itself if you're using a lot of those in one event/map.

If your RAM usage is getting up to 1,800 MB, it could easily be that you're crossing 2,000 and crashing. Large images are a definite possible cause of that - that's why I asked if you were using parallax maps in my first reply.
Is there a reason you're using that method rather than a plugin? I'm not sure whether your images are large busts or the regular portraits, but both ways have plugins that will integrate it into your dialogue.

I would personally not think so, it's not like you're showing 600 pictures at a time so the number of images involved is irrelevant - that's like saying you have a hundred sound files in your BGM folder. But perhaps the engine caches more than is safe for itself if you're using a lot of those in one event/map.

If your RAM usage is getting up to 1,800 MB, it could easily be that you're crossing 2,000 and crashing. Large images are a definite possible cause of that - that's why I asked if you were using parallax maps in my first reply.
I see. So this is all caused by the size of each PNG/image that I'm storing under "picture" folder, isn't it? Each of my images approximately weighs 1-2MB. But those are for "heavy cutscenes", the dialogue expression ones are 300-700KB each image. I don't use parallax, except for 3 out of 12 maps. (the 2 out of 3 parallax that im using are not accessible in the main gameplay due to them being a prolog scene)

Edit:
Oh, sorry, I haven't replied your first sentence question. I am now using a plugin that is simpler, but it still requires me to write down one by one. This plugin helps imagecache reduce flickering between image transitions. for example:
help for crashes des 2022 8.png

--My images are regular potraits. Is there a plugin where I can do it simpler but still maintaining integrity of each image by preloading their imagecache?-- (thank you in advance)

Original thread: https://forums.rpgmakerweb.com/threads/abrupt-crashes-what-have-i-been-doing-wrong.153428/