AI Experiment: Archetypes & Tags
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
10 posts
• Page 1 of 1
AI Experiment: Archetypes & Tags
by Hellfish » 26 Jan 2012, 19:08
I'm doing some experimental AI work for Forge (Emphasis on experimental, it might never become implemented in the trunk or even useful) and was looking for a bit of "crowdsourcing".
The work applies to letting the AI identify and combat deck archetypes via sideboarding and "tagging" cards for AI use. What I'm looking for help with, if you'd like to donate a moment of your time, is lists for popular (and obscure
) archetypes, their usual color(s) and key cards AND/OR suggestions for tags that would apply to cards that tells the AI what they're good for, basically, much like some SVars' Sloth and others have implemented. Examples of what I have in mind below!


- Archetype definition | Open
- Code: Select all
Name=Burning Vengeance
[Dominant Colors]
Blue
Red
[Key Cards]
Burning Vengeance
Delver of Secrets
Geistflame
Devil's Play
Forbidden Alchemy
[Useful Tags]
GraveyardHate
ColorHateBlue
ColorHateRed
HardCountersBurning Vengeance
- Tags | Open
- Code: Select all
SacMe: Like the currently existing SVar, basically.
GraveyardHate: Nihil Spellbomb, Tormod's Crypt, (sigh)Grafdigger's Cage
AutoInclude: Moxen, general (colorless?) cards that are awesome in any deck.
AutoInclude<Color>: Autoinclude for certain colors of deck.
SacOutlet: Viscera Seer,Skirsdag Flayer,Scarland Thrinax, etc.. Increases in value with amount of SacMe's and vice versa?
ColorHate<Color>: Pyroblast, Hydroblast, Boil etc...
AutoIncludeWith<Card>: Autoinclude if you have <card> already. Splinter Twin for Deciever Exarch etc..
HardCounters<Card>: Increases in value if <Card> has been spotted in human's deck.
Anti<Archetype>: Increases in value if human's deck is currently believed to be a <archetype> deck.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: AI Experiment: Archetypes & Tags
by friarsol » 26 Jan 2012, 19:29
How about this article? http://boardgamegeek.com/thread/370207/ ... -gathering It's quite comprehensive. Reading the whole thing is educational, but for Archetypes only you can search for "How Many Good Decks Are There?" and start there.
It is a little old but covers the Aggro, Combo, Control and the combinations of those pretty nicely.
It is a little old but covers the Aggro, Combo, Control and the combinations of those pretty nicely.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: AI Experiment: Archetypes & Tags
by Hellfish » 27 Jan 2012, 10:28
Cheers! This might even make me a better player as a bonus 

So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: AI Experiment: Archetypes & Tags
by Sloth » 27 Jan 2012, 13:10
The idea is very interesting. Here are my thoughts:
It seems to me, that you are trying to do a lot of things at once. The examples you've given are a wild mix of sideboarding instructions (GraveyardHate, ColorHate<Color>), deck building hints (AutoIncludeWith<Card>, SacOutlet and AutoInclude<Color>) and tags i don't understand (HardCounters<Card>).
Some of these have to be in the archtype file, but some in the card text files (or some card list files) or?
How do you want to use deck building hints? In drafts?
It seems to me, that you are trying to do a lot of things at once. The examples you've given are a wild mix of sideboarding instructions (GraveyardHate, ColorHate<Color>), deck building hints (AutoIncludeWith<Card>, SacOutlet and AutoInclude<Color>) and tags i don't understand (HardCounters<Card>).
Some of these have to be in the archtype file, but some in the card text files (or some card list files) or?
How do you want to use deck building hints? In drafts?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: AI Experiment: Archetypes & Tags
by Hellfish » 27 Jan 2012, 13:26
Tags go in card scripts to identify to the AI things those cards are good at, basically.The concept is general enough to cover all the areas you mention, and the different areas can be developed independently and incrementally.
HardCounters<Card> is for cards that basically nullify any advantage that <Card> gives the opponent when he plays it.
The tags in the archetype definition is, as stated, tags to look for on cards in your own card pool when combating this particular archetype. I guess it should automatically look for HardCounters<Card> for the key cards in the archetype, so that may be redundant in archetype defs.
Deckbuilding hints could indeed be useful in limited, as well as for when we implement sideboarding.
HardCounters<Card> is for cards that basically nullify any advantage that <Card> gives the opponent when he plays it.
The tags in the archetype definition is, as stated, tags to look for on cards in your own card pool when combating this particular archetype. I guess it should automatically look for HardCounters<Card> for the key cards in the archetype, so that may be redundant in archetype defs.
Deckbuilding hints could indeed be useful in limited, as well as for when we implement sideboarding.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: AI Experiment: Archetypes & Tags
by Hellfish » 28 Feb 2012, 20:42
Alright, I'm starting a proper job next monday so I won't have as much time as I'd like for this. However, I *have* tweaked the archetype definition to use valids instead of directly named cards (There's still a shorthand for named cards) and allow multipliers, which defines if a card matching that valid should get multiple points or lose points. (For example, non-black cards in Mono-B control)
I'm thinking I'll commit what I've got (not hooked up to anything) after the next beta and keep working on it whenever I can from there. Yay? Nay?
EDIT: Also, it now at least takes notice of the "archetime" (aren't I witty?
) Aggro, Control or Combo.
I'm thinking I'll commit what I've got (not hooked up to anything) after the next beta and keep working on it whenever I can from there. Yay? Nay?
EDIT: Also, it now at least takes notice of the "archetime" (aren't I witty?

So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: AI Experiment: Archetypes & Tags
by friarsol » 28 Feb 2012, 20:50
Maybe just create a branch for it, so someone doesn't "accidentally" clean it up.Hellfish wrote:Alright, I'm starting a proper job next monday so I won't have as much time as I'd like for this. However, I *have* tweaked the archetype definition to use valids instead of directly named cards (There's still a shorthand for named cards) and allow multipliers, which defines if a card matching that valid should get multiple points or lose points. (For example, non-black cards in Mono-B control)
I'm thinking I'll commit what I've got (not hooked up to anything) after the next beta and keep working on it whenever I can from there. Yay? Nay?
EDIT: Also, it now at least takes notice of the "archetime" (aren't I witty?) Aggro, Control or Combo.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: AI Experiment: Archetypes & Tags
by jeffwadsworth » 29 Feb 2012, 02:31
Looking forward to fooling around with your creation, Hellfish. Good luck with the job. In this economy, you need it.
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: AI Experiment: Archetypes & Tags
by Hellfish » 15 Apr 2012, 13:56
Wow, Forge has changed. Took me most of the morning to update and merge and resolve everything.
Just to make sure with anyone in the know: To properly branch with Subclipse I'll use Team -> Branch/Tag and enter "http://svn.slightlymagic.net/forge/<branch name>"?Should I use "Create any intermediate folders that are missing"? (It does *sound* like a good idea)
Just to make sure with anyone in the know: To properly branch with Subclipse I'll use Team -> Branch/Tag and enter "http://svn.slightlymagic.net/forge/<branch name>"?Should I use "Create any intermediate folders that are missing"? (It does *sound* like a good idea)
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: AI Experiment: Archetypes & Tags
by mark » 18 Apr 2012, 14:58
Your idea is useful for future work, especially for AI strategies; please keep going 
For a real AI improvement though, the AI has to compute all possible moves from the current game state (well, until some horizon at least, as all possible combinations will surely use more RAM than available), evaluate the resulting game states and then play the move resulting in the best computed game state. To make this possible, AI vs AI has to be implemented first and the game should be able to play these games in the background (which could also lead to network play
).
I wanted to experiment with the AI code myself, but don't have the time right now and took only a quick look over the code (well, it simply plays ^^).
slightly off-topic:
For those who are interested in AI, this book looks interesting and is freely available: http://hackershelf.com/book/185/practic ... g-in-java/ (I just found the book today, but personally liked the books from Russell and Brachmann more as they were more theoretical and this one seems to have java java java in it
)

For a real AI improvement though, the AI has to compute all possible moves from the current game state (well, until some horizon at least, as all possible combinations will surely use more RAM than available), evaluate the resulting game states and then play the move resulting in the best computed game state. To make this possible, AI vs AI has to be implemented first and the game should be able to play these games in the background (which could also lead to network play

I wanted to experiment with the AI code myself, but don't have the time right now and took only a quick look over the code (well, it simply plays ^^).
slightly off-topic:
For those who are interested in AI, this book looks interesting and is freely available: http://hackershelf.com/book/185/practic ... g-in-java/ (I just found the book today, but personally liked the books from Russell and Brachmann more as they were more theoretical and this one seems to have java java java in it

10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 69 guests