Frequent Crash on Saving Game in Mod

Have trouble running Legend of Grimrock 2 or do you have questions about the purchasing options? Look for help here.
Post Reply
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Frequent Crash on Saving Game in Mod

Post 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?
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Frequent Crash on Saving Game in Mod

Post 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.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
Dr.Disaster
Posts: 2874
Joined: Wed Aug 15, 2012 11:48 am

Re: Frequent Crash on Saving Game in Mod

Post 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.
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Frequent Crash on Saving Game in Mod

Post 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.
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: Frequent Crash on Saving Game in Mod

Post 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.
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Frequent Crash on Saving Game in Mod

Post by David Ward »

Sounds right, Drakkan. I appreciate the input, thank you.
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: Frequent Crash on Saving Game in Mod

Post 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".
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply