ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Wed Jun 20, 2018 7:23 pm

All times are UTC




Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sat Mar 26, 2016 11:49 pm 
Offline
Wyrmic

Joined: Thu May 23, 2013 12:25 am
Posts: 244
In addition, we saw the base NPC triggering the 19 Furnance Vents, none ones that said "NPC-name's temporal clone", which is normal.

_________________
Please help with the ToME wiki!


Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 1:08 am 
Offline
Yeek

Joined: Tue Mar 15, 2016 9:38 am
Posts: 14
I'm pretty sure I know what's causing it, and it doesn't have anything to do with clones specifically. Looking at this part:
Code:
      if mp and mp.stacks >= 10 and self:isTalentActive(self.T_MELTING_POINT) and self:getSteam() > 15 then
         self:callTalent(self.T_MELTING_POINT, "cleanActor") -- remove physical effect, remove 15 steam
         self:forceUseTalent(self.T_FURNACE_VENT, {ignore_energy=true, force_target={x=src.x, y=src.y}}) [NEIGH]
         self:removeEffect(self.EFF_FURNACE_MOLTEN_POINT, true, true)
      end

      if not self.turn_procs.molten_metal then self:setEffect(self.EFF_FURNACE_MOLTEN_POINT, 1, {}) end
      self.turn_procs.molten_metal = true


What's happening is that when one actor's vent triggers another actor's vent (most likely to happen with clones): forceUseTalent(T_FURNACE_VENT) from the first actor deals damage to the second actor, triggering callbackOnDamage on the second actor, which then triggers forceUseTalent(T_FURNACE_VENT) that damages the first actor and triggers callbackOnDamage again before the first one resolves. We got a feedback loop, the molten points never get removed because the code doesn't go past the [NEIGH] tag, instead it just digs deeper and deeper down stacks of forced Furnace Vent until either actor runs out of steam.

Just putting a turn limit on Melting Point procs would fix it, as long as the flag is set before calling forceUseTalent.


Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 1:39 am 
Offline
Wyrmic

Joined: Sun Nov 30, 2014 9:06 pm
Posts: 279
D'oh. That does make sense. I didn't even consider what would happen if you caused damage before resolving your own on damage callback. The only reason this is happening with clones more than sawbutcher PCs fighting sawbutcher rares is probably because clones are either taking AoE damage at the same time, or spawning with the same number of stacks -- if you get any two actors with nine stacks next to each other, one of them is going to die if someone takes energy damage.


Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 2:44 am 
Offline
Wyrmic

Joined: Thu May 23, 2013 12:25 am
Posts: 244
Good thought, InC. That's a completely reasonable possibility to explain what is happening here.

Unfortunately it's not an obvious fix; the removeEffect call can't be put before the forceUseTalent, because Furnace Vent exits immediately if the EFF_FURNACE_MOLTEN_POINT is not active.

Edit: Actually...

Since the callback is happening on damage, the fix may be for Furnace Vent to remove the Molten Point effect before the damage projection happens. Here's what's going on in Furnace Vent:

Code:
action = function(self, t)
      local mp = self:hasEffect(self.EFF_FURNACE_MOLTEN_POINT)
      if not mp then return nil end
      local tg = self:getTalentTarget(t)
      local x, y = self:getTarget(tg)
      if not x or not y then return nil end
      self:project(tg, x, y, DamageType.FIRE, self:steamCrit(t.getDamage(self, t) * mp.stacks / 10))

      game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_fire", {radius=tg.radius, tx=x-self.x, ty=y-self.y})
      game:playSoundNear(self, "talents/fireflash")
      self:removeEffect(self.EFF_FURNACE_MOLTEN_POINT, true, true)
      return true
   end,


If "self:removeEffect(self.EFF_FURNACE_MOLTEN_POINT, true, true)" got moved before the self:project call, then the issue should effectively go away. I'm assuming the callback happens as soon as the self:project happens, preventing the subsequent code from resolving until all the callbacks end.

_________________
Please help with the ToME wiki!


Top
 Profile  
 
PostPosted: Sun Mar 27, 2016 2:39 pm 
Offline
Halfling

Joined: Thu Jan 02, 2014 4:22 am
Posts: 113
Well, I'm glad that my character's death has not been in vain. I was only a few floors away from my second Embers Insane RL win though, so that still sucked. I will be extra careful around temporal cloners in the future.


Top
 Profile  
 
PostPosted: Sat Apr 02, 2016 7:46 am 
Offline
Archmage

Joined: Wed Nov 06, 2013 1:21 pm
Posts: 395
Location: From Russia with atchoum!
Me too.

_________________
English isn't my native language.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group