Page 1 of 1

MustBeBlocked

PostPosted: 25 Jan 2012, 18:04
by moomarc
@Sloth: Thanks for adding the MustBeBlocked code. Already makes the AI seem a bit smarter :wink:

Anyway, I was just wandering how big a stretch it is to expand this for the "CARDNAME must be blocked if able" keyword. I'm guessing a lot more difficult than it would appear to non-coders like me? I guess the AI logic is the really difficult part?

There's the 2 Dark Ascension cards that use it, as well as Goblin Fire Fiend, Inescapable Brute and Irresistable Prey, (as well as Nacatl War-Pride if its expanded to specify the number of mandatory blockers).

Re: MustBeBlocked

PostPosted: 25 Jan 2012, 21:37
by Sloth
I thought about this keyword today too.

It's not only the AI part that's difficult, combat involving creatures with "CARDNAME must be blocked if able.", "CARDNAME blocks each turn if able." and "All creatures able to block CARDNAME do so." combined with "CARDNAME can't be blocked except by two or more creatures." and "CARDNAME can't be blocked by more than one creature." can lead to situations were a legal block is hard to check.

Ruleswise every possible blocking constalation has to be checked for how many restrictions and requirements they abide by. Only the best are legal.

That's also the reason why "CARDNAME can't be blocked except by three or more creatures." is not implemented yet. That said i will continue to think about it and maybe i find an easy solution.

Re: MustBeBlocked

PostPosted: 26 Jan 2012, 01:28
by friarsol
The blocking is uhh super aggressive now. I thought it was just a small change making trading up much more likely (blocking my 3/1 pet with a 1/1) instead of taking damage. But it seems like the AI now is blocking even in situations where the blocker dies but not the attacker, even if his life is at stake, or he has tons of chump blockers.

Re: MustBeBlocked

PostPosted: 26 Jan 2012, 06:13
by moomarc
friarsol wrote:The blocking is uhh super aggressive now. I thought it was just a small change making trading up much more likely (blocking my 3/1 pet with a 1/1) instead of taking damage. But it seems like the AI now is blocking even in situations where the blocker dies but not the attacker, even if his life is at stake, or he has tons of chump blockers.
I think that's the general isea. If you look at the cards that the svar's been applied to, they all have considerably worse effects if they go unblocked (except Cabal Executioner perhaps seeing as there's some relatively fleshed out AI logic for choosing what to select and might even have good consequences in decks that use SacrificeMe cards). Maybe it just needs to be fleshed out by adding an 'unless' or 'unless present' clause somehow. Then Throat Slitter could instead read something like SVar:MustBeBlocked:Creature.nonBlack+YouCtrl:EQ0:True. But I'm just dreaming from a non-coder's point of view so could be completely unreasonable.

Re: MustBeBlocked

PostPosted: 26 Jan 2012, 13:05
by friarsol
Marc, I think you misunderstood me. ALL of my creatures are treated as if they must be blocked, including my 3/1 Crocodile Pet. The check for this SVar might be inverted, or maybe returning true all the time.

Re: MustBeBlocked

PostPosted: 26 Jan 2012, 13:38
by moomarc
Ah. Understood! Can see how that could be a problem :shock: