Page 1 of 1

Blindness changes

Posted: Wed May 04, 2011 12:23 am
by lukep
Change Blindness so that it only affects sight that you have through normal means. Getting hit with a sandstorm, and temporarily losing telepathy (and arcane eye) does not seem consistent to me.

Re: Blindness changes

Posted: Tue May 10, 2011 12:30 am
by darkgod
Hum ? Detection, ESP, arcane eye, preternatural senses are all handled even while blind.
Are you sure?

Re: Blindness changes

Posted: Thu May 12, 2011 12:05 am
by lukep
Finally figured out why I was having trouble reproducing this. It would appear that Arcane Eye (from Unflinching Eye, don't know about level 5 spell) and wands of detection (for sure) do not detect creatures if you cast them while you are blind. They work normally of you cast them, then become blind while under their effects.

Re: Blindness changes

Posted: Thu May 12, 2011 1:36 am
by edge2054
I just got blinded after using vimsense and lost sight of every creature that was in natural los. Creatures behind walls where still visible however.

Re: Blindness changes

Posted: Thu May 12, 2011 2:02 am
by lukep
Hmm. I might have drawn the wrong conclusions from my testing. It now appears that blindness makes everything in LoS invisible, everything outside of it is unaffected. My tests don't contradict this.

Re: Blindness changes

Posted: Thu May 12, 2011 4:01 am
by tiger_eye
Hmm, I'll take the easy issue:
lukep wrote: It would appear that Arcane Eye (from Unflinching Eye, don't know about level 5 spell) [...] do not detect creatures if you cast them while you are blind.
"Arcane Eye" only works while blind if it is greater than or equal to talent level 5. This is sort of included in its description: "At level 5 its vision can see through invisibility, stealth and all other sight affecting effects"

As for the other things...
edge2054 wrote:I just got blinded after using vimsense and lost sight of every creature that was in natural los. Creatures behind walls where still visible however.
Were the creatures in natural LoS that you lost sight of perchance near a vault or were you in a special level? Were the creatures friendly or neutral to you?

My other guess would be that displaying the map--and all entities on the map--checks "player:canSee(a)" rather than the more robust "has_seens" cache that is created via "player:playerFOV()", which does check things like arcane eye and vimsense. Don't know if that's actually the case, though.

Re: Blindness changes

Posted: Thu May 12, 2011 4:32 am
by lukep
Arcane Eye level 2 worked just fine for me while blind in one of my tests (but not another). Here's how I did them.

Arcane Eye able to see through blindness:
1. Activate Unflinching Eye, putting the Arcane Eye on the far side of a wall, near some enemies that will not move in Norgos Lair.
2. Switch to another amulet, so I can blind myself.
3. Cast Dark Torrent (25% chance to blind) on myself until it works.
4. I can still see through the arcane eye.

Arcane Eye not able to see through blindness:
1. Get hit by sand breath from multihued drake/wyrm in Tannen's Tower, blinding me.
2. Use wand of detection. I can see two of the four or so dragons, but they disappear from view when I mouseover them.
3. Wear Unflinching Eye, then activate it after sensing is finished, but while still blind.
4. Place the Arcane Eye at the far side of the room.
5. Arcane Eye does not work.

In hindsight, I should have left the room immediately after casting Arcane Eye, to check if that would have allowed me to see (as it's no longer in my LoS).

Re: Blindness changes

Posted: Thu May 12, 2011 7:17 am
by edge2054
For me there was nothing odd going on, I was in Lake of Nur and got inked. No vaults.

Enemies behind walls remained visible, enemies in my natural LOS vanished.

Re: Blindness changes

Posted: Thu May 12, 2011 3:20 pm
by yufra
tiger_eye and I dived into the code last night to look at the Arcane Eye portion of the code, and note the last night because I think both of us were a bit bleary eyed when looking at the code. I believe the issue is that the way Arcane Eye is handled in mod.class.Player:playerFOV function does not properly account for the TL5 "true_seeing". If you have TL5 then you instantly "see" the tile with any actor on it, but you still have to resolve mod.class.Actor:canSee to determine if you can actually see the actor. The way mod.class.Actor:canSee work is by storing a cache of what you can see every round and then clearing it between rounds. If you are blind the canSee call will be false and you won't be able to see the actor on the map. The Arcane Eye section in mod.class.Player:playerFOV should probably set the can_see_cache so that the actor will definitely be seen. Something like this (untested):

Code: Select all

	-- Handle arcane eye
	if self:hasEffect(self.EFF_ARCANE_EYE) then
		local eff = self:hasEffect(self.EFF_ARCANE_EYE)
		local map = game.level.map

		core.fov.calc_circle(
			eff.x, eff.y, game.level.map.w, game.level.map.h, eff.radius, function(_, x, y) if map:checkAllEntities(x, y, "block_sight", self) then return true end end,
			function(_, x, y)
				local t = map(x, y, map.ACTOR)
				if t and (eff.true_seeing or self:canSee(t)) then
					map.seens(x, y, 1)
					self.can_see_cache[t]["nil/nil"] = {true,100}
				end
			end,
			cache and map._fovcache["block_sight"]
		)
	end

Re: Blindness changes

Posted: Fri May 13, 2011 10:50 pm
by darkgod
fixed