Enchant land auras
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
3 posts
• Page 1 of 1
Enchant land auras
by Chris H. » 23 Apr 2010, 14:51
I noticed something with the auras that enchant a land. The AI code will enchant the first land that came into play. As such, it had 3 Squirrel Nest auras in play but they all appeared on the same land.
I changed the AI code to only add non-enchanted lands to the list of lands and this resulted in the auras being attached to different lands. But in the various tests that I ran the stacking of lands into piles became out of sync. I seem to remember seeing this in one game. Not sure.
So what do people think? Does Dennis (MV) have any input … seeing that he is the one who designed the original aura system. There may be something that I am missing or this could be another case of us being human and we run out of steam. And then at a later time someone notices something strange and we scratch our heads as we ponder the greater meaning?
There currently are several aura cards and they all appear to enchant the same land rather than placing them on different lands.


I changed the AI code to only add non-enchanted lands to the list of lands and this resulted in the auras being attached to different lands. But in the various tests that I ran the stacking of lands into piles became out of sync. I seem to remember seeing this in one game. Not sure.
So what do people think? Does Dennis (MV) have any input … seeing that he is the one who designed the original aura system. There may be something that I am missing or this could be another case of us being human and we run out of steam. And then at a later time someone notices something strange and we scratch our heads as we ponder the greater meaning?

There currently are several aura cards and they all appear to enchant the same land rather than placing them on different lands.
-
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: Enchant land auras
by DennisBergkamp » 23 Apr 2010, 23:18
Hmm, yeah it's true I implemented this awhile back... I really can't remember the details of this though. Changing the AI for this to only consider lands that are not currently enchanted is a good enough solution, I think.
But why the stacking gets screwed up, I'm not sure? I'll see if I can reproduce this...
But why the stacking gets screwed up, I'm not sure? I'll see if I can reproduce this...
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Enchant land auras
by Chris H. » 23 Apr 2010, 23:30
This is what I have at the moment for a new canPlayAI() method for Squirrel Nest and it works really well from what I can tell with my testing. I will go ahead and commit it.
I almost added additional tests into this but at some point I tend to lose sight of what my code is trying to do. Old saying, keep it simple stupid.
- Code: Select all
public boolean canPlayAI() {
CardList list = new CardList(AllZone.Computer_Play.getCards());
list = list.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.isLand() && !c.isEnchanted() && CardFactoryUtil.canTarget(card, c);
}
});
if (list.isEmpty()) return false;
else {
list.shuffle();
setTargetCard(list.get(0));
return true;
}
}//canPlayAI()
I almost added additional tests into this but at some point I tend to lose sight of what my code is trying to do. Old saying, keep it simple stupid.

-
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
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 41 guests