Page 2 of 2

Re: Fight AI Discussions

PostPosted: 21 Mar 2014, 12:18
by swordshine
sa.getParam("AILogic").equals(sth) will bring an NPE if that script does not contains param “AILogic”. If you update AI or ability effects, please test other cards using that effect. :D

Re: Fight AI Discussions

PostPosted: 21 Mar 2014, 14:34
by Sloth
excessum wrote:Is there a consolidated list of the AI issues with protection from blah effects? I see a bunch of todo's in ProtectAI and incomplete code snippets and I am not sure if multiple authors added different chunks or if a single author left those chunks empty.
I think i haven't really worked on this yet, so it should be other peoples work. But i think most of it doesn't really work as intended. Please test.

excessum wrote:Off hand, I can think of the following:
1) shroud from targeted spell/effect (copy from hexproof/shroud logic?)
2) deal unblocked damage (risky due to multi/uncolored creatures)
3) survive chump block (likely to be too fringe)
4) assess cost/benefit of enchantments/equipment dropping off (probably too complicated to implement)
I would start with 1 and 3. These should be handled similar to the Regenerate AI.

I'm not sure whether that would be enough to remove the RemAI flag from some cards, but it would be close.

Re: Fight AI Discussions

PostPosted: 21 Mar 2014, 15:55
by excessum
swordshine wrote:sa.getParam("AILogic").equals(sth) will bring an NPE if that script does not contains param “AILogic”. If you update AI or ability effects, please test other cards using that effect. :D
My bad on this one. I first used that in PumpAI which had a guarding "if (sa.getParam("AILogic"))" and then lazily copied it for the others. I was wrongly assuming that it was the same as "blah == blah"...

Sloth wrote:I would start with 1 and 3. These should be handled similar to the Regenerate AI.

I'm not sure whether that would be enough to remove the RemAI flag from some cards, but it would be close.
For the protection AI the efficiency issue is going to be a nightmare since it has so many uses. I would compare it to the RTR charms where it is impossible to judge if they are used "properly" without some over-arching game plan which the AI cannot support at the moment. Does the AI using Brave the Elements to protect a Nyxborn Shieldmate from Lost in a Labyrinth count as a good play?

For the AI to chump block and then use protection would require a two-stage decision (Declare Blockers and then end of Declare Blockers). I remember the AI being unable to play combat tricks since it will decide that it is bad at the Declare Attacker/Blocker stage without considering the tricks in hand. The tricks are only played when it is already forced into a bad attack/block (ie. in response to opponent's tricks).