ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Wed Oct 17, 2018 8:25 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Aug 26, 2018 12:17 am 
Offline
Yeek

Joined: Tue May 23, 2017 6:18 am
Posts: 13
Bug details:
- Infinite Dungeon
- Multiplication Challenge occured
- First enemy was a rare green ooze
- It used multiply as its first action it took.
- Error popped up
- It did not actually make a copy of itself.
- It then seemed to have no AI anymore, was taking no actions after that. Death scripts still worked.
- Every other enemy seemed to be able to multiply freely without any errors popping up or their AI bugging out.

Hypothesis:
It seems that since oozes can already multiply but don't multiply as an exact copy with rarity, talents etc, giving them another talent that allowed them to do so seemed to result in two different codes conflicting each other and the AI for it just shut down. I presume this would also occur when facing against worm masses.

Solution:
The easiest solution I can think of would be to simply not have mobs that already have the multiply talent by default spawn during a multiplication challenge, though I don't know if this is possible because I feel like the challenge is randomly applied after the level has already loaded.

Image


Top
 Profile  
 
PostPosted: Mon Sep 03, 2018 8:58 pm 
Offline
Cornac

Joined: Wed Jun 06, 2018 10:53 am
Posts: 35
If I understand it correctly, this issue happens because there is some sort of protection against splitting rare clones from rare enemies. With this mechanism in place rare enemies with multiply or split on hit skills only produce normal (not rare) copies of themselves. The infinite dungeon (ID) challenge adds multiply along with a counter (it should allow all enemies to create exact copies), but normal copies remain unaffected. The lack of a counter leads to this error. I hope this makes sense.
It is possible that the ooze still can work as expected after 4 errors.

I couldn't get the challenge to do more testing, ergo the following is but a theory.

Additional switch in ...\mod\class\GameState.lua line 2809
Code:
         game:onTickEnd(function()
            local p = game:getPlayer(true)
            for uid, e in pairs(game.level.entities) do
               if p:reactionToward(e) < 0 and not game.party:hasMember(e) then
                  --Hack for infinite dungeon mutiplicity challenge
                  if e.clone_base then e.inf_dun = true end
                  e:learnTalent(e.T_MULTIPLY, true)
                  e.can_multiply = 3
               end
            end
         end)

and a modifocation to ...\data\talents\misc\npcs.lua line 51
Code:
      -- Find a place around to clone
      self.can_multiply = self.can_multiply - 1
      local a
      if self.clone_base then
         a = self.clone_base:cloneFull()
         --Allow rare enemies to produce rare clones in infinite dungeon
         if self.inf_dun then
            a = self:cloneFull()
         end
      else a = self:cloneFull()
      end

can work, but it leads to unnecessary calculations for every use of multiply (even outside the ID).

Another approach I can think of is to create a special version of multiply for the ID.
...\mod\class\GameState.lua line 2809 (probably not a valid code because I'm not sure whether it should be if e:knowTalent(e.T_MULTIPLY) then e:unlearnTalent(e.T_MULTIPLY, e:getTalentLevelRaw(e.T_MULTIPLY)) or if e.talents.T_MULTIPLY then e.talents.T_MULTIPLY = nil or something else)
Code:
         game:onTickEnd(function()
            local p = game:getPlayer(true)
            for uid, e in pairs(game.level.entities) do
               if p:reactionToward(e) < 0 and not game.party:hasMember(e) then
                  --Remove normal multiply for infinite dungeon mutiplicity challenge
                  if e:knowTalent(e.T_MULTIPLY) then e:unlearnTalent(e.T_MULTIPLY, e:getTalentLevelRaw(e.T_MULTIPLY)) end
                  e:learnTalent(e.T_MULTIPLYID, true)
                  e.can_multiply = 3
               end
            end
         end)

and a new talent called multiplyid (not the best name, I know :P) in ...\data\talents\misc\npcs.lua that is a copy of multiply except for the name and protection
Code:
      -- Find a place around to clone
      self.can_multiply = self.can_multiply - 1
      local a = self:cloneFull()

This solution suffers from doubling the same code, but doesn't require any additional calculations for normal multiply.

Frankly, any other solution is beyond my capabilities.


Top
 Profile  
 
PostPosted: Fri Sep 07, 2018 5:23 am 
Offline
Yeek

Joined: Tue May 23, 2017 6:18 am
Posts: 13
BugReporter wrote:
If I understand it correctly, this issue happens because there is some sort of protection against splitting rare clones from rare enemies. With this mechanism in place rare enemies with multiply or split on hit skills only produce normal (not rare) copies of themselves. The infinite dungeon (ID) challenge adds multiply along with a counter (it should allow all enemies to create exact copies), but normal copies remain unaffected. The lack of a counter leads to this error. I hope this makes sense.
It is possible that the ooze still can work as expected after 4 errors ...


Oh I knew why the error occurred, though just not the coding specifics (the multiply talent on oozes protecting against duplicating rare/unique/randboss copies of itself). Since it didn't break anything but the ooze AI it wasn't a very important bug, but I reported it because it may be necessary to also clear up any other issues in the future that might result in something similar.

On another point: In the ID you see fixedbosses, which are just ToME main campaign zone specific bosses placed in ID. I want to bring attention to one specific ID fixedboss: Epoch.

In ID, Epoch can create perfect clones of itself (with multiply if I remember correctly), and it appears to be able to do this however many times it wants to. While the boss is never particularly dangerous, games with it can take ... many, many hours because there didn't seem to be a limit in the amount of times it could activate multiply (that I remember).

I'm very curious to see how Epoch would interact with this ID challenge, and it would help highlight a better solution to this little bug.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 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