Bay 12 Games Forum

Please login or register.

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

Author Topic: [0.34.11] [FPS Improvement] Deadly Magma Without Temperature  (Read 6423 times)

omega_dwarf

  • Bay Watcher
  • Adequate Architect, Dabbling Modder
    • View Profile
[0.34.11] [FPS Improvement] Deadly Magma Without Temperature
« on: August 08, 2014, 11:39:17 pm »

Death by cold magma

Endless temperature calculations and single threading are a bad mix. But magma's just too dwarfy to pass up! Could we make it deadly without the CPU-intensive temperature system?



Oh, yes we can.

Results:
  • A very dead miner. (No more cheaty benefits to disabling temperature, as long as you embark in a non-seasonally-freezing biome)
  • FPS (calculations per second) can DOUBLE in old forts - test the gain yourself before installing by switching TEMPERATURE:YES to :NO in d_init.txt
  • Lame items that the creatures were wearing still disintegrate, so automatic goblinite sorting is on the table
Created with major help from:
Meph (who may be integrating it into Accelerated DF!)
Roses
Deon
celem



Without further ado, here are the raws:

The interaction (copy & paste into any interaction_*.txt file in raw/objects, just below [OBJECT:INTERACTION])
Spoiler (click to show/hide)

And paste the following into every creature that you want to be affected by magma (read: invaders, hippies, and unwanted pets pests) just under their [CREATURE:*] tag in creature_*.txt:
Spoiler (click to show/hide)

Last step (don't forget!): Disable temperature in d_init.txt, or via the Lazy Newb Pack.



Note: Briefness of immersion time, unconsciousness, and preoccupation with swimming are all possible reasons that a creature won't die. They also may take a little while (on the order of seconds). But they will, in the end, be immolated.

~ Enjoy your faster game! ~



Original post:
Spoiler (click to show/hide)

scamtank

  • Bay Watcher
    • View Profile
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #1 on: August 09, 2014, 01:43:51 am »

Since lava is super-super-absolutely-hardcode-territory-no-way stuff, not without hacking tools at least.
Logged

omega_dwarf

  • Bay Watcher
  • Adequate Architect, Dabbling Modder
    • View Profile
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #2 on: August 09, 2014, 01:34:40 pm »

D:

Well, that's unfortunate it was inevitable. Scratch the previous two ideas off the list.

Is there any way to give creatures something akin to a severe lava allergy, then? If possible, it would leave the magma itself alone. Although I don't know what existing mechanic it would use.

So...maybe something with drowning instead? Make it so creatures can quickly drown in 1/7 lava? Or are drowning characteristics hardcoded as well?

Is there really no way to make it deadly? (Or...how hard would said hacking tools be to use?)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #3 on: August 09, 2014, 01:38:00 pm »

Yes, there is a way. There is a very specific tag for interactions:

Quote
IE_LOCATION   Within I_EFFECT   Location Hint   Indicates where the effect can take place. Valid values:
IN_WATER
IN_MAGMA

Give all creature a self-targetted suicide reaction, that can only be triggered if they stand in magma. Can be easily done with mass replacements, if you open all creature files. Then maybe go through the list and delete the interaction from magma-safe creatures.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

omega_dwarf

  • Bay Watcher
  • Adequate Architect, Dabbling Modder
    • View Profile
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #4 on: August 09, 2014, 01:54:03 pm »

Awesome! Thanks, Meph. I'll make sure to post about any successes as soon as I get it working. Idk how I missed that on the wiki :P

omega_dwarf

  • Bay Watcher
  • Adequate Architect, Dabbling Modder
    • View Profile
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #5 on: August 09, 2014, 07:00:26 pm »

Well...I'm stuck. And possibly confusing myself.

What would I put under [I_SOURCE] and [I_TARGET] for the interaction? I've been fiddling all afternoon, and can't seem to figure it out.

To see if my interaction worked (after a few hours of wiki research), I threw the [CAN_DO_INTERACTION:...] and [CDI:TARGET:SELF_ONLY] onto mountain goats. Mountain goats immersed in lava in the object testing arena were unhurt after being spawned with the interaction, and taking control and performing the action. So something's wrong. I hope it's in the source/target section.

This is what I have so far, in an interaction_mymagma.txt file in the object folder of the raws:
Spoiler (click to show/hide)

Sorry if I'm causing you modding experts a headache!

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #6 on: August 09, 2014, 07:13:12 pm »

Try these:

Code: [Select]
[INTERACTION:COLD_MAGMA_VULNERABILITY]
   [I_SOURCE:CREATURE_ACTION]
   [I_TARGET:A:CREATURE]
[IT_CANNOT_TARGET_IF_ALREADY_AFFECTED]
[IT_CANNOT_HAVE_SYNDROME_CLASS:COLD_MAGMA_VULNERABILITY]
   [IT_LOCATION:CONTEXT_CREATURE]
   [I_EFFECT:ADD_SYNDROME]
[IE_TARGET:A]
[IE_IMMEDIATE]
      [IE_LOCATION:IN_MAGMA]
[SYNDROME][SYN_CLASS:COLD_MAGMA_VULNERABILITY]
         [CE_BLEEDING:SEV:5000:PROB:100:START:0:END:100000]
         [CE_IMPAIR_FUNCTION:SEV:100:PROB:100:LOCALIZED:START:10]
         [CE_PAIN:SEV:5000:PROB:100:LOCALIZED:START:1:END:100000]

on the goat:
Code: [Select]
[CAN_DO_INTERACTION:COLD_MAGMA_VULNERABILITY]
      [CDI:VERB:dies in the magma:dies in the magma:NA]
      [CDI:TARGET:A:SELF_ONLY]
      [CDI:WAIT_PERIOD:100]
      [CDI:FREE_ACTION]
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

omega_dwarf

  • Bay Watcher
  • Adequate Architect, Dabbling Modder
    • View Profile
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #7 on: August 09, 2014, 08:24:24 pm »

Still stubbornly refusing to get hurt, whether (gently) dropped in or spawned inside the lava :/

Does [CAN_DO_INTERACTION:...] imply that the creature will do the action of its own volition?

celem

  • Bay Watcher
    • View Profile
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #8 on: August 10, 2014, 05:08:58 am »

Controlling when and how a creature uses an interaction is usually done through the usage hint tag.  For instance theres an ATTACK usage hint that tells them its for smiting bad guys.

If what Meph posted is not working then heres a thought I absoloutely haven't tried.  Theres a USAGE_HINT:CLEAN_SELF.  It might be its just intended for whatever mechanic vanilla cleaning uses.  But the description on the wiki suggests it might validate to true for a creature in magma.  Find an example of another usage hint somewhere in an interaction from vanilla raws and see where it goes, then stick it into Mephs code and pray.

With no hint like he wrote it, it should run all the time theres a valid target, and the only target is the goat.  so Mephs version should keep checking all the time, but fail to run because its not in lava, then poof, one day it is and goat is dead.  I dont see whats wrong with his version.


edit: oh are you testing in arena?  It needs an extra tag to be usable there i think...lemme see.  Under I_EFFECT goes IE_ARENA_NAME:sometext if I read the wiki right.
« Last Edit: August 10, 2014, 05:21:51 am by celem »
Logged
Marksdwarf Pillboxes
I wish I had something cool to say about this.  Because it's really cool.

omega_dwarf

  • Bay Watcher
  • Adequate Architect, Dabbling Modder
    • View Profile
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #9 on: August 10, 2014, 10:31:33 am »

Ahh, the usage hints. That's what I was thinking of, but none seemed to fit well...CLEAN_SELF could make sense, though. I'll try it!

I had an [IE_ARENA_NAME:...] in my first (very noob-ish) version of the code, which Meph removed. I didn't want to mess with his code afterwards :P . I think, from what I could tell, that IE_ARENA_NAME only grants you the ability to spawn a creature with that effect applied. But it's certainly possible that it also has some other effects. I'll add one back in after I do the USAGE_HINT.

Thanks for the solid explanations! The system makes a lot more sense now.

Will edit with results.

---

Edit:

Unfortunately, Armok did not hear our prayers. Maybe I should go into DF and make a sacrifice? With temperature on, of course.

I was going to try IS_USAGE_HINT as well, but then realized it was only for I_SOURCE:DEITY. Will continue to look for things on the Wiki.

omega_dwarf

  • Bay Watcher
  • Adequate Architect, Dabbling Modder
    • View Profile
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #10 on: August 10, 2014, 02:42:41 pm »

Even if I remove the [IE_LOCATION:IN_MAGMA] token, and the usage hint, the goats are never affected. What am I doing wrong? Is there some step I'm missing?

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #11 on: August 10, 2014, 02:44:17 pm »

Do you generate a new world each time?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

omega_dwarf

  • Bay Watcher
  • Adequate Architect, Dabbling Modder
    • View Profile
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #12 on: August 10, 2014, 02:59:22 pm »

I'm using the object testing arena. I thought it used the updated raws, guaranteed?

Edit: Also, things do change when I modify the raws. Adding or removing the arena and adventure mode names takes effect immediately. And it's not completely ignoring the CAN_DO_INTERACTION: the text in the verb section is being displayed when I manually trigger the interaction in adventure mode. The interaction just doesn't seem to be taking effect.

Edit 2: Removing or adding IE_LOCATION:IN_MAGMA does have the predicted effect. So is it something with the syndrome that's just not working?

Edit 3: I don't think it's the syndrome. It looks to have the exact same structure as the werecurse example (raw/interaction examples/interaction_werebeast.txt). I can only think that it might be the targeting.

Edit 4: Tried it on a clean install of dwarf fortress. No change.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #13 on: August 10, 2014, 04:03:06 pm »

It might be that the AI doesnt use interactions, because the creature is busy swimming. Try 1-2-3/7 magma, but nothing above. A usage hint is not required, they use it as soon as they can if they have none.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

omega_dwarf

  • Bay Watcher
  • Adequate Architect, Dabbling Modder
    • View Profile
Re: [0.34.11] Deadly Magma Without Temperature?
« Reply #14 on: August 10, 2014, 04:31:30 pm »

Good idea! But...unfortunately, no dice. No matter what depth, the goats don't get hurt.

What strikes me as bizarre is that even when I take control of one of them, in the magma, and use my new "natural ability", nothing happens!

Edit: At least they are doing the interaction automatically now, for sure. Or, at least they're doing the bit under [CAN_DO_INTERACTION:...]. The "dies in lava" text is always at the top of the combat reports when I spawn them in lava.
Pages: [1] 2