[1.4.8] stacked invisibilities not removed properly

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
meerkat299
Posts: 3
Joined: Sun Jul 24, 2016 11:40 pm

[1.4.8] stacked invisibilities not removed properly

#1 Post by meerkat299 »

I have a character with invisibility from two sources: the unique cloak Ethereal Embrace; and the talent Spell / Phantasm / Invisibility. I tested to see if the effects stacked (which they did), but once both effects were removed, the annoying, make-my-eyes-hurt invisibility-distortion remained. My character sheet now lists my invisibility as "-0.0".
This character is unplayable until this bug is resolved. Fortunately, there are tons of other fun characters to play too. Ogres weigh about a ton each, right?

Info that may be relevant:
* the cloak has been sent through the Items Vault, and was likely originally found while playing ToME 1.2.5
* Adventurer class
* Addons: Stone Wardens Bonus Class 1.2.3, Ashes of Urh'Rok 1.4.0, Items Vault 1.4.8, Embers of Rage 1.4.4
* http://te4.org/characters/139065/tome/d ... 0043125369

screenshot of char sheet:
Character sheet showing "Invisibility: -0.0"
Character sheet showing "Invisibility: -0.0"
Invisibility_Bug.jpg (192.32 KiB) Viewed 1005 times

nsrr
Sher'Tul
Posts: 1126
Joined: Mon Sep 21, 2015 8:45 pm
Location: Middle of Nowhere

Re: [1.4.8] stacked invisibilities not removed properly

#2 Post by nsrr »

I check unanswered posts periodically, and this one caught my eye because I've just done a bit of work playing around with Invisibility myself, for my Dark Priest class.

So, I got curious and took a look into things.

A couple notes:

It's easy to understand the mix-up, given the similar names, but the object that lets you activate Invisibility is actually Death's Embrace (armor), not Ethereal Embrace (cloak). The character did have both equipped, and both had been through the vault. Just wanted to clarify that, first.

I took at peek at the Phantasm spell and Death's Embrace, and I'm guessing part of the problem is how the power is calculated for the armor's effect.
It uses the formula '10 + Magic/6 + Cunning/6', which could easily lead to an irrational result, possibly many decimals in length (actually, double-checking, the character has 60 Cunning and 71 magic, so the power would be 31.8333333etc). I can't say for certain, as I don't know enough about exactly how everything works, but I'm guessing that when the power is being removed from the Invisibility timed-effect wearing off, it is subtracting a tiny fraction more than the initial power value due to some rounding along the way (possibly when the power is combined with that of the Phantasm sustain).
I think that rounding off the result of the power calculation used by the armor would likely prevent this from happening.

That is only part of it, though.

Looking at mod/class/Player, it appears that updateMainShader() checks for both the invisibility attribute and if the attribute is greater than zero, when determining whether or not to apply the colorization.

Code: Select all

...-- Colorize shader
		if self:attr("stealth") and self:attr("stealth") > 0 then game.fbo_shader:setUniform("colorize", {0.9,0.9,0.9,0.6})
		elseif self:attr("invisible") and self:attr("invisible") > 0 then game.fbo_shader:setUniform("colorize", {0.3,0.4,0.9,0.8})

...
However, when determining if it should apply the motion blur, it checks for the attribute, but not its value.

Code: Select all

...-- Moving Blur shader
		if pf.motionblur and pf.motionblur.shad then
			if self:attr("invisible") then pf.motionblur.shad:uniMotionblur(3) effects[pf.motionblur.shad] = true

...
If it were checking for a value greater than zero here, the blur would not persist in the case of this character, I believe, as the Invis power listed on the character sheet is "-0.0" (which is probably actually something like -0.0000067).

Adding the same check for the motion blur as the colorization, and rounding off the power from the item, both seem like straight-forward and simple actions that could be taken toward correcting this error.

(As a side note, on Invisibility in general, the motion blur really is more than just an annoyance. Looking at it for too long gave me a headache and made me feel queasy, which is what lead me to digging into how the visual effects were being applied in the first place. It bothered me so much that I wound up super-loading the parts of the function shown above to use much more mild shaders if the player had my effect as well as the invisibility attribute, which is the only reason I knew where to look in this case. Personally, I would not be unhappy if both the motion blur and colorization for this attribute were toned down a fair bit.)

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: [1.4.8] stacked invisibilities not removed properly

#3 Post by HousePet »

I think Stunt can fix this if you want it fixed.
My feedback meter decays into coding. Give me feedback and I make mods.

Post Reply