It is currently 11 Sep 2025, 16:07
   
Text Size

When foo enters the battlefield, return bar to your hand

Post MTG Forge Related Programming Questions Here

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

When foo enters the battlefield, return bar to your hand

Postby mark » 27 Mar 2012, 08:58

Some time ago I saw a problem where the AI played a land that enforces to return a land to AI's hand. As this land was the only available land, the AI produced an endless loop. I cannot recall which land this was and I think that this was fixed (not sure about this, though).

Now I see the same problem with Whitemane Lion: when it enters the battlefield, return a creature (which is Whitemane Lion as it is the only creature)...
mark
 
Posts: 138
Joined: 28 Dec 2011, 11:32
Has thanked: 6 times
Been thanked: 11 times

Re: When foo enters the battlefield, return bar to your hand

Postby friarsol » 27 Mar 2012, 12:15

mark wrote:Some time ago I saw a problem where the AI played a land that enforces to return a land to AI's hand. As this land was the only available land, the AI produced an endless loop. I cannot recall which land this was and I think that this was fixed (not sure about this, though).

Now I see the same problem with Whitemane Lion: when it enters the battlefield, return a creature (which is Whitemane Lion as it is the only creature)...
This seems to be the same situation I was just talking about in the other thread. ETB effects are "tested" by the AI if they have start with DB in the script and not AB. It looks like the Lion has a DB, and thus isn't tested. We should probably make sure any ETB triggers have a DB on their trigger line so these loops won't happen.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: When foo enters the battlefield, return bar to your hand

Postby moomarc » 27 Mar 2012, 12:22

friarsol wrote:This seems to be the same situation I was just talking about in the other thread. ETB effects are "tested" by the AI if they have start with DB in the script and not AB. It looks like the Lion has a DB, and thus isn't tested. We should probably make sure any ETB triggers have a DB on their trigger line so these loops won't happen.
Wrong Marc, but I see what you were referring to now. Thanks

EDIT: I've tried changing it in my local copy and it works great (unless the ai ends up with two in hand). But I find you have better control over situations like these using something like
Code: Select all
SVar:NeedsToPlayVar:X GE1
SVar:X:Count$Valid Creature.YouCtrl
We might even be able to add restrictions based on specific trigger configurations to avoid it still looping if there's more than one creature of this type. [Edit] Nevermind. IT will then wait to have more than one creature but targets itself with the bounce anyway.

EDIT2: Regardless of all this, the AI shouldn't have had the Whitemane Lion because it has RemAIDeck.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: When foo enters the battlefield, return bar to your hand

Postby friarsol » 27 Mar 2012, 13:53

moomarc wrote:
friarsol wrote:This seems to be the same situation I was just talking about in the other thread. ETB effects are "tested" by the AI if they have start with DB in the script and not AB. It looks like the Lion has a DB, and thus isn't tested. We should probably make sure any ETB triggers have a DB on their trigger line so these loops won't happen.
Wrong Marc, but I see what you were referring to now. Thanks
Yea I know, but it seemed appropriate to mention it, since it was just discussed on the forum. The AI testing was more designed for cards like Foul Imp so the AI wouldn't kill themselves with it (as a replacement for etbLoseLife), but works in these situations as well.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: When foo enters the battlefield, return bar to your hand

Postby Chris H. » 28 Mar 2012, 21:16

friarsol wrote:The AI testing was more designed for cards like Foul Imp so the AI wouldn't kill themselves with it (as a replacement for etbLoseLife), but works in these situations as well.
`
It looks like there are over 600 ETB cards that need to be converted from AB to DB. Do you want all of them handled this way?
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: When foo enters the battlefield, return bar to your hand

Postby Sloth » 29 Mar 2012, 06:09

Chris H. wrote:
friarsol wrote:The AI testing was more designed for cards like Foul Imp so the AI wouldn't kill themselves with it (as a replacement for etbLoseLife), but works in these situations as well.
`
It looks like there are over 600 ETB cards that need to be converted from AB to DB. Do you want all of them handled this way?
I've converted most of the important ones already and i don't think a general conversion is needed. I left some cards with AB on purpose, because the AI won't play them otherwise (or hold them back needlessly).

These are reasons to not convert them to DB:
- The new permanent makes the ability useful, when it wasn't before (for example Inner-Flame Acolyte).
- There are Conditions in the ability (the AI does not check conditions).
- The ability is so minor (and the body of the creature so big) that it's not worth waiting for targets.
- The ability is too complex for the AI anyway (with AB you can force the AI to use it if it's not optional).

For some cards it doesn't really matter:
- Triggers with "OptionalDecider$ You" (these will always be played even when they have a DB ability).
- Token makers
- etc.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: When foo enters the battlefield, return bar to your hand

Postby Chris H. » 29 Mar 2012, 14:46

Sloth wrote:I've converted most of the important ones already and i don't think a general conversion is needed. I left some cards with AB on purpose, because the AI won't play them otherwise (or hold them back needlessly).
`
Yeah, I felt that the cards that could best use a AB to DB conversion had for the most part already been changed. I seem to remember some discussion on this taking pace a number of months ago and we decided that it would be best to convert some of them but not all of them.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 22 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 22 users online :: 0 registered, 0 hidden and 22 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 22 guests

Login Form