Author Topic: Tony K's AI - dumb NPC clerics  (Read 528 times)

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Tony K's AI - dumb NPC clerics
« on: September 24, 2015, 09:15:37 pm »


               

I've downloaded and installed Tony K's battle AI for my module. Recently, I started a fight (as a level 40 wizard) against a lvl 40 NPC cleric.


 

First two things the cleric did were casting Greater Restoration and Undeath to Death, even though he was perfectly healthy and there were absolutely no undead around!

Then he tried casting some, but for some reason still missed his best spells - he wouldn't touch implosion, nor would he try to cast harm on me.

 

Instead, after using three or so spells, he decided to engage me in melee. I know there are some militant cleric builds around, but I think it's a pretty dumb strategy to choose as a generic AI cleric... especially if you have no weapon equipped at all, as he did.

 

The AI is otherwise (for other types of NPC) really good and I have therefore no idea why the cleric behaved so weird. Is it just me, or can others confirm they've had similar experience? And does anyone know what can be done about this?

 

I downloaded the AI from this entry: http://neverwinterva...ystem-battle-ai


               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Tony K's AI - dumb NPC clerics
« Reply #1 on: September 24, 2015, 10:37:53 pm »


               

I was studying Tony's AI for my patch, but didn't notice this.To be truth cleric and bard AI is very stupid, basically it makes from clerics and bard casters, they will throw everything then go melee. Maybe Tony tried to workaroud this somehow, I don't know and I don't really remember, but I did that in my patch.


 


Basically there shouldn't be many reasons to use Tony K if you are using 1.71 unless you want its extra features such as henchman inventory in OC and more. However under the pressure Ive added even these features into 1.72 beta.


 


I cant tell you why Tony AI does this but I can tell you what my AI in 1.71 does.


 


1) healing AI was completely rewritten, actually vanilla AI doesnt even allow to use GR or mass heal


2) clerics that casts some battle buffs like divine power and divine favor will have higher chance to start melee


3) likewise bards


 


I studied Tony AI from scripting so maybe I missed something, can you explain the benefits or differences over 1.71 AI? Im asking simply to make my own AI better.



               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Tony K's AI - dumb NPC clerics
« Reply #2 on: September 24, 2015, 10:56:09 pm »


               

That's intriguing. I've been using 1.71 for a while now and definitely was able to notice a difference in NPC behavior once I installed Tony K's AI. Does your improved AI require some kind of switches to work, or something? '<img'>


 


For instance, Tony K's melee NPCs try to knock me down, whereas I didn't observe such behavior before I installed the AI.


Another example is that spellcasters make some good use of scrolls and wands with Tony K's, whereas vanilla spellcasters (or at least clerics - I reverted them back to the default AI for now and tested them this way) ignore these items in their inventory completely.


Tony K's AI also stops spellcasters from casting offensively at all if their enemy has spell resistance that they can't get through. I was positively surprised to see such a feature and that's why I'm mentioning it here, but I don't know if your AI doesn't do this, as well; maybe it does.


 


Oh, you also said that clerics would throw everything and then go into melee... Well, if only they did actually this. As I said, the cleric I fought using Tony K's AI had Harm and Implosion prepared, both of which are some of the most powerful spells in clerics' arsenal - yet he ignored them COMPLETELY. He didn't want to cast them (and maybe some other spells) even when he used up everything else and preferred to engage in melee instead. That's retarded.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Tony K's AI - dumb NPC clerics
« Reply #3 on: September 24, 2015, 11:40:13 pm »


               

That's intriguing. I've been using 1.71 for a while now and definitely was able to notice a difference in NPC behavior once I installed Tony K's AI. Does your improved AI require some kind of switches to work, or something? '<img'>



No, but since the scripts from CPP has lowest priority anything in override, module or maybe even hak (ugh) will overwrite it, in this case its nw_c2_default* set of scripts. That probably won¨t be your case though.



 


For instance, Tony K's melee NPCs try to knock me down, whereas I didn't observe such behavior before I installed the AI.



They spam it riddiculously often and CPP even lower the spam rate, because AI is not capable of crowd thinking so multiple monsters are knocking down one target causng weird behavior and no counterplay.


HOWEVER, this happens only when monster recognize you have too low AC, and instead of using AB they are using hitdice (total level) to check whether knockdown has sense. Its very likely that Tony changed this. Its something I was thinking about too because this behavior has no sense, however the impact on the balance especially preexisting modules seemed to me too big to do this in CPP.



 


Another example is that spellcasters make some good use of scrolls and wands with Tony K's, whereas vanilla spellcasters (or at least clerics - I reverted them back to the default AI for now and tested them this way) ignore these items in their inventory completely.



well, I dont think Tony really touched this. I might be wrong but he would have to make whole new "section" for this. Actually vanilla AI is capable of usng these items and scrolls, however they have a CR 0, thus AI try everthing else before using this. Thus mostly AI uses scrolls/wands when runs out of prepared spells or when its snared which cause a bug that impacts AI and make creature brainless thinking he has no spelluses.



 


Tony K's AI also stops spellcasters from casting offensively at all if their enemy has spell resistance that they can't get through. I was positively surprised to see such a feature and that's why I'm mentioning it here, but I don't know if your AI doesn't do this, as well; maybe it does.



No CPP is not doing this. It would be really stupid. It can look good on some creatures but if you make a caster with no melee capatibilities then what sense it has? Sure casting a spells will not likely do anything but thats in my opinion wrong design or its high lvl player in low level area. NPCs shouldnt know that they have 0% chance anyway unless its high level AI (which isnt implemented, but im adding this to my idea pool '<img'>). In my opinion if monster has spells it should use them despite they are not doing anything because player has death immunity, improved evasion, high saves, or spell resistance. Only exceptons are racial limited spells and HD or hitpoinst limited spells. There are also SR ignoring spells and SR lowering spells. And what about selfbuff spells?



               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Tony K's AI - dumb NPC clerics
« Reply #4 on: September 25, 2015, 12:01:10 am »


               


No CPP is not doing this. It would be really stupid. It can look good on some creatures but if you make a caster with no melee capatibilities then what sense it has? Sure casting a spells will not likely do anything but thats in my opinion wrong design or its high lvl player in low level area. NPCs shouldnt know that they have 0% chance anyway unless its high level AI (which isnt implemented, but im adding this to my idea pool '<img'>). In my opinion if monster has spells it should use them despite they are not doing anything because player has death immunity, improved evasion, high saves, or spell resistance. Only exceptons are racial limited spells and HD or hitpoinst limited spells. There are also SR ignoring spells and SR lowering spells. And what about selfbuff spells?




 


As I said, they refrain only from casting offensive spells - and they might (though I haven't checked it) only limit usage of spells that check SR. They will still self-buff, and I think they are likely to try summons in this case.


 


Anyway, as I said, I reverted the cleric's AI back to the default (which in my situation would be yours) and tested it this way. The cleric did use Implosion, which is good, but he still didn't cast Harm. However, I'm not jumping to the conclusions, because it's possible he didn't yet use other spells which were given priority over Harm. At least he didn't attack me in melee.


 


Still, he did not use any spells from scrolls. I've read your explanation of why this likely happens, but can something be done about it? Tony K's AI (for wizards) seemed to give stronger spells from scrolls priority over weak spells prepared by the caster. I.e. when the mage was given a choice between casting his own magic missile or an IGMS from a scroll, he would choose the latter.


 


I gave my cleric NPC(s) heal and harm scrolls, as I wanted Harm to be their main offensive spell, while heals... well, should be a staple of all clerics. I chose this way over preparing spells for them because they are part of my dynamic NPC generation system and as such are not created in the toolset, but levelled-up via the 2da packages, which don't let me define how many spells of a given type the NPC should have prepared. As a result, they'd normally have only a single Harm, a single Heal, etc. Scrolls are a way to go around this issue, but it won't work if the NPC ignores them until they have no options left.


 


What would you suggest in this situation? '<img'>



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Tony K's AI - dumb NPC clerics
« Reply #5 on: September 25, 2015, 12:47:09 am »


               

I guess Tony had to make some code around this issue if they are using scrolls in a way you say,  will have to look into this, however its tricky situation because AI goes by categories and check for defensive, offensive single target, offensive aoe, summons, and more in certain order. thus what can happen is that AI finds a scroll of spell with level 6 from category A while there is a spell with level 9 in category B. Tricky to say at least + its not very good on higher levelled creatures where their spells has CL 20> while scroll has CL 15< and on creatures with haste as casting from scroll consumes full round.


 


Anyway my clerics are using both implosion and harm, so this is interesting that yours dont. If you could send me a module with that npc I would liketp debug it. Might take a look into the main issue that started this thread - btw you used ERF version or override version of TonyK?



               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Tony K's AI - dumb NPC clerics
« Reply #6 on: September 25, 2015, 01:07:10 am »


               

I used the ERF version. I found a workaround to the problem of scrolls having low caster level by substituting it with the NPC's caster level via a spellhook.


Also, I suspect the cleric did not use Harm simply because he has not run out of most of his spells yet and Harm was further down the list. And he did use Implosion with your AI, mind you.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Tony K's AI - dumb NPC clerics
« Reply #7 on: September 28, 2015, 08:40:34 pm »


               

I was wrong Tony K AI is complete rework. To find out why the clerics behave that way would take a lot of effort, I didnt yet understood what it does and how it works.


 


Imo for you the best would be to get a nonoverriding version of TonyK AI and use it on a nonclerics.



               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Tony K's AI - dumb NPC clerics
« Reply #8 on: September 28, 2015, 09:16:30 pm »


               

Well, I did not have to download a nonoverriding version. I simply exported all NPC scripts from a fresh module without Tony K's AI and imported them with different names into my module. Then I modified the default x2_def_ scripts to use these versions if the NPC is a cleric. Wasn't difficult at all and I don't mind the default AI clerics that much, but as I said, I'd appreciate some solution to make them use scrolls and/or prioritize casting Harm.