Thursday, May 3, 2007

Computer AI

Of course I wanted to make the computer as smart as possible, but AI is terribly hard. Really, really, really hard. Try to write down on a piece of paper how to tie your shoes, now you get my drift. The computer AI has to act smart enough in all circumstances with any possible card combinations already in play. I wanted the AI to be able to “look ahead” and evaluate the outcome of playing a card but that proved too hard.

The AI just tries to play a card in his hand, any card. No other thought process is done. Can I pay for 4B, sure, ok play it. The computer does the same thing with activated abilities. A separate module was written to make the AI attack and block intelligently. The computer basically trades creatures when attacking or blocking. Although trading in all circumstances isn’t optimal, it is certainly very reasonable. It would be best if the AI had a control deck that it wouldn’t trade creatures. The same AI is used for all decks and cards.

No comments: