Page 1 of 1

AI Experiment: Archetypes & Tags

PostPosted: 26 Jan 2012, 19:08
by Hellfish
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". :mrgreen: 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
See below for info on the tags that go in the Useful Tags section.The section indicates tags that denote cards that are useful AGAINST the archetype. (The entire section is optional, though!)


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.

It's currently working to the point of semi-consistently identifying what archetype I'm playing,though sometimes going completely the wrong way when I'm playing a bit of a hodge-podge deck.

Re: AI Experiment: Archetypes & Tags

PostPosted: 26 Jan 2012, 19:29
by friarsol
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.

Re: AI Experiment: Archetypes & Tags

PostPosted: 27 Jan 2012, 10:28
by Hellfish
Cheers! This might even make me a better player as a bonus :lol:

Re: AI Experiment: Archetypes & Tags

PostPosted: 27 Jan 2012, 13:10
by Sloth
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?

Re: AI Experiment: Archetypes & Tags

PostPosted: 27 Jan 2012, 13:26
by Hellfish
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.

Re: AI Experiment: Archetypes & Tags

PostPosted: 28 Feb 2012, 20:42
by Hellfish
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? :mrgreen: ) Aggro, Control or Combo.

Re: AI Experiment: Archetypes & Tags

PostPosted: 28 Feb 2012, 20:50
by friarsol
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? :mrgreen: ) Aggro, Control or Combo.
Maybe just create a branch for it, so someone doesn't "accidentally" clean it up.

Re: AI Experiment: Archetypes & Tags

PostPosted: 29 Feb 2012, 02:31
by jeffwadsworth
Looking forward to fooling around with your creation, Hellfish. Good luck with the job. In this economy, you need it.

Re: AI Experiment: Archetypes & Tags

PostPosted: 15 Apr 2012, 13:56
by Hellfish
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)

Re: AI Experiment: Archetypes & Tags

PostPosted: 18 Apr 2012, 14:58
by mark
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 :))