It is currently 11 Sep 2025, 11:52
   
Text Size

AI Experiment: Archetypes & Tags

Post MTG Forge Related Programming Questions Here

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

AI Experiment: Archetypes & Tags

Postby 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". :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.
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
User avatar
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

Postby 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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: AI Experiment: Archetypes & Tags

Postby Hellfish » 27 Jan 2012, 10:28

Cheers! This might even make me a better player as a bonus :lol:
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
User avatar
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

Postby 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?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: AI Experiment: Archetypes & Tags

Postby 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.
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
User avatar
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

Postby 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? :mrgreen: ) Aggro, Control or Combo.
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
User avatar
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

Postby friarsol » 28 Feb 2012, 20:50

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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: AI Experiment: Archetypes & Tags

Postby 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

Postby 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)
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
User avatar
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

Postby 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 :))
mark
 
Posts: 138
Joined: 28 Dec 2011, 11:32
Has thanked: 6 times
Been thanked: 11 times


Return to Developer's Corner

Who is online

Users browsing this forum: Bing [Bot] and 25 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 26 users online :: 1 registered, 0 hidden and 25 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: Bing [Bot] and 25 guests

Login Form