Thursday, May 31, 2007

Foundation Programming

When working on the next version of a piece of software, just getting version 2 to do half the things version 1 did is a major milestone, because programs have so much “foundation” code that has to be working in order for the useful code to actual perform. Foundation code works much like the concrete foundation of a house, you need to have the foundation in order to build the house, but no one says, “I have a house with a foundation,” because the foundation is taken for granted.

Most foundation code consists of mundane activities such as reading and writing files from the hard drive. Foundation code tends to be a little messy because it has to check for all kind of possible errors like if the hard drive is full or if a file doesn’t exist. Foundation code writing isn’t much fun, because it doesn’t directly impact the user. Features of a program that make it attractive to users, like spell check, use a lot of foundation code even though the user is never aware of it.

Magic Online Blues

It is May, 2007 and Magic Online 3 beta testing is currently going on now, but the final version will be out “later.” I’ll refer to Magic Online as MODO, which was the old name, which stood for Magic Online Digital Objects. MODO 2.5 has had major problems like the server crashing. MODO 3.0 was supposed to have a better user interface, with a bigger play area, as well as more features for clans but 3.0 is in trouble. The card text is hard to read, the server still seems to crash and the user interface is not a major upgrade. So what went wrong?

This is all conjecture, since I am on the outside like the rest of the world. First, supposedly Wizards rewrote the whole project, bad move. Rewriting the next version from scratch is always a waste of time. You should always be able to use part of the older version. Second, Wizards isn’t a software company. Yes they are becoming more software oriented and have started an online division that is planning on releasing other online games, but writing software is hard, even for the fulltime professionals. Future Sight is a great set of cards, but as a programmer it would make my hair stand on end.

Let me try to illustrate how difficult Magic would be to program. Hypothetical, let us say that Wizards programs the whole comprehensive rules. So all 8,828 current cards can be implemented and that is quite a good achievement. But unfortunately every time a new set of cards is released the rules are “updated,” in other words “patched.” Granted Magic is the biggest, best, and oldest but the rules are constantly in flux. The two biggest challenges for MODO are to be flexible enough for future cards and to be stable with thousands of users.

My two cents is that Wizards will have to use more than one server because online Magic is too big. You could also reduce the network traffic to and from the server by sending the game data directly to your opponent’s computer, bypassing the server. The server only lets you chat and setup a game, all in game information, like your opponent playing a card, is sent directly to your opponent’s computer. The server would ideally be independent from the client, let the client implement all of the rules. For example, the same server would be usable with MODO 2.5 and 3.

Tuesday, May 29, 2007

A Program is like a Car Engine

Computer programs are like a working engine in many ways. I don’t care how my car engine runs as long as it does. The only thing I have to do is to turn the key and make sure the gas tank isn’t empty. An engine is a complicated bit of machinery that man has honed and improved for 100+ years. So every car engine in existence is the result of 100 years of development and probably millions of man hours, but we all take it for granted. The same goes for computer programs. Programs are really, really big, Windows Vista probably took the same number of man hours as the Great Wall of China, and possibly even more. But all I want is for Windows to work when I turn the power on. I don’t care that it has hot-swapping for USB devices, or that it uses the hard drive as virtual memory, I just want Windows to work.

If I turn my car key and my engine doesn’t rev up, there is a problem. The problem might be a small one, like the battery is dead, or a big one, like a blown gasket. The point is that everything has to be working 100% correctly in order for that engine to start when I turn that key. The same thing goes for computer programming. Programming is so precise that every single character means sometimes, there are no extra commas or misspelling. A misspelled variable is a variable that doesn’t exist. At times computer programming is excoriating painful because you know what you want to do, but sometimes in haste your fingers mistype. When a computer program crashes there are 100 things that might be the problem, much like a car engine.

Why Time Spiral Block rocks?

I really enjoyed each set: Time Spiral, Planar Chaos, and Future Sight. Time Spiral was the largest block yet, weighing at 400+ cards, and introduced the purple rarity much to the confusion of players everywhere. Maybe purple was too much, but the nostalgia that Time Spiral generates is too strong to resist. One throwback card, a reprinted card, in each pack, its like packaging the past. Akroma, Angel of Wrath was back, and players everywhere were rejoicing. Wizards of the Coast has admitted that Akroma is Magic’s most recognizable card. Personally I thought Serra Angel or Wrath of God would be the marquee Magic card, but no dice.

Planar Chaos and Future Sight both feature a subset of cards with cool new card frames which look really nice. I predict that these cards will continue to grow in values as players and collectors just enjoy the different look. Wizards of the Coast might even change the regular card frame because players enjoyed new visual eye candy. Planar Chaos featured alternate cards from Magic’s past like a red Akroma and a black Wrath of God, Damnation. I really enjoy the color shifted cards like Revered Dead which is a white Drudge Skeletons. It was cool.

Future Sight has card “from the future,” well a possible future. Different cards feature different possible futures. I enjoyed some card mechanics coming back like scry, my favorite, convoke, madness, morph, and convoke. Future Sight features around 50 card mechanics, many of the new mechanics are only featured on a single card, which is both good and bad. The idea was that different cards would embody different possible futures. Landcycling morphed into Slivercycling and Wizardcycling, which lets you pay a cost, discard that card, and search for a sliver or wizard. I’m sure many casual players will want these too card just because they are interesting. Mark Rosewater indicated that if players really loved a card mechanic that it would return in future card sets.

Friday, May 25, 2007

What does common mean?

One of the reasons why "all the good cards are rare," is because people have a hierarchy in mind. I believe that customers, Magic designers, and myself included, think uncommon cards should be "better" than common, and that rare cards should be better than uncommon. This mindset is tied to the meaning of the words common, uncommon, and rare.

People prefer diamonds over cubit zirconium because diamonds are more rare. Gold is better than copper because it is rare. Money is only good because it is rare, if everybody was a millionaire, money would be NOT worth as much. Mark Rosewater, head Magic designer, said that it is getting harder, and harder to design new common cards. He compares the card rarities to an ice cream Sunday. The commons are the ice cream. The uncommons are the sprinkles and the rares are the gooey, sweet, hot fudge. You can’t have all hot fudge; well that is what he says.

MTG Forge History

Many times I’ve downloaded a cool program and I wanted to learn more about it. Most of the time I can’t find any information describing why a program exists, it just does. This article will describe the history and motivation behind MTG Forge.

It all started when I found the cool 1996 Magic game by MicroProse called Duels of the Planeswalkers, http://www.the-underdogs.info/game.php?id=1550. It let you play against the computer, which lessened the humiliation of defeat. It featured about 640 cards from Alpha, Legends, Antiquities, The Dark, and 4th Edition. It was also way ahead of its time by letting you play against other people over the Internet, much like a free Magic Online. It had all the classic power cards and I was in awe when I first saw them in action. Nevinyrral's Disk, Ancestral Recall, Ali from Cairo, Time Vault, Berserk, and Black Lotus are all very broken. I could tell that these cards were overpowered, but also really fun. I played constructed (all the cards) constantly for about a month or two straight.


I was getting bored, but I found an option to play sealed deck. I randomly clicked on it to see how it was, but I wasn’t expecting anything too great. I loved it! I got to choose my cards from a random card pool and then face off in a 32 player tournament. It was great. Those early card sets were not designed with sealed in mind so I had to use 2 tournaments packs and 4 boosters in order to construct a viable deck, anything less was unplayable.


The MicroProse game was great. The computer acted intelligent enough and would sometimes surprise me by combining the effects of two different cards. I enjoyed playing land destruction and other nasty decks, without actually annoying another person. Sealed deck was really fun, but I wish I could change the card set that it used. Some cards I just got tired of seeing and I wanted to delete them.


I started programming just to see how far I could get. I started by programming code that represented a card and then phase etc… The project just got bigger and bigger and now it is around 700kb of source code. The source code is about the length of a 300 page novel. I programmed in Java because that is my best language. I am sort of surprised the whole project didn’t collapse, and it did a few times. When nothing worked, those were the hardest days. I programmed MTG Forge mainly for myself and I am my own biggest fan. I play it almost every day.


As a side note, the old MicroProse game has a few hidden easter eggs. Sid Meier is listed in the credits of the game. And if I run the old Magic game and Apprentice at the same time, Apprentice shows the mana symbols instead of just letters in the cost of the card. The font file named is "Magis___.ttf"

Tuesday, May 22, 2007

MTG Forge History

Many times I’ve downloaded a cool program and I wanted to learn more about it. Most of the time I can’t find any information describing why a program exists, it just does. This article will describe the history and motivation behind MTG Forge.

It all started when I found the cool 1996 Magic game by MicroProse called Duels of the Planeswalkers, http://www.the-underdogs.info/game.php?id=1550. It let you play against the computer, which lessened the humiliation of defeat. It featured about 640 cards from Alpha, Legends, Antiquities, The Dark, and 4th Edition. It was also way ahead of its time by letting you play against other people over the Internet, much like a free Magic Online. It had all the classic power cards and I was in awe when I first saw them in action. Nevinyrral's Disk, Ancestral Recall, Ali from Cairo, Time Vault, Berserk, and Black Lotus are all very broken. I could tell that these cards were overpowered, but also really fun. I played constructed (all the cards) constantly for about a month or two straight.

I was getting bored, but I found an option to play sealed deck. I randomly clicked on it to see how it was, but I wasn’t expecting anything too great. I loved it! I got to choose my cards from a random card pool and then face off in a 32 player tournament. It was great. Those early card sets were not designed with sealed in mind so I had to use 2 tournaments packs and 4 boosters in order to construct a viable deck, anything less was unplayable.

The MicroProse game was great. The computer acted intelligent enough and would sometimes surprise me by combining the effects of two different cards. I enjoyed playing land destruction and other nasty decks, without actually annoying another person. Sealed deck was really fun, but I wish I could change the card set that it used. Some cards I just got tired of seeing and I wanted to delete them.

I started programming just to see how far I could get. I started by programming code that represented a card and then phase etc… The project just got bigger and bigger and now it is around 700kb of source code. The source code is about the length of a 300 page novel. I programmed in Java because that is my best language. I am sort of surprised the whole project didn’t collapse, and it did a few times. When nothing worked, those were the hardest days. I programmed MTG Forge mainly for myself and I am my own biggest fan. I play it almost every day.

As a side note, the old MicroProse game has a few hidden easter eggs. Sid Meier is listed in the credits of the game. And if I run the old Magic game and Apprentice at the same time, Apprentice shows the mana symbols instead of just letters in the cost of the card. The font file named is “Magis___.ttf”

What does common mean?

One of the reasons why “all the good cards are rare,” is because people have a hierarchy in mind. I believe that customers, Magic designers, and myself included, think uncommon cards should be “better” than common, and rare cards should be better than uncommon. This mindset is tied to the meaning of the words common, uncommon, and rare.

People prefer diamonds over cubit zirconium because diamonds are more rare. Gold is better than copper because it is rare. Money is only good because it is rare, if everybody was a millionaire, money would be NOT worth as much. Mark Rosewater, a Magic card designer, said that it is getting harder, and harder to design new common cards. He compares the card rarities to an ice cream Sunday. The commons are the ice cream. The uncommons are the sprinkles and the rares are the gooey, sweet, hot fudge. You can’t just have all hot fudge; well that is what he says.

Thursday, May 17, 2007

Money and Magic

I’m probably the cheapest Magic player ever. I enjoy Magic and I read all the articles on their website, well maybe I skip the “Flavor of Magic”, because flavor is nice but who wants to read a whole article on it. I only own 15 Time Spiral cards, yup, I bought only one pack. Granted it was a good pack. I got two rares, a foil Lotus Bloom and Sengir Nosferatu. I never really understand why people like foil cards so much, because they are warped.

Anyways, I did play a little bit on Magic Online during Kamigawa, yes it has been awhile. Online was ok, but sometimes when I was winning, which was rare, my opponent would quit or just disconnect. This sort of rude behavior was really discouraging. I did enjoy going to the Tournament Practice room and replaying some of their games, I could tell that those games were more interesting than mine, but of course they were playing with decks that were compose of 70% rare cards, go Wizards.

Mark Rosewater, current Magic designer, said that they make cards that have lots of text into rare. He reasons that cards with too much text scare beginners, which is also true. I remember reading Myr Incubator and wondering, “Who would ever play this?” Granted there are good cards that aren’t rare like Sensei's Divining Top and Eternal Witness, but the majority of good cards are rare. Making cards rare increases their price, making them inaccessible to casual players, who are the heart of Magic. I’m not sure why Wizards makes some cards rare, they don’t make don’t make any more money. A booster pack of cards costs $3.75, so Wizards won’t lose money if they make more good cards non-rare.

Some friends did mention that people will buy more booster packs if they are looking for that one chase rare. Skullclamp used to be a chase card, an uncommon in this case, until he was banded and restricted. So maybe rares do drive the sales of Magic?

Can Magic really be getting better and better?

Let’s look at the last 6 blocks: Odyssey, Onslaught, Mirrodin, Kamigawa, Ravnica, and Time Spiral. Is each block really better than the last? I think so. Odyssey had some flashback but Onslaught had the interesting bluff mechanic morph. Onslaught wins. Mirrodin has the lack of colors and the infamous Arcbound Ravager and Skullclamp. While Mirrodin had some downsides, I think it beats out Onslaught, but your mileage may vary.

Now, Mirrodin versus Kamigawa. Kamigawa featured soulshift and the cool dragon cycle that feature Keiga, the Tide Star, Kokusho, the Evening Star, and Yosei, the Morning Star who all affected constructed and limited. I still say Kamigawa beats out Mirrodin. Maybe I just like the artwork better, who knows. Kamigawa featured many cool legends as well as flip cards which were fun. Although Saviors of Kamigawa was a disappointment to all, it was bad even for the 3rd set of a block, it did feature the outstanding Pithing Needle.

Ravnica beats out Kamigawa for too many reasons, partly because Saviors of Kamigawa sucked and Ravnica had more colors than a tie dye shirt. Then Time Spiral came along, with its injection of nostalgia. Time Spiral itself was more than 400 cards, the biggest block yet, and introduced the purple rarity much to the confusion of collectors everywhere. One purple in every pack, but hope you didn’t get stuck with Squire. So Time Spiral, with its new subset of cards with cool frames, trumps Ravnica.

Will the next block beat out Time Spiral, maybe, maybe not. If Wizards of the Coast keeps working at it, they really could be getting better and better, and face it; it is in their best financial interest to keep improving.

Tuesday, May 15, 2007

Software Dilemma, the next version

Working on the next version of a piece of software is hard. You have extended the current piece of software as far as you can and added features at the cost of a clean design. There are a number of features that you currently cannot implement, so after they amount up for awhile, you decide that you need version 2.

Version 2 is not like starting from scratch, which is both a good and bad thing. For version 2 you have a bunch of source code from version 1 that you can use. The bad news is that much of the source code from version 1 will have to be tweaked in order to incorporate the new features that you want to add. Personally, I have found myself cutting-and-pasting code from version 1 into version 2 then modifying it to conform to the current design. My gut says to start version 2 from scratch, but my head knows that that would be a waste time and I probably would end up producing similar code anyways.

Version 2

Well, the next version will be able to slice and dice bread. I am aiming for programming the whole Ravnica block, big goal I know. Personally I’ve never drafted Ravnica, but I’ve heard a ton of good things about it. I could draft it on Magic Online but I know I would suck and waste my $15 dollars, I’m cheap. I love the muli-colored aspect of the cards. I lived through the Mirrodin and Kamigawa blocks that featured 2 whole gold cards, so the multi-colored madness of Ravnica seemed extra cool.

There are a ton of things I have to program in order to implement Ravnica like enchantments, first strike, double strike, trample, as well as crazy cards like Doubling Season and Blood Funnel. I don’t understand Blood Funnel and I might just as well forget to program that card.

I've been thinking. I might be biting off more than I can chew with Ravnica, so I'm going to start programming 9th Edition first then Ravnica. Man must walk before he can run.

Saturday, May 12, 2007

Wizard’s Folly – Rav Duel Lands

I’m going to begin and end this article with the same question, “Why is Hallowed Fountain rare?” The cycle of 10 duel lands from the Ravnica Block like Hallowed Fountain and Steam Vents are great, everyone wants 4 of them. The only problem is that they are rare, and are the highest priced cards in the whole set. They are so powerful that they are even used in Extended. If Wizards of the Coast is trying give the majority of players use the best cards, why isn’t this cycle of rare lands common?

Wizards has admitted that the casual player is the lifeblood of Magic. Wizards doesn’t control or gain money from the secondary market. They don’t make any money if you buy Temple Garden for $14, its current value. Wizards would be encouraging thousands (millions?) of players if they would have made these lands common or at least uncommon. I know they are really cool cards, and really cool cards automatically become rare, but printing a few cards like these as common would really help the community. My question to Wizards is this, “Why is Hallowed Fountain rare?”

MTG Forge Architecture

I am intending this for both programmers and non-programmers, so some of this will be review. Program architecture describes how you divide things up into classes, like a paragraph in a novel, and how all the classes (paragraphs) work together. The architecture was very homegrown; I basically programmed it and saw if it works. Finally the architecture was stable enough to implement Magic cards. I programmed using Java 1.2 with no packages.

The goal of any programmer is to program real-world objects. If I was building a program that simulated a car, I would program a tire class. A non-programmer would understand most of the tire class code, because it relates to a real-world object. Every program includes many classes that don’t relate to real-world objects, but are required in order to make the program work.

So MTG Forge has a Card class as well as a SpellAbility class, that implements the functionality of all spells and abilities. A Card class has at least 1 SpellAbility class, because every card is at least a spell, lands are the exception I guess. Lands are just put into play and not actually played. If a card like Elvish Piper has an activated ability, the associated Card has a SpellAbility added that does the Piper’s ability.

Every SpellAbility has an abstract resolve() method that every Magic card and ability overrides. The SpellAbility that implements the Elvish Piper ability lets you put a creature card from your hand into play, all that code goes into resolve() method. All of the zones like cards in play, graveyard, hand, are global variables, so the resolve() method has access to them. Even though MTG Forge only has about 118 classes, it has at least 400+ anonymous (unnamed) classes. Every card and ability is implemented using an anonymous class. I just as easily could have used a regular, named class for each card, and I plan to do that in version 2.

Global variables are generally bad, but they are a trade-off. You can potentially have huge problems because you cannot track down that specific line of code that changes a global variable. Non-global variables have less code that modifies them, so if you have a problem you don’t have to look through your whole program.

Rare No More

MTG Forge lets you play sealed or draft. The fun thing with all of this is that you can change the rarity of cards. Want a common Stuffy Doll, no problem. It was fun adding Savannah Lions and Isamaru, Hound of Konda to the common file, trying to push the white weenie idea. Oddly enough it didn’t unbalance the environment. Usually Savannah Lions or Isamaru, Hound of Konda traded with a generic 2/2. Sometimes you started out behind if you were lacking on mana or creatures and your opponent played his great 2 power creature for W, but overall it didn’t really matter. Anyways, it is great seeing powerful creatures that were rare, bumped down to a lowly common. Maybe I’ll make Ancestral Recall common next, who knows.

The file that contains all of the common cards is named “common.txt”. If you want to add/subtract a card, just add it to that file. To change the rarity of a card, move it from “uncommon.txt” to “rare.txt” or just delete it, if it isn’t any fun to play with

Wednesday, May 9, 2007

Common Journey

When choosing the cards for MTG Forge for limited games, finding the right cards to fill up the rare and uncommon spots was easy, but the commons gave me trouble. As I programmed new cards past the 150 mark, currently I’m at 365, I would add them usually as a common first, so I could see how they played. All of the killer commons like Sakura-Tribe Elder and Man-o'-War were already included. Sometimes I would add a card as common but it would be too powerful so I would move it up to uncommon. Most of the time I would just delete the card from the common file because I didn’t enjoy playing with it.

It is hard to say why some cards are fun yet others aren’t. Kodama's Reach is a great common and is useful in a ton of situations. Dryad Arbor which is a new card from Future Sight that is both a Land and a Creature, not super. I played with Dryad Arbor and I couldn’t find a use for it in limited games. It counts as a land so you can’t tap it for mana because it as summoning sickness which sucks. Dryad Arbor is a great “way out there card” that sucks in limited.

I didn't include Delirium Skeins as a common because I was tired of the computer playing it thus making me discard 3 cards, yes 3 cards. It seemed to make the match take too long, since you were just drawing off the top of your deck. Oddly enough if the computer actually played Delirium Skeins, it would usually win. I can add almost any card I want as uncommon or rare because they don’t effect limited games as much. Finding fun commons is a lot harder that finding nice uncommons or cool rares.

Card Selection

I had a fun time selecting which cards to program. My focus were cards that would be fun for limited, because they would also be fun for constructed. My initial goal was 150 cards, 30 for each color. The card rarity was like 20 common, 10 uncommon, 5 rares. I knew that common cards were the ones that were used the most in limited, since they are the most available.

For the rares I wanted game breaking creatures and spells like Wrath of God, Serra Angel, and Tromp the Domains. I thought of uncommon cards as usually being better than the average common card. An awesome card that I downgraded to common was Infernal Kirin. Clearly Infernal Kirin is more powerful than any common known to man. I also classified cards as uncommon if they were high costed or if you would only want one of them in your deck. You would only want at most one Puppeteer in your deck and while Craw Wurm is sometimes a big threat he is fragile, so he is uncommon also.

Wow Moments

The best parts of a video game are the “wow moments” that you remember long after. I remember winning a Need for Speed race by 0.01 seconds, at it was awesome. My video game provides many of these great moments. When the computer play Rorix Bladewing, that surprises you, and it is a huge threat that you have to take care of. Sometimes you can kill it off, and sometimes you can’t, but you always can that rush of “I’ve got to kill this huge creature or I’ll die flaming death.”

One game I just played and lost by one point, the computer play Visara the Dreadful, Castle Raptors and Kokusho, the Evening Star, Haunted Angel. All those creatures are killers, and although I did lose, I was smiling the whole time. I won one game against the computer, but he killed me the other two, but it was still great!!! I believe the best videogames provide the most “wow moments.”

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.

Programming Environment

I programmed using JBuilder 7, circa 2003, that used Java 1.3. It worked fine, it was fast and my computer was not top of the line either. JBuilder 7 did well at most things, but it didn’t off packages, yes all your classes were in one long list. At first this didn’t bother me, but later it was too much. My program had 118 classes and 700kb of source code. It is hard to visualize 700kb but written out it would be the size of a thick 500 page novel. Backups were made just zipping up all the source code. No standardized testing was done, but testing was done ad hoc when there was an error. Not knowing what to do with errors, I usually just threw a Runtime Exception with a message about the problem, which is not very friendly but what are the alternatives?

MTG Forge Evolution

I had many ideas about what I wanted to program before I started. One idea was that you could test your deck in preparation for a tournament or that you could setup a situation and have the computer answer the question about card interactions. After I started programming a few cards, I knew I wouldn’t be able to program a lot of cards. I would only be able to program a small subset of all Magic cards. At first I wasn’t able to program any cards that had state effects like Glorious Anthem or upkeep effects like Juzam Djinn, but the program evolved and they were added.

Tuesday, May 1, 2007

Feedback

The feedback I get is erratic and usually consists of wanting more cards. I usually get about one e-mail from users. Most of the time the feedback isn’t useful at all. I have not had any other programmers contribute anything, this isn’t necessarily a bad thing, because I’m not sure exactly how someone else could help. Even with a team of 2, the work would have to be divided up, and currently I just sort of write code off the top of my head, and change anything that is broken or needs to be changed. Hopefully version 2 will a structure that would allow user’s to more easily submit their own card creations.

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?

Nothing specifically went wrong. The visual interface was gray and more pleasant on my computer because I was using Java 1.3 but Java 1.5 changed the color scheme so the screen seems way too white, and it is hard on the eyes. I have tried to fix this, but that will have to wait until the next version. Currently I could not program any X spells like Fireball, or some combat damage abilities like first strike and trample. Decks do not have a sideboard, because at the time I couldn’t figure out exactly how I would let the user do that.

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?

Actually practically everything went right. Sometimes there is a random error message related to the interaction of 2 cards. I find most of those errors and I am able to fix them. The gameplay is addictive, at least I think so, and I regularly play it for 30 minutes or more. You can make and store you deck, which some people might say is a given, but it required some programming, nothing comes free.

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

Magic is the oldest and more popular card game around that currently has around 8,000 cards. My program currently has 365 cards, which is pretty good. My initial goal was 150 cards, 30 of each color. It was a large project that was written by just me. I don’t eschew other programmers, and I’m sure I could work in a group, but I just programmed it for fun in my free time. Actually, I’m very happy with it.

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.