It is currently 25 Apr 2024, 16:21
   
Text Size

Fight AI Discussions

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Fight AI Discussions

Postby swordshine » 21 Mar 2014, 12:18

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
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Fight AI Discussions

Postby Sloth » 21 Mar 2014, 14:34

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Fight AI Discussions

Postby excessum » 21 Mar 2014, 15:55

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).
excessum
 
Posts: 177
Joined: 21 Oct 2013, 02:30
Has thanked: 0 time
Been thanked: 19 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 81 guests


Who is online

In total there are 81 users online :: 0 registered, 0 hidden and 81 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 81 guests

Login Form