Stack overflow

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Retwulf
Posts: 2
Joined: Sat Mar 23, 2013 11:05 am

Stack overflow

Post by Retwulf »

Hi,

I'd like to try on creating my own dungeon, but have some issues regarding the installing process of the mods for new textures and other features.

I'm used to install mods for games like Skyrim, so I think I've got at least a few ideas about that matter. But still: when trying to open my custom dungeon where I've installed all the mods, I get a message saying: "could not open dungeon - stack overflow".

Well, though english is not my native language, I still have some idea of what it means. But regarding how works the software, I'm not sure to get it. So what's the problem? :roll:
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Stack overflow

Post by Neikun »

Most mods on the nexus have a readme.
Maybe you could pick one specific mod, and we'll try to walk you through an installation.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
Marble Mouth
Posts: 52
Joined: Sun Feb 10, 2013 12:46 am
Location: Dorchester, MA, USA

Re: Stack overflow

Post by Marble Mouth »

Hi Retwulf. I agree with Neikun that we could probably be more helpful with a more specific example.

FYI, stack overflow in lua most commonly occurs in "infinite" recursion scenarios, but not all "infinite" recursion results in stack overflow. Unfortunately, the deciding factor is a detail of the underlying lua implementation, so it might not make much sense to folks like us who just use lua as an embedded scripting language in another application (Grimrock.)

This code will generate a stack overflow error, which terminates the overflowing process and allows you to continue your session in the editor:

Code: Select all

overflow = function()
	local x = 12
	overflow()
	return x
end

overflow()
This code will not generate a stack overflow error, but it will run indefinitely without returning control to the editor. This generally requires me to open task manager to kill my editor session, losing all unsaved work:

Code: Select all

overflow = function()
	local x = 12
	return overflow()
end

overflow()
In both cases, calling overflow will call overflow will call overflow... The critical difference is that in the first code, lua has to keep track of local x while it calls overflow recursively. Each call to overflow has its own copy of local x in a piece of memory called "the stack", and eventually these copies fill up and overflow the (finite) stack. In the second code example, lua realizes that it doesn't have to keep track of x during the recursive call, so it doesn't. This is called "proper tail calling" in lua jargon.

In conclusion, a "stack overflow" error points to a very specific kind of bug in the mod you're trying to load. More details about the mod, and which version of Grimrock you're running could help. :)
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Stack overflow

Post by msyblade »

Couple of things to try, first, make sure you put the .dat file for a custom dungeon in the "Documents/Almost Human/Legend of Grimrock/dungeons" folder. 2nd Make sure you have patched to v1.3.7. most problems are caused by players not realizing they are running 1.3.1 and how many changes were made in the subsequent patches, specifically for modders. Features that ARE implemented in nearly every mod released since January. The .dat file that an entire custom dungeon is saved to and played from, is pretty much foolproof. If you have a .dat that you know other people are playing, but causes a stack overflow on your system, it is likely that you have the file placed in the wrong folder, or do not have the correct version of the game. (Again 1.3.7 is newest). Is it a dungeon you made? In that case it is likely you are not defining custom objects correctly, or in the right folder. Also, a simple capitalization error between a file and a definition can cause that error: script says altar.Model, but file is altar.model(lower case).If neither of these is causing your issue, we will need more specifics to help you, ie: No mods will work/Which mod are you having trouble with? where did you place the .dat file? What system are you running (GFX card etc.) you could also take a screenshot of the error (print screen key, goto paint, and paste (ctrl v), then save) and post it here, someone will definitely spot the issue causing trouble. Photobucket.com hosts pics for free, and u can use the "img" button on top of the typing box here, to paste the location of the pic.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Retwulf
Posts: 2
Joined: Sat Mar 23, 2013 11:05 am

Re: Stack overflow

Post by Retwulf »

Ok, I get it. I first thought I might have just too many mods installed for a single dungeon and that the engine might not be designed for sustaining that... :mrgreen: So that's not it (and that's a relief... with all these awesome mods around).

This is not a problem of version. I'm properly updated for that matter.

Yes, I've observed before that some of the files had capitals while not others. I fear I haven't corrected everything. I'll doublecheck that. I'll create a new file as well, and try to install each mod one by one and testing each one as well (sorry, but enthousiasm made me skip that). If the problem persists, I'll let you know as well as for which specific mod. Thanks!
Post Reply