1.1.3 Unseen Force broken at talent levels 1, 2 and 3

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
cttw
Archmage
Posts: 394
Joined: Sat Oct 22, 2011 10:31 am

1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#1 Post by cttw »

Hi darkgod, love the new doomed tree! :)

Unfortunately (unrelated to the new tree), Unseen Force is broken unless you put 4 or 5 talent points on it. It also displays negative values in the description. Then at lvl 4 the values become positive and it works.

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#2 Post by Hachem_Muche »

I'm not seeing this error. How do you reproduce this?
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

cttw
Archmage
Posts: 394
Joined: Sat Oct 22, 2011 10:31 am

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#3 Post by cttw »

I was just playing normally. No addons other than Items Vault and Stone Warden, no cat point on the tree.

On this guy:

http://te4.org/characters/7470/tome/d59 ... 8986f73fad

orange<
Higher
Posts: 64
Joined: Sat Mar 23, 2013 11:54 am
Contact:

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#4 Post by orange< »

I'm seeing the same bug (Mac OSX 10.6.8, TOME 1.13, Stone Warden and Null's New Gems addons)

For level 1 (no points):

Description: For 6 turns you strike -9223372036854775808 (-9223372036854775808 chance for -9223372036854775808) nearby targets(s)...

cttw
Archmage
Posts: 394
Joined: Sat Oct 22, 2011 10:31 am

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#5 Post by cttw »

Yes that is what it looked like to me too. I'm using the Linux 64 build.

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#6 Post by Hachem_Muche »

Well the formula for the number of extra hits you get returns math.max(0, ....) so there should be no way to get negative numbers from it. I don't see any other problems in the talent code.

math.max and math.floor are core lua functions, so perhaps there is a problem with the OS/X and linux builds?
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

Peony
Wayist
Posts: 21
Joined: Mon Jan 06, 2014 11:22 am

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#7 Post by Peony »

I saw this (also on 64 bit Linux). Looking at the code (without knowing Lua), I think the problem is taking (tl-4) ^ 0.5, which is imaginary. Or NAN. Which could be what -9223372036854775808 actually means.

Isotope-X
Thalore
Posts: 129
Joined: Tue May 28, 2013 1:34 pm

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#8 Post by Isotope-X »

I'm encountering this on OSX, and I can confirm that the visual effect occurs but there's no attacks.

cttw
Archmage
Posts: 394
Joined: Sat Oct 22, 2011 10:31 am

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#9 Post by cttw »

Yes I got the visual effect as well.

Isotope-X
Thalore
Posts: 129
Joined: Tue May 28, 2013 1:34 pm

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#10 Post by Isotope-X »

It's a shame, that's Unseen Force has always been one of my favorite talents. Walk into a room surrounded by a tornado of anger...good stuff!

cttw
Archmage
Posts: 394
Joined: Sat Oct 22, 2011 10:31 am

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#11 Post by cttw »

It works with enough points. :)

cttw
Archmage
Posts: 394
Joined: Sat Oct 22, 2011 10:31 am

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#12 Post by cttw »

Still broken in 1.1.5.

Mewtarthio
Uruivellas
Posts: 717
Joined: Mon Jul 16, 2012 6:03 pm

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#13 Post by Mewtarthio »

Hachem_Muche wrote:Well the formula for the number of extra hits you get returns math.max(0, ....) so there should be no way to get negative numbers from it. I don't see any other problems in the talent code.
How about this line?

Code: Select all

getSecondHitChance = function(self, t) return self:combatTalentScale(self:getTalentLevel(t)-4, 15, 35) end,
See that -4 there? Here's where the function gets used:

Code: Select all

local xtrahits = t.getSecondHitChance(self,t)/100
local hitCount = 1 + math.floor(xtrahits)
if rng.percent(xtrahits - math.floor(xtrahits)*100) then hitCount = hitCount + 1 end
(from do_unseen_force)

Now, what it looks like is that you should get a 4% chance for a bonus hit at TL 1 and a 35% chance at TL 5, and if you manage to get your chance above 100% (via infinite scaling), you get a free extra hit and a % chance for an additional extra hit based on the remainder (so a hit chance of 350% would mean three extra hits, for a total of four hits, and a 50% chance of a fifth hit).

Unfortunately, what it's actually doing is giving you a 15% chance of a bonus hit at TL 5 and a 35% chance at TL 9. Worse, the combatTalentScale function (which normally can't return negative numbers) takes the square root (by default) of the talent level. When you've got an effective talent level of -3, the result is the program running into an error that it obviously wasn't designed to handle. I'm honestly surprised its not throwing LUA errors if someone even looks at the talent; still, it appears that it somehow messes with the math.max function and returns an incredibly large negative number.

In short, you need a talent level of at least four before the talent will even work in the realm of real numbers, much less give you any sort of benefit. This was probably not intended.

johnnyzero
Thalore
Posts: 148
Joined: Tue Feb 28, 2012 6:36 am

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#14 Post by johnnyzero »

Unseen force was broken with the "Applied infinite scaling to afflicted" commit, 97d23b0b9569e1db3bf52affec2a1074057a2fd2.

The offending commit removed the range check to keep the calculated talent level >= 0. Without the range check, combatTalentScale calculates to NaN (printed as large negative values with string.format and %d). Here's a patch which restores the range check:

Code: Select all

diff --git a/game/modules/tome/data/talents/cursed/force-of-will.lua b/game/modules/tome/data/talents/cursed/force-of-will.lua
index 59466e1..6691371 100644
--- a/game/modules/tome/data/talents/cursed/force-of-will.lua
+++ b/game/modules/tome/data/talents/cursed/force-of-will.lua
@@ -308,7 +308,18 @@ newTalent{
    getKnockback = function(self, t)
        return 2
    end,
-   getSecondHitChance = function(self, t) return self:combatTalentScale(self:getTalentLevel(t)-4, 15, 35) end,
+   -- Minimum effects until tLvl > 4
+   getAdjustedTalentLevel = function(self, t)
+       local tLevel = self:getTalentLevel(self, t) - 4
+       -- Do not feed a negative talent level to the scaling functions
+       if tLevel < 0 then
+           tLevel = 0
+       end
+       return tLevel
+   end,
+   getSecondHitChance = function(self, t)
+       return self:combatTalentScale(t.getAdjustedTalentLevel(self, t), 15, 35)
+   end,
    action = function(self, t)
        game.logSeen(self, "An unseen force begins to swirl around %s!", self.name)
        local duration = t.getDuration(self, t)

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: 1.1.3 Unseen Force broken at talent levels 1, 2 and 3

#15 Post by darkgod »

fixed thanks
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply