Page 1 of 1

[b30] Rush vs. Invisibility

Posted: Sat Jul 23, 2011 10:33 pm
by lukep
Enemies that use rush on the player while the player is invisible (or, presumably stealthed, using Pity, or the enemy is blinded) allows the enemy to attack the player even if the enemy travels to the wrong tile.

Re: [b30] Rush vs. Invisibility

Posted: Fri Sep 30, 2011 8:12 am
by lukep
Bump, still present in b34. With high level Pity, Atamathon rushed at a tree next to my Doomed, and hit me for 124 damage despite the fact that he didn't get near to me.

Re: [b30] Rush vs. Invisibility

Posted: Fri Sep 30, 2011 5:38 pm
by tiger_eye
lukep wrote:Atamathon rushed at a tree next to my Doomed, and hit me for 124 damage despite the fact that he didn't get near to me
Mayhaps this was Pound, which affects actors within a radius of 2

Re: [b30] Rush vs. Invisibility

Posted: Fri Sep 30, 2011 7:57 pm
by lukep
First example (b30) was in the Ambush, so it was rush. Atamathon said he "rushes out" if I remember right, so I don't think so. Also, I think that he missed by more than 2.

Re: [b30] Rush vs. Invisibility

Posted: Fri Sep 30, 2011 7:59 pm
by Rectifier
Correct me if I'm wrong, but should he have even been able to rush to begin with when his 'target' is in another destination?

Re: [b30] Rush vs. Invisibility

Posted: Fri Sep 30, 2011 8:03 pm
by lukep
Rectifier wrote:Correct me if I'm wrong, but should he have even been able to rush to begin with when his 'target' is in another destination?
The AI cheats?

Re: [b30] Rush vs. Invisibility

Posted: Fri Sep 30, 2011 8:33 pm
by tiger_eye
Bwahaha!! What a funny bug. Good catch, lukep, the AI does cheat in regard to this... but it's not intentional. Most talents get the x, y position via a call to "getTarget(tg)", including Rush:

Code: Select all

local x, y, target = self:getTarget(tg)
If the player is the target and is invisible, then x and y may not be the x and y of the target, so the adjacency test

Code: Select all

if core.fov.distance(self.x, self.y, x, y) == 1 then
uses the wrong x, y. It should use target.x, target.y, as

Code: Select all

if core.fov.distance(self.x, self.y, target.x, target.y) == 1 then
Other talents will need to be fixed as well.

Re: [b30] Rush vs. Invisibility

Posted: Sat Oct 01, 2011 2:20 am
by tiger_eye
Probably the best way to fix this is to make sure the target is at coordinates tx, ty as returned by "local tx, ty, target = self:getTarget(tg)". Otherwise, 50-100 talents would need updated to work properly in the case that tx != target.x and ty != target.y. So, the following completely untested change should do the trick (the target returned for AI isn't the player; it's the actor at tx, ty):

Code: Select all

Index: game/engines/default/engine/interface/ActorAI.lua
===================================================================
--- game/engines/default/engine/interface/ActorAI.lua	(revision 4496)
+++ game/engines/default/engine/interface/ActorAI.lua	(working copy)
@@ -138,7 +138,8 @@
 --- Returns the current target
 function _M:getTarget(typ)
 	local tx, ty = self:aiSeeTargetPos(self.ai_target.actor)
-	return tx, ty, self.ai_target.actor
+	local target = game.level.map(tx, ty, Map.ACTOR)
+	return tx, ty, target
 end
 
 --- Sets the current target