Bay 12 Games Forum
Dwarf Fortress => DF Modding => Topic started by: squamous on April 29, 2021, 09:57:15 pm
-
https://dffd.bay12games.com/file.php?id=14292
So I have a mod that turns DF into kenshi, had it for awhile. It's also been consistently plagued by a CTD which was inconsistent and I could never really pinpoint. However, I have recently through pure coincidence managed to isolate what I think is the source of the crash.
To test it for yourself, simply go to the arena and spawn scorchlander, greenlander, shek, or cannibal NPCs. continue to spawn them, maybe a dozen times or more. Eventually, it WILL result in a CTD. I honestly have no clue why this is happening, I have never experienced a bug like this before and I am at a total loss. I am also sure its an entirely inconsequential goof on my part that'll make me look like an idiot when it's pointed out to me but I really just would like any pointers towards a solution.
-
I've been slowly mulling this over / investigating and I think I might have a guess. The two noteworthy things to mention are that:
- They work fine when alongside the vanilla raws
- Their ability to learn is what's causing the problems (other can learn creatures like bogeymen also experience the crashes). Remove that, and they work just fine.
Following on from that, the only randomised things that intelligent creatures get over unintelligent creatures are values, needs, and preferences. I wonder if there are some hardcoded assumptions about certain material forms/types always being present, with the crash being caused when the game attempts to assign a preference of that sort that the mod is lacking. It would explain why adding in vanilla raws helps (they add the missing elements), why it only crashes with can learn creatures (they're the only ones that get preferences), and only randomly (only a % chance of getting particular sorts of preferences).
I don't really have the inclination to sift through the entire mod to check that everything's in order, so I can't really test to see if this is definitely the cause or not. You're likely to be much more knowledgeable about what's in the mod, anyways :P. You can see a list of all the sorts of preferences on the wiki (https://dwarffortresswiki.org/index.php/DF2014:Preferences) if you want to investigate.
-
I've been slowly mulling this over / investigating and I think I might have a guess. The two noteworthy things to mention are that:
- They work fine when alongside the vanilla raws
- Their ability to learn is what's causing the problems (other can learn creatures like bogeymen also experience the crashes). Remove that, and they work just fine.
Following on from that, the only randomised things that intelligent creatures get over unintelligent creatures are values, needs, and preferences. I wonder if there are some hardcoded assumptions about certain material forms/types always being present, with the crash being caused when the game attempts to assign a preference of that sort that the mod is lacking. It would explain why adding in vanilla raws helps (they add the missing elements), why it only crashes with can learn creatures (they're the only ones that get preferences), and only randomly (only a % chance of getting particular sorts of preferences).
I don't really have the inclination to sift through the entire mod to check that everything's in order, so I can't really test to see if this is definitely the cause or not. You're likely to be much more knowledgeable about what's in the mod, anyways :P. You can see a list of all the sorts of preferences on the wiki (https://dwarffortresswiki.org/index.php/DF2014:Preferences) if you want to investigate.
That's insanely weird, but I'll start checking it out thanks.
-
I have solved this issue.
Essentially, a mod needs to have all the different types of items which a CAN_LEARN race can prefer. In my case, the mod didn't have any shields at all, so the game crashed when spawning someone who was supposed to like shields, this is hardcoded apparently. So, now shields exist in the mod, but won't be used. This will prevent the crashes I hope.
-
so new tip for modders: make things that might not even be in the setting, just because DF might flip out if it's missing something?
-
so new tip for modders: make things that might not even be in the setting, just because DF might flip out if it's missing something?
So it would seem.