Bay 12 Games Forum

Please login or register.

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

Author Topic: Debugging interactions  (Read 1574 times)

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #15 on: January 27, 2013, 04:55:15 pm »

I think I finally figured out how to avoid the crash, which is less than ideal.  I'll put it here for others to see just in case someone else has similar problems and finds this thread.

I had two megabeasts with a smattering of incapacitating interactions.  The game crashed consistently during worldgen when either of these two megabeasts were present.  Deleting the creature file fixed the problem.  If I deleted one, sometimes it would make it a long way through worldgen, but it always crashed within 150 or so years.  Having both present made it usually crash before year 20.

I couldn't find anything remotely wrong with their raws, so I tried removing the interactions, and lo and behold it works now.  I tried again with a varying number of these interactions, and it appears that the more you have, the more likely DF is to crash early in worldgen.

I'm guessing that there is a bug during history generation that causes the game to barf if a creature uses these interactions in worldgen combat.  Possibly only if someone is killed by such an attack.  My guess is that the game is generating a handful of these megabeasts during worldgen, and the more of them there are and the more of these interactions each has, the more likely the bug is to come up.

So I just removed the interactions during worldgen and put them back in afterward.  It's a big pain, but it works at least.

Maybe it's somehow related to the interactions themselves and maybe I have a bug in them, but since they work perfectly fine in the arena I'm skeptical that this is the problem.
Logged
Through pain, I find wisdom.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Debugging interactions
« Reply #16 on: January 27, 2013, 04:57:33 pm »

AFAIK, creatures shouldn't be using attack interactions in worldgen at all O_o

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #17 on: January 27, 2013, 08:50:13 pm »

Not directly, but doesn't DF simulate combat during worldgen?  I've always been under the impression that it did this more or less like in the actual game, but always 1-on-1.  If that's the case, then the interactions with a usage hint of ATTACK could theoretically be used in these battles.

In either case, I'm not entirely satisfied with that explanation, because I'm sure people mod in creatures with interactions all of the time and I've seen very little if any supporting evidence that this is a problem.  Perhaps it only applies to megabeasts for some reason?

The problems absolutely go away when I take the interactions off of the creatures though, and cause no problems when actually used in game.
Logged
Through pain, I find wisdom.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Debugging interactions
« Reply #18 on: January 27, 2013, 08:54:18 pm »

Worldgen battles are way different. If it actually simulated them, my literally unkillable creatures wouldn't die so easily.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #19 on: January 28, 2013, 12:15:45 am »

Interesting... well, I figured they were simplified, but didn't realize it was that different from actual combats.

Anyway, I've got a problem with my regional interaction now.  I set up the interaction like so:

Code: [Select]
[INTERACTION:DISCORDIFY]
[I_SOURCE:REGION]
[IS_REGION:EVIL_ONLY]
[IS_REGION:SAVAGE_ALLOWED]
[IS_REGION:ANY_TERRAIN]
[IS_FREQUENCY:100]
[I_TARGET:A:MATERIAL]
[IT_MATERIAL:MATERIAL:INORGANIC:DISCORDANT_MAGIC:WEATHER_CREEPING_GAS]
[I_EFFECT:MATERIAL_EMISSION]
[IE_TARGET:A]
[IE_INTERMITTENT:WEEKLY]

And the material like so:

Code: [Select]
[INORGANIC:DISCORDANT_MAGIC]
[USE_MATERIAL_TEMPLATE:METAL_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:discordant magic]
[STATE_NAME_ADJ:LIQUID:discordant magic]
[STATE_NAME_ADJ:GAS:discordant magic]
[DISPLAY_COLOR:0:7:1]
[BUILD_COLOR:0:7:1]
[MATERIAL_VALUE:10]
[SPEC_HEAT:450]
[MELTING_POINT:10]
[BOILING_POINT:20]
[SOLID_DENSITY:7850]
[LIQUID_DENSITY:6980]
[MOLAR_MASS:55845]
[IMPACT_YIELD:542500] Was 1080000, but just using 3.5x tensile multiples for everything until better numbers are available, which might not be likely
[IMPACT_FRACTURE:1085000]
[IMPACT_STRAIN_AT_YIELD:319]
[COMPRESSIVE_YIELD:542500]
[COMPRESSIVE_FRACTURE:1085000]
[COMPRESSIVE_STRAIN_AT_YIELD:319] bulk modulus 170 GPa
[TENSILE_YIELD:155000]
[TENSILE_FRACTURE:310000]
[TENSILE_STRAIN_AT_YIELD:73] young's modulus 211 GPa
[TORSION_YIELD:155000]
[TORSION_FRACTURE:310000]
[TORSION_STRAIN_AT_YIELD:189]
[SHEAR_YIELD:155000]
[SHEAR_FRACTURE:310000]
[SHEAR_STRAIN_AT_YIELD:189] shear modulus 82 GPa
[BENDING_YIELD:155000]
[BENDING_FRACTURE:310000]
[BENDING_STRAIN_AT_YIELD:73]
[MAX_EDGE:10000]
[SYNDROME]
[SYN_NAME:discordant corruption]
[SYN_AFFECTED_CLASS:GENERAL_POISON]
[SYN_CONTACT]
[CE_ADD_TAG:NOT_LIVING:OPPOSED_TO_LIFE:START:0]

I think I just copied the iron material since I intended to use this for multiple things, but ended up only using it for this material cloud.  The only changes I made were altering the name, setting it to boil at room temperature (20 urists), and adding the syndrome above.

The idea is that the syndrome is supposed to just make whoever is in contact with the material cloud attack anything that's not undead.  I removed the undead regional interactions, so in theory they should attack anything but each other.

However, nothing happens.  I had the cloud drift over 20 people and not a thing happened.  I don't have any errors in the error log.  I'm guessing I've either broken the syndrom syntax, or the fact that it's contact based or boiling at room temperature are the culprits.  I also hope this can be changed without a regen.

Thanks for all the help so far by the way.
Logged
Through pain, I find wisdom.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Debugging interactions
« Reply #20 on: January 28, 2013, 12:22:15 am »

You want it to be INHALED, not CONTACT.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #21 on: January 28, 2013, 01:01:55 am »

Ok, thanks, that worked.  Out of curiosity, is there a particular reason for that?  I didn't see any contaminants on the victim's clothing, so does CONTACT just not work for this, or in this case is it just evaporating away instantly and not doing any harm?

Now I just have to wonder how 6 of my workshops randomly vanished when I reloaded the game.  ???
Logged
Through pain, I find wisdom.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Debugging interactions
« Reply #22 on: January 28, 2013, 01:05:50 am »

CONTACT doesn't work because you don't contact gasses. You do contact vapors, though.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Debugging interactions
« Reply #23 on: January 28, 2013, 01:36:18 am »

Oh, okay, that makes sense.  I'd argue semantics here, but I'm already considering a boiling cloud of metal to be magic so semantics went out the window a long time ago.

I had a few of my citizens become opposed to life after the cloud drifted through, so I'm happy with that.  Some appear to flee even after being transformed, but I think I can fix that much.

Will an ending timer for the CE_ADD_TAG bit actually work?  I suspect that even if I remove the tags that way, those unfortunate enough to get caught in the gas will either cause a loyalty cascade or continue to be hated by my citizens though...
Logged
Through pain, I find wisdom.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Debugging interactions
« Reply #24 on: January 28, 2013, 01:37:42 am »

Yeah, it'll work.
Pages: 1 [2]