Page 1 of 1

Frequent Crash on Saving Game in Mod

Posted: Sun May 03, 2015 8:39 am
by David Ward
I notice that my exported mod frequently crashes if I try to save my game while I'm playing it. My thought was that my computer may be running out of memory and saving a game might tip it over the edge and force LOG2 to crash, but I'm not savvy enough to verify that sort of assessment.

Might there be something typical in code, something that I may have added to one of the .lua files, that could be causing something like this? I know it's a very general inquiry but if there is something that might cause that, then it can be fixed, or the code removed...as opposed to buying a new comp. Any thoughts?

Re: Frequent Crash on Saving Game in Mod

Posted: Sun May 03, 2015 9:28 am
by minmay
What does the error message say? If you don't see an error message, run the game from the command line. If you run out of memory, you'll be informed of it.
Remember Grimrock is a 32-bit application and Windows reserves half the virtual address space for itself, so regardless of how much physical memory/swap you have, the game can't possibly claim more than 2 GiB of memory (and will run out of available contiguous blocks long before reaching that number). So don't load ridiculous amounts of texture data etc.

I go over the easy ways for modders to screw up saving here.

Re: Frequent Crash on Saving Game in Mod

Posted: Sun May 03, 2015 1:01 pm
by Dr.Disaster
Start your mod from the custom dungeon menu or a save game, then check with windows Task Manager on your mod's memory usage. When "grimrock2.exe" is listed with 1,5xx,xxx Kbytes or more chances are rather high that you will run out of memory during play. Attempts to save the game may start to fail at 1,65x,xxx Kbytes and up, yet it might not show as "out of memory" but as vc++ runtime error.

In case the memory usage causes your problem there is
- one way to prevent it: by removing (not needed) assets.
- one way to work around it: run the game with reduced texture setting i.e. Medium instead of High.

Re: Frequent Crash on Saving Game in Mod

Posted: Sun May 03, 2015 7:57 pm
by David Ward
Thank you both for the info. There are options, I will try them.

minmay - When the game crashes, it just gives the standard pop-up "grimrock2.exe has stopped working" with the "close program" button. Nothing more.

Re: Frequent Crash on Saving Game in Mod

Posted: Mon May 04, 2015 1:08 pm
by Drakkan
David Ward wrote:Thank you both for the info. There are options, I will try them.

minmay - When the game crashes, it just gives the standard pop-up "grimrock2.exe has stopped working" with the "close program" button. Nothing more.
this is standard behavior when out of memory. It was confirmed by more people around. It could be "prevented" a little by removing unused textures, monsters etc from standard assets. or removing unused thing overall. Still - as your dungeon will grow you will hit this cap in future anyway. From my view this is clear log limitation. Something you should count with. Best way so far is to play / edit with medium texture setting.

Re: Frequent Crash on Saving Game in Mod

Posted: Mon May 04, 2015 7:45 pm
by David Ward
Sounds right, Drakkan. I appreciate the input, thank you.

Re: Frequent Crash on Saving Game in Mod

Posted: Mon May 04, 2015 9:18 pm
by minmay
David Ward wrote:minmay - When the game crashes, it just gives the standard pop-up "grimrock2.exe has stopped working" with the "close program" button. Nothing more.
This tells you absolutely nothing. Run. From. The. Command. Line. Otherwise the answers you get here will be absolutely useless, like the previous answer.
Start -> All Progams -> Accessories -> Command Prompt
Use

Code: Select all

cd
to print the current directory.
Use

Code: Select all

cd [directory]
to navigate to another directory.
When in grimrock2.exe's directory, you can just use

Code: Select all

grimrock2.exe
to run it. When the game crashes, look at the command prompt to learn why.
Drakkan wrote:this is standard behavior when out of memory. It was confirmed by more people around. It could be "prevented" a little by removing unused textures, monsters etc from standard assets. or removing unused thing overall. Still - as your dungeon will grow you will hit this cap in future anyway. From my view this is clear log limitation. Something you should count with. Best way so far is to play / edit with medium texture setting.
This is not a limitation for any sane mod. You'll run 1GiB video cards out of memory before you run the game out of virtual memory. The whole asset pack is under 600 MiB, you have to make a ridiculously bloated mod with tons of unnecessary textures in order to get near the point where running out of address space becomes a problem, and if it weren't you'd still be screwing over everyone who bought the game expecting the recommended system requirements to be correct. I know a couple people have chosen to do this but I wouldn't assume the OP has when we have literally no information other than "the game crashes when I save".