Tactical AI tries to shoot through walls

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Tactical AI tries to shoot through walls

#1 Post by yufra »

Graziel noticed a bug and we tinkered with it on IRC a bit. The behavior is that a tactical AI tries to shoot talents at targets when there isn't a clear projection path, thus hitting the walls. I tracked this down to the switch from requiring canProject in the tactical AI's t_avail check to the within_range check and then relying on the dummy projection. This switch was done to allow talents that could "hit" from further than their range, basically range+radius. Graziel is currently checking this simple addition to the code, and early results look good:

Code: Select all

diff --git a/game/modules/tome/ai/tactical.lua b/game/modules/tome/ai/tactical.lua
index bda8c77..b829719 100644
--- a/game/modules/tome/ai/tactical.lua
+++ b/game/modules/tome/ai/tactical.lua
@@ -148,7 +148,7 @@ newAI("use_tactical", function(self)
                                        -- Use the player set ai_talents weights
                                        val = val * (self.ai_talents and self.ai_talents[t.id] or 1) * (1 + lvl / 5)
                                        -- Update the weight by the dummy projection data
-                                       if nb_foes_hit > 0 or nb_allies_hit > 0 or nb_self_hit > 0 then
+                                       -- Also force scaling if the talent requires a target (stand-in for canProject)
+                                       if self:getTalentRequiresTarget(t) or nb_foes_hit > 0 or nb_allies_hit > 0 or nb_self_hit > 0 then
                                                val = val * (nb_foes_hit - ally_compassion * nb_allies_hit - self_compassion * nb_self_hit)
                                        end
                                        -- Only take values greater than 0... allows the ai_talents to turn talents off
<DarkGod> lets say it's intended

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

Re: Tactical AI tries to shoot through walls

#2 Post by darkgod »

fixed
[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