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.
Thursday, May 3, 2007
Computer AI
Programming Environment
MTG Forge Evolution
Tuesday, May 1, 2007
Feedback
The most annoying e-mails are the one’s that say, “Have you been shutdown by Wizards of the Coast yet?” Wizards owns Magic: The Gathering. I guess my program is in a gray area, since it implements the rules and cards of a copyrighted game, but I am not profiting from it nor taking money away from Wizards of the Coast. Wizards has their own version of Magic on the computer appropriated named Magic Online.
The other type of annoying feedback that I receive goes like this. “Hi, I’m a programmer and your code looks really ugly. You could have done a lot of things better although it is cool that you can play against the computer.” Hm…interesting. First, an insult. Second, another insult. And then finally a minor praise. Is a praise wrapped in an insult still a praise? I am amazed the number of people who would look at the code and then put me down because I hard code values. They don’t contribute to the project, no they are too good for that, but they can spot bad code from a mile away, thanks. Pardon my French but some things like card names have to be hard coded somewhere.
Postmortem – what went wrong?
The biggest complain I’ve had is that the computer cheats when it plays cards. The computer might pay for “W” by tapping an Island. This isn’t an error, in so much as “designed to work that way.” The computer only counts the number of lands it has in play, this was done was a patch and I never updated it. Technically I could fix that, but the computer randomly plays a land, so that would have to be fixed too. Trying to make the computer just a little bit smarter is really hard. 90% of the time the computer is still beatable so I never saw it as much of an issue. Version 2 will have the computer paying the correct mana costs; I’m tired of getting e-mail commenting on this issue.
Postmortem – what went right?
The computer AI (artificial intelligence) seems smart enough. Although it sometimes makes a dumb play mistake, usually is seems challenging. I often play in sealed deck mode, and have the program generate both of our deck, games regularly last 10 or more turns. When I play sealed games, I am able to win 90% of the time. I still enjoy seeing the computer beat me over the head with Kiki-Jiki, Mirror Breaker or Elvish Fury. You are also able to draft in my game, which I think is a cool feature. It is a really different way to play Magic, but really fun.
Introduction Redux
It works well, so much software, especially free software, seems a little buggy, which I totally understand. Free software is written mostly by computer enthusiasts and bug stopping is usually no fun, personally I hate it. Free software also tends to have a basic user interface or none at all. My program has a simple user interface written all in Java, and it shows, but it is at least a visual interface. It automatically downloads all of the card pictures, which is a nice bonus to the user. I am really proud of the deck editor. It works nicely and is very easy to use.
Subscribe to:
Posts (Atom)