ToME: the Tales of Maj'Eyal
http://forums.te4.org/

Tactical AI - Odd behavior?
http://forums.te4.org/viewtopic.php?f=42&t=25050
Page 4 of 8

Author:  yufra [ Tue Jun 21, 2011 6:47 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

I will have to look closer at the projectile effect on tactical AI then, not sure what is going on there.

In regards to fleeing, yes it is not well done at the moment. I disagree that fleeing doesn't add anything to the game, though. Fleeing is an excellent strategy (used by players) to cooldown talents/inscriptions, and tactical AI should be able to do that, too. I think infinite fleeing (ignoring natural health regeneration) is indeed a problem. What if fleeing was changed to flee if and only if there are talents cooling down?

Untested diff:
Code:
diff --git a/game/modules/tome/ai/tactical.lua b/game/modules/tome/ai/tactical.lua
index 3e2b1ce..55058c7 100644
--- a/game/modules/tome/ai/tactical.lua
+++ b/game/modules/tome/ai/tactical.lua
@@ -37,7 +37,7 @@ local checkLOS = function(sx, sy, tx, ty)
 end
 
 local canFleeDmapKeepLos = function(self)
-       if self.never_move then return false end -- Dont move, dont flee
+       if self.never_move then return false end -- Don't move, don't flee
        if self.ai_target.actor then
                local act = self.ai_target.actor
                local c = act:distanceMap(self.x, self.y)
@@ -264,8 +264,9 @@ newAI("use_tactical", function(self)
                        want.closein = 1 + target_dist / 2
                end
 
-               -- Need escaping... allow escaping even if there isn't a talent so we can flee
-               if target_dist and (avail.escape or canFleeDmapKeepLos(self)) then
+               -- Need escaping... allow escaping even if there isn't a talent so we can flee to cooldown
+               
+               if target_dist and (avail.escape or (next(self.talents_cd) and canFleeDmapKeepLos(self))) then
                        want.escape = need_heal / 2
                        if self.ai_tactic.safe_range and target_dist < self.ai_tactic.safe_range then want.escape = want.escape + self.ai_tactic.safe_range / 2 end
                end

Author:  Grey [ Tue Jun 21, 2011 7:15 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

Fleeing should only happen on NPCs with ranged attacks in my opinion. Everything else should do their best to keep using the base melee option, which for most monsters is their real threat.

Author:  Tom [ Tue Jun 28, 2011 6:47 am ]
Post subject:  Re: Tactical AI - Odd behavior?

Something has seen you!
Something has seen you!
Luminous Horror has seen you!

Luminous Horror casts Providence.
Luminous Horror casts Providence.
Luminous Horror casts Healing Light.

Now why would they cast theese spells at once they spotted me?
Im no expert, so maybe the last one makes sense (what do I know about spells?),
but Providence (task reward) is something I use myself, and only after I am hit by something nasty.

Tom

Author:  blorx1.0 [ Fri Jul 01, 2011 4:04 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

I've noticed that shadows that are in vaults will try to use phase door even though vaults don't allow teleportation.
The shadow will then be stuck using phase door forever, often blocking passageways
I don't know how to get the SDL readouts, but I can post a save if you want.

This is an unrelated thought but, I think displacement shield should require a line of sight to cast, so that it won't be possible to kill an enemy that is behind a wall using arcane eye.

Author:  tiger_eye [ Wed Jul 20, 2011 6:22 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

Enemies use sun infusions even when the player isn't nearby and they are surrounded by allies. This blinds the allies (a recent change to sun infusions). Madness ensues. AI should obviously be smarter about this.

Author:  tiger_eye [ Wed Jul 20, 2011 7:19 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

tiger_eye wrote:
Enemies use sun infusions even when the player isn't nearby and they are surrounded by allies. This blinds the allies (a recent change to sun infusions). Madness ensues. AI should obviously be smarter about this.
I would regard sun infusions as "attack" type now, not "utility". Also, for tactical ai, sun infusions are now more like "celestial - Sun Flare". The following patch updates sun infusions to reflect this:
Code:
Index: game/modules/tome/data/talents/misc/inscriptions.lua
===================================================================
--- game/modules/tome/data/talents/misc/inscriptions.lua   (revision 3922)
+++ game/modules/tome/data/talents/misc/inscriptions.lua   (working copy)
@@ -176,7 +176,7 @@
    name = "Infusion: Sun",
    type = {"inscriptions/infusions", 1},
    points = 1,
-   tactical = { BUFF = 1, DISABLE = 2 },
+   tactical = { ATTACK_AREA = 1, DISABLE = 2 },
    action = function(self, t)
       local data = self:getInscriptionData(t.short_name)
       self:project({type="ball", range=0, selffire=true, radius=data.range}, self.x, self.y, engine.DamageType.LITE, 1)
Index: game/modules/tome/data/general/objects/scrolls.lua
===================================================================
--- game/modules/tome/data/general/objects/scrolls.lua   (revision 3922)
+++ game/modules/tome/data/general/objects/scrolls.lua   (working copy)
@@ -199,7 +199,7 @@
    cost = 10,
    material_level = 1,
 
-   inscription_kind = "utility",
+   inscription_kind = "attack",
    inscription_data = {
       cooldown = resolvers.rngrange(9, 15),
       range = resolvers.mbonus_level(5, 5, function(e, v) return v * 0.1 end),
I don't know if this will solve all tactical ai issues regarding sun infusions, but it should at least make it better.

Attachments:
sun_infusion_attack.txt [1.16 KiB]
Downloaded 130 times

Author:  Nevuk [ Mon Aug 08, 2011 6:05 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

In the prides the golem aggros to the boss on the other side of the level (the ones that take levers to open) and rarely loses aggro unless manually forced.

Author:  Aquillion [ Mon Aug 08, 2011 6:55 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

Grey wrote:
Fleeing should only happen on NPCs with ranged attacks in my opinion. Everything else should do their best to keep using the base melee option, which for most monsters is their real threat.
Part of the question is whether the AI should do what's most logical from an individual monster's standpoint (try to stay alive, no matter what) or from a hive-mind standpoint (kill the player at any cost, with survival as a low priority.)

Realistically, unless they're an archer, long-range caster, or summoner, running rarely serves the AI well. Running makes sense for PCs because PCs get only one life (or few lives), and because many enemies are either weak at healing or, at least, not as good as the PC at healing. It works the other way for NPCs -- generally, the PC is going to have more healing options and more talents to cool down, so running away is only going to prolong the inevitable, since the PC is almost always getting power back faster than the fleeing NPC is. The only enemies whose escape options really cause problems for me are those with very dangerous long-range or summoning abilities.

The decision of whether to run or not should also be influenced by how many other enemies are nearby. If there's other enemies in sight, continuing to beat on the player is more viable, since even if you die the extra damage you do might result in them dying. If you're the only one around and can't kill the PC yourself, you might as well run and try to heal.

Running is also likely to be a bad strategy if the PC has strong ranged attacks, or rush-style talents, or is faster than you. Since nearly every PC falls into one of these categories...

Tom wrote:
Something has seen you!
Something has seen you!
Luminous Horror has seen you!

Luminous Horror casts Providence.
Luminous Horror casts Providence.
Luminous Horror casts Healing Light.

Now why would they cast theese spells at once they spotted me?
Casting Providence in advance makes sense in a few situations -- if you have a decent duration on it + decent speed, and expect to be hit by something that might prevent you from activating it reliably (or at all), like confusion, stunning, paralysis, silence, etc. It makes more sense for quick hit-and-run strikes with stuff like Probability Travel, though -- the Luminous Horrors probably shouldn't be activating it, no.

It's also possible they're just using it to build up some Positive energy -- do they track that?

Author:  Hedrachi [ Mon Aug 08, 2011 8:01 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

That stinks more of the NPC LOS bug like for dragons in the prides, where a dragon can hide but blast you with its breath weapon despite you not being in its LOS. Was discussed some time ago, forget what became of the discussion. It -might- be them trying to build positive energy for some reason but none of their positive energy spells drain positive energy, so if it's trying to build energy, then this pre-casting stuff is probably a bug.

Author:  greycat [ Wed Sep 07, 2011 4:26 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

If you are a Necromancer, your skeleton mage minions will blast you (and your other minions) with beam spells while targeting enemies. Not sure if this is intended or not, but it's sure as hell deadly.

Almost as deadly was the time one of my armoured skeletons got a 150+ point acid wave rune. And used it without any consideration for the rest of us. And I wasn't even sure which one of the armoured skeletons it was, since they are not uniquely identifiable in the combat log. I eventually decided to make a bone giant out of the lot of 'em, and ended the floods of acid that way.

Monsters with the new blinding Sun infusions frequently do as much harm to the other monsters as they do to me. Or more, since I'm much more capable of dealing with blindness than the AI is.

Author:  Pyris311 [ Fri Sep 09, 2011 7:00 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

greycat wrote:
If you are a Necromancer, your skeleton mage minions will blast you (and your other minions) with beam spells while targeting enemies. Not sure if this is intended or not, but it's sure as hell deadly.


Yes, I really hope this is not intended.

Two things kill me and my minions the most as Necro; Dreadmasters and my own minions (particularly mages). Sometimes I explode mages just so I can have another roll at a not-a-mage minion. Sometimes skelly warriors will get some kind of rune and blast the crap out of everyone too, but it's not so much a problem as with the mages. Skelly archer's projectiles are so slow that my minions will frequently wonder right into the path of one. Bone giants sometimes have some kind of ability that will make everyone around them bleed. Nearly every single minion will destroy me and other minions to the point of no return!

Of course, the pathing is bad too; I lose so many minions due to being caught up in the topography of the mazes, sometimes it's impossible to get them all to follow and they die a slow death. So much for that Bone Giant that I sacrificed so many necro points for.... Since they are slow, I have to be slow also or lose them out of my already huge aura.

Don't get me wrong; I love Necromancer and it's great fun... but I cringe every time I end up with 3 or 4 mages, can't make any more till I kill something, find a group of enemies to kill to replenish necro points, and the mages DECIMATE not only my enemy, but themselves and myself if I don't get out of the way in time. Then I have no more minions at all and I'm back to possibly producing 3 or 4 more mages that will just end up killing my party or possible me again.

I'm gonna try a non-minion build because it seems right now that minions are ENEMIES. They can be cool but then they almost kill you and there is nothing you can do about it.

Either make them not cast spells that would end up hurting allies or make their spells not hurt allies at all.
(also, I would like to see the Mages beam spell be use right; ie casting it through a line of enemies instead of just stoping at the first enemy. This is an ineffecient use of the beam spell. They have no care when they blast a 6 tile line through all of my enemies and me, but they won't blast through a line of enemies; just the first one. Strange that they'll blast 4 good guys in a row but they won't extend that curtsy to blast 4 bad guys in a row.... :?

Author:  String [ Wed Sep 21, 2011 11:22 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

The escort AI can be pretty frustrating. I wish there was a "back off" command to make them stop trying to get into melee so much.

Author:  yufra [ Tue Oct 18, 2011 7:07 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

I am back after a long hiatus, and will start looking at the tactical AI again. Prepare for a wall of text...

String wrote:
The escort AI can be pretty frustrating. I wish there was a "back off" command to make them stop trying to get into melee so much.


This is not under the realm of tactical AI, and has been addressed elsewhere on the forums.

greycat wrote:
If you are a Necromancer, your skeleton mage minions will blast you (and your other minions) with beam spells while targeting enemies. Not sure if this is intended or not, but it's sure as hell deadly.

Almost as deadly was the time one of my armoured skeletons got a 150+ point acid wave rune. And used it without any consideration for the rest of us. And I wasn't even sure which one of the armoured skeletons it was, since they are not uniquely identifiable in the combat log. I eventually decided to make a bone giant out of the lot of 'em, and ended the floods of acid that way.


A quick look at the necrotic minions shows that these are also not using tactical AI which explains why they are dumb. I'll chat with DG to determine if this is indeed intended.

Quote:
Monsters with the new blinding Sun infusions frequently do as much harm to the other monsters as they do to me. Or more, since I'm much more capable of dealing with blindness than the AI is.


I believe the following patch will fix that, and will test it later:

Code:
--- a/game/modules/tome/data/talents/misc/inscriptions.lua
+++ b/game/modules/tome/data/talents/misc/inscriptions.lua
@@ -186,11 +186,16 @@ newInscription{
                local data = self:getInscriptionData(t.short_name)
                return data.range
        end,
+       target = function(self, t)
+               return {type="ball", range=self:getTalentRange(t), selffire=false, radius=self:getTalentRadius(t), talent=t}
+       end,
        action = function(self, t)
                local data = self:getInscriptionData(t.short_name)
-               self:project({type="ball", range=self:getTalentRange(t), selffire=true, radius=self:getTalentRadius(t)}, self.x, self.y, engine.DamageType.LITE, 1)
-               self:project({type="ball", range=self:getTalentRange(t), selffire=true, radius=self:getTalentRadius(t)}, self.x, self.y, engine.DamageType.BREAK_STEALTH, 1)
-               self:project({type="ball", range=self:getTalentRange(t), selffire=false, radius=self:getTalentRadius(t)}, self.x, self.y, engine.DamageType.BLINDCUSTOMMIND, {power=data.power + data.inc_stat, turns=data.turns})
+               local tg = self:getTalentTarget(t)
+               self:project(tg, self.x, self.y, engine.DamageType.BLINDCUSTOMMIND, {power=data.power + data.inc_stat, turns=data.turns})
+               tg.selffire = true
+               self:project(tg, self.x, self.y, engine.DamageType.LITE, 1)
+               self:project(tg, self.x, self.y, engine.DamageType.BREAK_STEALTH, 1)
                return true
        end,
        info = function(self, t)


Keep up the suggestions! :D

Author:  darkgod [ Fri Oct 21, 2011 4:45 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

fixed

Author:  dpt [ Fri Dec 02, 2011 4:58 pm ]
Post subject:  Re: Tactical AI - Odd behavior?

Playing b35, a lot of the psionic powers seem to be used too early. In particular, yaech hunters will use Mindhook when I'm well out of range.

Page 4 of 8 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/