Thursday, January 31, 2008

Has MTG Forge improved your Magic skills?

Recently this question popped into my head and I was wondering whether it was true or not. Personally I think MTG Forge has helped me become a better player because, I just play Magic more often. Playing more Magic usually means that you will become a better player. You should get better if you actually focus on the game, instead of watching TV while playing Magic. Although I do listen to a few tunes while I’m playing.

MTG Forge has also taught me the value of knowing every single card in the format. This is something that I knew was important but very hard to do. It is practically impossible for me to experience playing with and against every card in a set.

Specifically MTG Forge has showed me the value of being aggressive. Remember the old Magic saying, “There are no wrong threats, only wrong answers.” Creatures, especially in limited, are always threatening. Early in my Magic career I used to chump block just to save a few life points, but now I am almost fearless and will let my life get as low as 3 without sweating. Granted if the computer is playing Mountains, I do start to hesitant when my life gets under 8 or so. I don’t want to be Shock-ed or Char-ed to death. This article about aggression by Quentin Martin really improved my game. A short excerpt is below.

“Limited is all about figuring out when it is correct to attack (as well as what the correct attack itself is). Many games come down to a single life point, be it an opponent who wins on 1 life, or not being able to be in a position to race because you will eventually fall short by that crucial point. Sandbagging your removal for when it is actually needed is an equally important skill, if slightly harder to evaluate. Next time you're doing a draft, sitting between the rounds, grab a friend and play a few practice games where you attack with everything all the time and save your removal for the next creature. You'll be surprised with how effective, as a base theory, it is.”

I want to say that my improved skills have helped me win against other players, but I am sort of a Magic hermit. I read it on the Internet ( and, look at the visual spoilers, and try to figure out what new and exciting cards I can add to MTG Forge. I don’t play Magic Online anymore; I cut off my Internet connection at home. And I’ve only played about 10 games of Magic in real life, they were all with 9th Edition starter decks when I was first learning. So you heard it here for the first time “Magic Hermit”, go forth and become as famous as “mana curve” and “undercosted.” Peace out.

Monday, January 28, 2008

Less than stellar cards

It seems that I get the most response when I write about programming and Magic together. (After all that is the purpose of this blog.) My previous post was all programming, so this one is all Magic. I hope everything evens out :) I want to write about "Has MTG Forge improved your Magic skills" but I want more time in order to make it perfect.

It is amazing if you think about it, most cards in Magic are inferior. Every card drawing spell since Alpha’s Ancestral Recall is plainly second-rate, yet they are still used. Lightning Bolt is the best burn spell ever, so why would anyone ever use Ghostfire? (Admittedly Ghostfire has some nice art compared with the bland Lightning Bolt.)

Obviously people use “inferior” cards because it is part of the format: constructed, limited, etc… The odd thing is that Magic is fun even when using these substandard cards. Maybe the fun and challenge is how to make the most of the cards that you have, like in sealed. I really enjoy sealed formats, at first I shunned them because there were less skill intensive, but I like reworking my deck with different color combinations. I do still smile if I play a 2/2 that costs something other than 3, and almost laugh if it costs 4. I laugh because it is seriously overcosted, yet very usable depending on the environment (aka card pool).

Less than stellar cards help to balance the environment. Ghostfire is probably the worst burn spell in Magic’s history, but in a desert even a handful of water is precious.

Friday, January 25, 2008


In this column I’m going to get a little bit technical. To some of you this column will feel like you are trying to swim across the Atlantic Ocean, while others will consider this just a dip in the kiddie pool.

One reader sent me a version of Magic that worked remarkably well. You play against another player over the Internet. It has 80 cards and even includes complex cards like Goblin Sharpshooter (untaps when a creature goes into the graveyard) and Doran, the Siege Tower (assigns combat damage according to toughness).

I checked out the card code and it was short and elegant, it is 100% times better than the way that I currently program cards. The language that he chose was Python. Python is often related to Perl and is sort of a duct-tape, do-anything type of language. Python lets you do slick tricks like having an array of methods. (Yes you can do that in other languages, but Python makes it easy.)

Python, like many scripting languages, is a loosely typed. That means that an object can hold a string, integer, function, method or a class. You don’t have to declare an objects type. In Python you would write “a = 10” and in other languages you would write “int a = 10”, see the difference? C, C++, Java, and many others are strongly-typed languages, an int is always int, it cannot be anything else. Python also doesn’t use semicolons which I find refreshing.

The implementation of Doran, the Siege Tower was especially short considering that it does something very complicated. In the Python, Doran replaces the method for combat damage. It sounds simple, but that is very hard, if not impossible, to do in other languages. This way of programming Doran is powerful because the combat code doesn’t need to know about Doran and yet Doran and still affect combat.

If I had to currently program Doran, the combat code would have to check if Doran was in play. This way of programming is adequate but the combat code can get very messy with a large number of cards. The Python way of programming Doran didn’t change the combat source code at all so the combat code could still be simple and easy to read.

I am just starting to learn Python but it isn’t perfect. There are no private variables which strikes me as very peculiar. There are no interfaces, empty classes with only method signatures, like there are in Java and C#.

All things considered, I like Python better than Java and I plan to use Python in my future programming projects. Currently I feel like I’m programming on ice when I use Python because I am so familiar with Java. Python still feels slippery to me, but in time I will get used to it. I believe that Python’s fast-and-easy feel is immensely flexible and powerful.

I am also intrigued by Python’s claims of shorter code versus Java. Shorter code to me means less debugging (there are fewer lines of code that could be buggy) and less writing time (which means I can write more in the same amount of time). And although I have enjoyed my marathon sessions of 4 hours of programming just to add 12 new cards, I would like to be a little more efficient. Hopefully Python will enable me to actually write code that other people can understand instead of the messy code that currently inhabits MTG Forge.

If you actually made it to the end of this column, you are doing pretty good. :) What other blog talks about Doran, the Siege Tower and loosely typed programming languages?

Tuesday, January 22, 2008


Take a peek at all at the new card art. Morningtide will be officially released on February 1, 2008.

AI and Phases

I often talk about the AI aspect of MTG Forge for two reasons. One, the AI can be improved. Two, I am always looking for specific actions that will improve the AI that can be coded into the program. Just telling me that the computer plays Wrath of God badly doesn’t help. When should the computer play Wrath of God? And answering when he is losing is not the right answer. Currently the computer plays Wrath if he will destroy 2 more of his opponent’s creatures or if he is under 8 life. Obviously this solution is not perfect, but it is reasonable, and that is all I am going for.

The good news is that I’ve found a specific area that the computer can improve on. The computer could play a few spells, like removal, during his Main 1 phase and then play any other spells or creatures during his Main 2 phase. (If the creature has haste, it is played during Main 1.) Currently the computer just tries to play everything during Main 1, which gives away valuable information. Before blocking, I would always look to see what creature the computer just played and I would adjust my blocking according.

The extra good news is that I have implemented the above suggestion into currently released version of MTG Forge and it plays great. The computer attacks and then plays a creature. The results are very satisfying and the games seem more realistic. Before now it never occurred to me that some cards and abilities would be best played during the first or second Main phases. Yes, if I was playing a game of Magic I would use the card/ability during the appropriate phase but that was something that I totally overlooked when I programmed the computer. As Neal Armstrong once said, “One small step for man, one giant leap for MTG Forge.”

Thursday, January 17, 2008


Magma is an interesting program that also lets you play Magic against the computer with the all of the rules, you can download it here (13 MB). Magma stands for Magic Machine and it shows a lot of effort. On the positive side it has 3,700 cards, a graphical user interface, and it even has lets user add new cards. Each card’s ability is a long string that is stored in the database. Obviously there is a very wide variety of Magic cards, so being able to represent cards as mere strings is pretty impressive.

This is an example of Magma’s string encoding. When Gravedigger comes into play, you may return a target creature from your graveyard to your hand. The string that represents that action is shown below

0000WHOPLY000514000000000064002 GrvHnd 00

WHOPLY is the person “who played” the card, the controller. 514 represents creatures and artifact creatures. (A different number is generated if only creatures are selected.) 64002 represents the graveyard. And “GrvHnd 00” is the action “move card from graveyard to hand.” The Magma card maker tool Made (Magma Database Designer) automatically generates the card’s effect string from the options that you select.

As much as I want to like Magma, it isn’t all that much fun to play. There are numerous phase stops that you have to click through. The user interface is cluttered and hard to understand. A popup box is used to mulligan as well as during combat. I was hoping the AI would be a little smarter but it wasn’t. I attacked with a 1/4 creature and it blocked with a 2/1 even when he was at 20 life. Another time Magma didn’t attack with his flyer when I only had ground creatures. While I wish Magma was more enjoyable, I do acknowledge the many hours of effort and dedication that it represents.

Monday, January 14, 2008

Random Deck Generator

I don’t know if I’m just too lazy to build decks any more but I have become addicted to MTG Forge’s (soon to be renamed CardWarrior) “Generate Deck” option. For those of you who are unfamiliar with CardWarrior’s Generate Deck option, I will describe it for you. It randomly generates either a 60 or 40 card 2-color deck for constructed or sealed, pretty cool huh? And when I say random, I mean completely and totally random. There is no mana curve and the general strategy is to whomp your opponent with creatures. On a side note, I lied, the decks aren’t completely random, they have a minimum number of creatures in order to make them playable.

I love having the computer generate a random deck for me to use. Maybe I just love playing with a variety of cards, or maybe I enjoy playing against an opponent that might have any card is his deck, who knows? I never really got the Timmy/Johnny/Spike thing but I guess I am a Timmy since I want to experience something. Spike would find CardWarrior painfully weak, since Spikes’ love to play Pro Tournaments. Johnny would make oddball 5 color decks in order to win without attacking. And poor Timmy just loves playing for fun. Timmys also have a weakness for large creatures and typically prefer playing Forests.

So now you know the truth about CardWarrior it was written for the Timmys of the world, as well as cheapskates. Cheap isn’t a derogatory word, I’m super cheap. This is a quote from my phone interview with Wizards, “I wrote CardWarrior in order to play with expensive rares that I don’t own.” So in closing, random decks are fun to play with and against.

Ideally the generate random deck option should also be in the Deck Editor, so that you could tweak it so that it plays a little better.

If you don't know about Timmy/Johnny/Spike read this and this.

Friday, January 11, 2008

New Version

The download file's section on my SourceForge project Card Warrior don't work. I e-mailed Sourceforge about the problem.

For those of you who are interested, you can download Card Warrior below. All the card names have been changed and there are no card pictures. Although the card are the same cards, they do feel new with just a different name. And I apologize for any generic card names like "Small Warrior." It is hard to rename 400+ cards without going crazy.

Download Card Warrior

Also there is a new version of MTG Forge with a few bug fixes. The computer’s AI is a little better. Removal and creatures with haste are played during his main 1 phase, and other cards are played during the main 2 phase. If you move the mouse to the stack, the card will be displayed. Cards were sorted according to their printed rarity for sealed and draft. Java source code and a copy of my whole blog are also included. (Consider this MTG Forge the Collector's Edition.) I'm calling this version MTG Forge version 1.0 final. I need to really get started against on MTG Forge 2.0 instead of messing around with 1.0.

Download MTG Forge

Monday, January 7, 2008

Back on Sourceforge

My program is back up on Sourceforge under the new name Card Warrior, I wanted the project back up on SourceForge because I think that it is good publicity. In order to completely avoid any legal problems from Wizards all the card names have been changed. Personally I like some of the new names. Also the "automatic picture download" option was removed. I don't like have 2 versions of the same project, but it happens.

Better AI – Only Creatures

For lack of anything else on my mind, let’s talk about the AI. Currently the computer tries to play the highest costed card in his hand. The idea is that the highest costed cost is the greatest threat that the computer currently can play. Also, the computer’s library is manipulated so that he will draw a land every few turns until he gets to 7. Hopefully this gives the computer the choice of more cards which will help him play better. The rest of the lands are artificially put at the bottom of the computer’s library.

The problem is that the computer is still pitifully weak sometimes. At times the computer plays like this. Turn 1, plays a land. Turn 2, plays a weak non-creature spell. Turn 3, play another weak non-creature spell. By this time I usually have 2 or 3 creatures in play and the computer is woefully outnumbered unless he draws a big 5/5 creature or Wrath of God. (This happens rarely, but not often enough.)

On a side note, MTG Forge cannot allow the computer to go first, it was a programming mistake, so 50% of the time you should just skip your first turn and not play anything. This will allow the computer to go first, which should make the computer a little harder to beat.

It seems like the computer really needs to use a deck with only creatures. Playing a random creature is more threatening than playing a random spell. And maybe the ideal computer deck should be 95% creatures and only 5% spells. A few spells do spice up the game. Cards like Giant Growth are still beneficial to the computer even though he can’t play them during combat.

I hate to just stop there, but I don’t have anything else to say. Well that wraps up my 20th or so, “How to make the AI better” column.

So long and thanks for all the fish,

Friday, January 4, 2008

Back on Monday?

I got an e-mail from Sourceforge saying that my project will be up on Monday, January 7 at It's a lame name I know, but I couldn't think of anything else as catchy. I wanted to renamed my program Magic Forge, but I wasn't sure if I was allowed to use the word Magic.

Anyways, my project may or may not be up on Monday we'll see. I'll probably have more news Tuesday or Wednesday. --Forge

Card Rarity

I got bored so I sorted all of the cards in MTG Forge by there respective rarities so that the sealed and draft modes would play better. Currently MTG Forge has 443 cards which breaks down to approximately 194 commons, 109 uncommons, and 126 rares*. I have programmed so many rares because the just seem more fun. For comparison Lorwyn has 301 cards: 121 common, 80 uncommon, 80 rare, and 20 basic land (who really needs more land anyways?). I say to Wizards, only put basic lands in the core set!!

Obviously just classifying cards according to their printed rarity isn’t perfect but it works most of the time. A few cards to seem to be different than their printed rarity. Thanks to Planar Chaos green has a common 3/3 flyer named Giant Dustwasp that only costs 3GG. Personally I think this card is feels like an uncommon to me, but Planar Chaos was all about color swapping, hello Damnation. Library of Alexandria which is considered on par with the Power 9 posse, is officially an uncommon. And any uncommon that regularly goes for 200+ dollars is a rare in my book, lol. Control Magic (steal any creature for 2UU) is part of the original Alpha set and is printed as an uncommon, but he can swing games like only a rare can.

*On a side note when I was adding cards to the draft/sealed set, I did not include a few unfun cards like Darksteel Colossus, (who is ever going to get 11 mana?), Delirium Skeins, (which Wrath of God’s your hand by making you discard 3 cards), and Magus of the Library, (which lets you draw a card if you already have a full hand, when is that going to happen?). And if you haven’t noticed, Magus of the Library is a weak version of the far superior Library of Alexandria.

Wednesday, January 2, 2008

Sorcery versus Instant

I like to infuse my blog with some great Magic articles that you may have missed. Why are some cards sorceries while others are instants? Well there are two very good articles about that.

Slow and Steady

Instant Winners

Obviously some mechanics are too powerful if they were instant such as discard, card drawing, and land destruction. A card like Wrath of God could never be costed at 2WW if it were an instant, such a card would probably cost 5WW. Sometimes I think of sorceries as weak instants, which is true sometimes. But non-instants force player interaction because someone has to play a spell first in order for something to happen. And finally sorceries are needed just to add variety to the game. Just think about it, if every card was an instant, end-of-turn would become the next Main Phase.

And finally, this is a funny conversation taken from the above articles between card designer Mark Rosewater and the previous rules manager Paul Barclay.

Mark: So Paul, what do you think of my new instant?
Paul: What instant?

Mark: The card I just showed you.
Paul: You mean the sorcery?

Mark: No, it's an instant.
Paul: Do you want it to have the card power currently written on the card?

Mark: Yes.
Paul: Then it's a sorcery.

And in case you missed it, check out the Morningtide Card Preview Archive

MTG Forge Achievements

The XBox 360 started the phenomenon of achievements. In a nutshell, achievements are bonuses you get for doing specific, difficult actions in a video game. Some achievements are “do 10 one hit kills,” or “score 10,000 points in 1 minute,” things which take some effort to complete.

Hopefully in the future MTG Forge will have a variety of challenging achievements. Here are my top 10 achievements for MTG Forge. See how many you can get.

1. Destroy 6 of your opponent’s creatures with Hex.
2. Use only Relentless Rats and Swamps to win a match.
3. Play a constructed deck with 7 different lands.
4. Win 2 constructed matches with a creatureless deck. +2 if you do this while drafting.
5. Win with a green/blue deck in draft or sealed. (My favorite color combination.)
6. Get a -1/1 creature into play. (Hint: it involves 2 black cards and graveyard recursion)
7. Use Damnation in a draft or sealed game.
8. Win with a Planeswalker, use Liliana Vess for an extra challenge.
9. Destroy an enchantment, you can't use Disenchant or Naturalize. Only 2 cards in MTG Forge allow you to do this.
10.Get Sliver Legion into play. +1 if you don’t use a certain green creature. (Elvish Piper)