Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Worldgen Crashes  (Read 2452 times)

MDFification

  • Bay Watcher
  • Hammerer at Law
    • View Profile
Worldgen Crashes
« on: December 15, 2013, 01:30:30 pm »

So, my worldgen has started crashing repeatedly while trying to place civilizations. Nothing appears in the errorlog that should affect this (one creature uses the wrong tissue for a body part, but this has never affected anything before).
I did recently add a new civ. I took it out of entity_default to see if this prevented the world from crashing. No such luck.

The few times it has worked have been on small worlds with minimal amounts of civs. Large worlds with many civs crashes the game, as does pocket worlds with minimal civs. Is this behaviour caused by trying to generate more civs than there is room for on the map?
« Last Edit: December 17, 2013, 09:48:48 am by MDFification »
Logged

4maskwolf

  • Bay Watcher
  • 4mask always angle, do figure theirs!
    • View Profile
Re: Worldgen Crashes
« Reply #1 on: December 15, 2013, 01:47:17 pm »

I had a similar problem with arena mode, which was caused by a creature calling a non-existent tissue type. Check to make sure that everything you call is legal.

Basically, I forgot that tissue material and tissue called two different templates in two different places, so when I tried to start up arena mode it crashed because my fire in were calling a nonexistent tissue template. If the game tries to place even one creature of that type in world gen, it will crash.

Hope that helps
« Last Edit: December 15, 2013, 01:51:32 pm by 4maskwolf »
Logged

scamtank

  • Bay Watcher
    • View Profile
Re: Worldgen Crashes
« Reply #2 on: December 15, 2013, 04:07:40 pm »

I had a horrible run-in of worldgen crashing during cave placement when I was screwing with forgotten beasts. I'm guessing your civilization creatures are fucked somehow.
Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: Worldgen Crashes
« Reply #3 on: December 15, 2013, 05:11:34 pm »

Is there anything odd or special about the civ that causes the crashes? Perhaps mortal aquatic? Special interactions?
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

MDFification

  • Bay Watcher
  • Hammerer at Law
    • View Profile
Re: Worldgen Crashes
« Reply #4 on: December 15, 2013, 07:10:02 pm »

Is there anything odd or special about the civ that causes the crashes? Perhaps mortal aquatic? Special interactions?

It's a civ of fliers. I looked, but I haven't found any reports of flying civs being unable to spawn. I did however add an interaction to the dwarven civ at the same time, so I'll remove that and see if it helps.
The weird thing is that the errorlog is empty. Incorrect reactions/typos/references should show up in the errorlog. However, the game just crashes. I've crashed my game plenty of times (doing exactly what you described, 4maskwolf) but the errorlog has always updated itself.

EDIT: Removing the reaction did not stop the program from crashing. I'm going to copy my raws and reinstall in case of file corruption.
« Last Edit: December 15, 2013, 07:34:50 pm by MDFification »
Logged

MDFification

  • Bay Watcher
  • Hammerer at Law
    • View Profile
Re: Worldgen Crashes
« Reply #5 on: December 16, 2013, 09:16:02 am »

Redownloaded DF, copied my raws into the new version. Still experiencing the same issue.

No errors show, worlgen just crashes while placing civs. I have no explanation, as my civ folder is unchanged from a version that worked. I'm going to try reducing the amount of civs I have in the folder and see if that helps.
Logged

Nahere

  • Bay Watcher
    • View Profile
Re: Worldgen Crashes
« Reply #6 on: December 16, 2013, 08:32:57 pm »

I've seen something similar to this before. Hopefully this helps:
This will be a useful tactic for future modders.

DF doesn't tend to shut down when it encounters an error, it simply keeps trying to run until it crashes and burns.  If something throws the parser out of whack, it'll keep going on its merry way, even if that means it'll start sticking materials and creatures where they shouldn't go, leading to the weirdness that happens due to duplicate raws.  I figured whatever the bug was here, it must be related somehow to this phenomenon: something that isn't listed among the illegal operations but throws the parser out of place so you get invincible bandits if you're lucky and crashes if you're not.

So I got a new idea: Instead of playing hit-or-miss and trying to find a pattern for how stable the game was, try to figure out how the game was loading the raws.  How?  Simple: deliberately introduce errors into the files and read the order they show up in the error log.  Turns out the game always loads the raws in the same order: inorganics, plants, tools, creatures, civs, and interactions, and within a type, it loads them in the order the files are arranged (alphabetically).

I couldn't figure out what was making the difference between whether the game loaded or crashed, but I did find that when it crashed, the error logs always stopped at the same creature group, no matter where they were placed.
Logged

MDFification

  • Bay Watcher
  • Hammerer at Law
    • View Profile
Re: Worldgen Crashes
« Reply #7 on: December 16, 2013, 08:54:38 pm »

I've seen something similar to this before. Hopefully this helps:
This will be a useful tactic for future modders.

DF doesn't tend to shut down when it encounters an error, it simply keeps trying to run until it crashes and burns.  If something throws the parser out of whack, it'll keep going on its merry way, even if that means it'll start sticking materials and creatures where they shouldn't go, leading to the weirdness that happens due to duplicate raws.  I figured whatever the bug was here, it must be related somehow to this phenomenon: something that isn't listed among the illegal operations but throws the parser out of place so you get invincible bandits if you're lucky and crashes if you're not.

So I got a new idea: Instead of playing hit-or-miss and trying to find a pattern for how stable the game was, try to figure out how the game was loading the raws.  How?  Simple: deliberately introduce errors into the files and read the order they show up in the error log.  Turns out the game always loads the raws in the same order: inorganics, plants, tools, creatures, civs, and interactions, and within a type, it loads them in the order the files are arranged (alphabetically).

I couldn't figure out what was making the difference between whether the game loaded or crashed, but I did find that when it crashed, the error logs always stopped at the same creature group, no matter where they were placed.

That's actually a really great idea. Thanks for bringing it to my attention, I must have missed that while searching. I'll test this out tomorrow.

EDIT: Testing confirms that the error is not located in entity_default, which should indicate that it's not in any file read before that. My custom reactions are apparently read after the error, as errors within that file do not show up. Removing the reaction file and references to it does not prevent the crashing, so I can presume the error is elsewhere.
The weird thing is that the errorlog still records all errors place in my interactions - so the game has managed to read that far before the crash. I guess I'll have to be more thorough and place errors throughout the whole thing. *sigh*

EDIT2: There are two particular reaction files that don't report errors to the errorlog - my custom ones and reaction_smelter. Guess which of the two is probably broken.
For whatever reason changes I've made mean that worldgen commonly gets to year 2 before crashing now, which seems to fit the theory of my reactions being in error perfectly.
« Last Edit: December 17, 2013, 09:43:43 am by MDFification »
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Worldgen Crashes
« Reply #8 on: December 18, 2013, 04:42:44 am »

Nahere, that is a perfect info. Thank you.

MDFication, I found myself in your position a few times where a perfectly fine mod had terrible worldgen crash issues. Sometimes it even made me restart the mod from scratch (Genesis Reborn). I know how frustrating it is, so I wish you strength to pull through it and solve it one way or another.

So is it possible that your reactions do it? Could I take a look at your "problem" files? Maybe others and me could try to brainstorm it together to reduce your stress and save your time.

P.S. Don't forget that there're small things which make the game crash which you do not expect. For example, there must be at least one plant type with LEAVES, otherwise worldgen crashes may happen. It used to be like that in 40d at least, not sure about now.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

MDFification

  • Bay Watcher
  • Hammerer at Law
    • View Profile
Re: Worldgen Crashes
« Reply #9 on: December 18, 2013, 08:24:24 am »

Nahere, that is a perfect info. Thank you.

MDFication, I found myself in your position a few times where a perfectly fine mod had terrible worldgen crash issues. Sometimes it even made me restart the mod from scratch (Genesis Reborn). I know how frustrating it is, so I wish you strength to pull through it and solve it one way or another.

So is it possible that your reactions do it? Could I take a look at your "problem" files? Maybe others and me could try to brainstorm it together to reduce your stress and save your time.

P.S. Don't forget that there're small things which make the game crash which you do not expect. For example, there must be at least one plant type with LEAVES, otherwise worldgen crashes may happen. It used to be like that in 40d at least, not sure about now.

Sure, go right ahead. I'm not really that stressed right now b/c I've been taking the time to write out the lore/map our how I want to do future releases, but it is a little perplexing.

The bug is probably in here (b/c my reactions_smelters shouldn't be any different than vanilla) but when I remove this file from the game it still crashes.  :-\

Spoiler (click to show/hide)

I'm assuming the problem is in the blood cooking b/c that's the sketchiest reaction I've written so far.
EDIT: There might be errors elsewhere, but I can't find them. All files read correctly but these two (and I assume that reactions_smelter reads after reactions_freehold, since my smelter reactions are unchanged from vanilla) but not including these reactions still causes the game to crash in a similar manner. Further testing is underway.
« Last Edit: December 18, 2013, 09:20:04 am by MDFification »
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Worldgen Crashes
« Reply #10 on: December 18, 2013, 09:45:24 am »

I've never used inorganic LIQUID_MISC to replace blood (I extracted REAL blood), why do you do it?

Otherwise reactions look fine. The only issue I see is that the CREAMATE_BODY_PART_FURNACE has A in CREAMATE (same for magma version) and takes place in wood furnace while all others take place in SMELTER/MAGMA_SMELTER.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

MDFification

  • Bay Watcher
  • Hammerer at Law
    • View Profile
Re: Worldgen Crashes
« Reply #11 on: December 18, 2013, 09:54:59 am »

I've never used inorganic LIQUID_MISC to replace blood (I extracted REAL blood), why do you do it?

Otherwise reactions look fine. The only issue I see is that the CREAMATE_BODY_PART_FURNACE has A in CREAMATE (same for magma version) and takes place in wood furnace while all others take place in SMELTER/MAGMA_SMELTER.

I'm not sure if it works, but I think using LIQUID_MISK lets me extract "blood" from corpses that can be cooked while also being able to cook blood gotten from the caravans in a single reaction. That's just speculation though, it might not be necessary.
I should move the reactions from the smelter to the furnace and magma smelter. Smelters already have so many reactions in them. If it was possible for there to be a magma powered furnace, I'd probably put them there.
As for the spelling, maybe I'm just trying to burn body parts until they turn into cream.  :o

Ty, will implement fixes.

EDIT: There was incorrect referenced to the file (based on the use of creamate instead of cremate) but the game still crashed when these were fixed. I guess the bugs just never showed up in the errorlog because the game crashed before it loaded them?
I'm thinking that redoing the mod is a good idea in general, so I might do that.
The game seems to crash anywhere between starting to place civs and the first year of worldgen history consistently. I have seen one world successfully generate, but that only had dwarfs in it. Since errors in the civ files are still reported, this leads me to believe the error's somewhere in the civ file (but not in ENTITY:MOUNTAIN) and the game just ignores the error until it causes a game crash later on.
If the game doesn't crash at the time the bug occurs but crashes later in the load, then it could be a creature file too. There's currently no reported errors in the creature files, and arena mode works fine. I do have a mysterious error where one species shows up twice on the list (and errors in that species file show up twice too) despite there only being one raw entry for that species. Mysterious.
« Last Edit: December 18, 2013, 10:03:09 am by MDFification »
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Worldgen Crashes
« Reply #12 on: December 18, 2013, 11:37:05 am »

Oh man, I had some crashes from a custom creature and I never found a reason.
Try splitting custom creatures into separate files and removing one or another and testing worldgen.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

MDFification

  • Bay Watcher
  • Hammerer at Law
    • View Profile
Re: Worldgen Crashes
« Reply #13 on: December 18, 2013, 03:56:31 pm »

Oh man, I had some crashes from a custom creature and I never found a reason.
Try splitting custom creatures into separate files and removing one or another and testing worldgen.

I initially had another file with all my custom creatures, actually. I merged them back in for a reason I can't really remember.
I'll try this out.

EDIT: Just curious, but did your creature that was causing the crashes cause crashes or display anomalous properties in arena mode? Other than the twice-listed thing mine don't.
« Last Edit: December 18, 2013, 04:40:03 pm by MDFification »
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Worldgen Crashes
« Reply #14 on: December 18, 2013, 05:15:38 pm »

Nope, it was perfectly fine. I have no idea why it happened. Maybe some hidden symbol in .txt file which broke the parser? Later I remade a creature just like that and it was working.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository
Pages: [1] 2