Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!news.alpha.net!uwm.edu!vixen.cso.uiuc.edu!uchinews!uchinews.uchicago.edu!covin
From: covin@tartarus.uchicago.edu (David Covin)
Subject: Re: AI for Magic
In-Reply-To: ces@wrath.ugcs.caltech.edu's message of 23 May 1995 05:18:17 GMT
X-Nntp-Posting-Host: shark.uchicago.edu
Message-ID: <COVIN.95May23141639@shark.uchicago.edu>
Sender: news@midway.uchicago.edu (News Administrator)
Organization: Univ. of Chicago Computer Science Dept.
References: <3prr6p$1q5@gap.cco.caltech.edu>
Date: Tue, 23 May 1995 19:16:39 GMT
Lines: 61

In article <3prr6p$1q5@gap.cco.caltech.edu> ces@wrath.ugcs.caltech.edu (Corinna Esmeralda Schultz) writes:

   I'm not sure how many of you out there are familiar with the card
   game "Magic:The Gathering"...  For my first attempt at programming
   AI, I want to write AI for this game.  The problem is, it doesn't
   really fit into the types of games that are talked about on this group,
   so I'm not sure where to start with this project.

This is an intriguing problem!

As a "first attempt at programming AI," you will probably not be able
to deal with very many of the different facets of the problem.  But it
might be fun to discuss them anyway...

I agree with the earlier poster who said that you will have to deal with
a wide range of difficulties, beginning with writing a program that can
simply play by the rules. :)  If there's a commercial version of the
game available for the computer, I would definitely advise making use of
it if you can.

As far as actual strategy goes: one problem is that there are two areas
where strategy needs to be applied, and they interact with each other:
designing decks, and playing with them.

For a lot of decks, playing-time strategy is relatively simple, and most
decisions can be reached by only looking at the current state of the game.
E.g. zap your opponents' creatures/artifacts/spells which are doing you
the most harm or her the most help; attack with your creatures if you can
do so without leaving yourself too exposed; etc.

Some decks are designed to support peculiar strategies, though-- e.g. 
"play defensively until you can draw both a fireball and a channel spell,
then channel all but 1 point of your life into a fireball killing your
opponent."

For deck building, I would consider a genetic-algorithms style approach:
build a bunch of decks and play them against each other many times, 
changing a deck by some amount whenever it loses (possibly by swapping
out some of the cards that were drawn that game, implicitly assuming it's
the "fault" of those cards that the game was lost?)

Actually, you might associate playing-time strategy rules with particular
cards (or classes of cards); so that the program uses a play strategy that's
based on the cards in its deck.  Some of these rules would just describe
a good basic strategy for using the card: so any deck with Tim in it would
get the rules describing how to "poke" weak critters for best effect.
Others would describe how to take advantage of interactions between cards:
so a deck with a Channel in it would have a rule that said that if the deck
also had an X-cost direct-damage spell the Channel should be used with that
if possible...

Actually, re-reading your post, I'm now not sure if you planned to have
your program do any deck-building at all.  Certainly you'd be wise to
start with fixed decks at first and just write a program which could
play decently with them.  As an excercise, you might try sitting down
with a few simple decks, drawing hands from them, and seeing if you can
write rules which tell how to play those hands...


--
David Covin                           covin@tartarus.uchicago.edu
