quote: Original post by cklim78
OK, I''m kinda stuck right now and looking for some suggestions
My questions are :
1 ) In game like Magic, should the AI be well informed on what''s the player''s cards on hand and the incoming card in future?
2 ) Do a rule-based + learning algorithm seems to be a good solution in game like Magic?
2)
Again, I''ll assume that you have a good knowledge of the game itself. I think it REALLY helps if you do.
Why ? Because the best method for figuring out what to do is generally to think about what *you* are actually doing when you play.
Now think about it. When you play, what do you generally ask your opponent before you play ? The colors they play. And eventually if they are nice what "style" of deck. But generally, knowing the colors gives you a fair idea of the kinda guy you are against.
Red ? Direct damage and land destruction.
Green ? Mana plentyful to summon PHat creatures.
Blue ? Counterspells, and flying creatures.
White ? Defense and counter-attack, White weenies.
Black ? Antiplay and suffering.
you get the idea.
Blue-black is usually an annoying deck with denial spells (counterspell and "discard cards") and the creatures to go with, usually flying.
Green-Red is fast and furious (a horde of little creatures and direct damage)
You get the picture.
The way I see it, you hav to study the game to see different areas that can be used to win. Think about it, how do you win ? By killing your opponent, or him running out of cards.
How do you do that ?
Damage : Direct damage, creatures.
Running out of cards is a bit more straightforward.
To damage your opponent, you have to choose diverse methods. Do you want to go for pure direct damage, do you want to use massive creatures, do you prefer a horde of little ones, or other methods.
Rather than rely on your own strength, you could just deny your opponent play, by destroying his lands, by countering him constantly, by making him lose cards, etc, etc
See, there are plenty of ways to reach your goal, and these different ways are all different styles of play that you could give your AI.
My idea is that you should define some sort of personality to your AIs. That conditions the strategy that you will chose to play, which conditions the type of cards you will need.
This works backwards, of course. Looking at one''s cards, one will quickly catch an idea of the strategy the opponent will use.
How can you code that ???
I would use a rule-based approach.
something like
"killing your opponent is good"
"direct damage spells hurt your opponent"
"spells costs mana"
"lands produce mana"
"Artifact A produces 3 mana, costs 1"
And use good old logic to let the computer figure out that
"In order to win, I need to hurt the player, hence I need to cast spells, hence I need mana, hence I need land."
"If I have one land already out, casting Artifact A is better than playing another land, as it gives me more mana"
Does that make any sense to you ?
1) Now to answer your first question, if the computer knows the hand of the player and his deck... this kill the use of cards like Urza Glasses (your opponent shows his hands), or other nice spells that let people play with their hand up. As well, it kills the side effect of some spells that let you search your opponent library that they let you look at the opponent library ("Hey! I thought you didnt play with that card!")
So it seems quite obvious that it''s a Bad Idea (tm) to let the computer cheat.
Use the above ideas to figure out what the opponent has.
He is playing blue ? He probably has some counterspell up his sleeve. He''s green, I betcha he has some Fog waiting for my horde to attack. Etc
youpla :-P
Hope I am of some help
Sancte Isidore ora pro nobis !