Thursday, August 23, 2007

Constructed Blues

For some reason I don’t play MTG Forge’s constructed mode (all the cards) very often and in fact it is my least favorite mode. When you have all the cards, constructed mode feels fake for some reason. On the other hand sealed and draft games are super fun. Currently my favorite format is sealed since it takes less time and I enjoy playing different color combinations to see what colors are the strongest.

In real life when I played constructed on Magic Online it felt different because I never had all the cards that I really wanted. I never had some chase rare and only a handful of useful uncommons to choose from. For me it was trying to make the best constructed deck with my puny card pool, which is currently how I view limited games. It was exciting to win against a better more expensive deck with lowly commons and uncommons.

Pro Magic players have said time and time again that drafting is infinitely more fun that constructed. Basically constructed is solvable. By solvable I mean that there will be one or more tier 1 decks and the rest are rubbish. Ideally the tier 1 constructed decks would work like rock-paper-scissors. Deck A beats B, B beats C, and C beats A, so it all goes in a circular fashion. If there is only a single tier 1 deck then the format becomes stale. Personally Dragonstorm seemed like the best deck until 10th rolled around, stripping it of Seething Song. Back when Mirrodin was around, Arcbound Ravager decks ruled the roost and were eventually banned. But the damage was already done, sales and tournament attendance was down.

So back to limited games, they have more variety and that is why I love them. (I know there are a variety of alternative formats like peasant, all commons and uncommons, and singleton, where you only have 1 copy of each card.) What formats do you play?

Monday, August 20, 2007

Programming Magic 1

Programming some parts of Magic: The Gathering is simple while others are quite hard. First question, how many zones does Magic have? From the comprehensive rules 217.

“There are normally six zones: library, hand, graveyard, in play, stack, and removed from the game. Some older cards also use the ante and phased-out zones. Each player has his or her own library, hand, and graveyard. The other zones are shared by all players.”

Even though the answer is six, each player has his own library, hand, and graveyard, so the more correct answer is that Magic has a total of nine zones. MTG Forge uses a CardList, an ArrayList that only holds Card objects, for each zone. MTG Forge actually has more than 9 zones because it divides up zones into the stack, human hand, human graveyard, human removed from game, and corresponding computer hand, computer graveyard, computer removed from game. The zones are relatively straight forward to program because the only actions you can do is add a card, remove a card, and find a card.

Some complications occur when finding a card because multiple cards with the same name may be in play at the same time. How do you differentiate between different cards with the same name? The answer was in the old MicroProse game called Duels of the Planeswalkers, also known as just Shandalar, http://www.the-underdogs.info/game.php?id=1550 It had an option that allowed you to turn on the card’s number. So the answer is to give every card a unique number and to find cards based on that number, which is the method I use in MTG Forge. Magic Online most certainly uses the same method but it is transparent to the user since it is more user friendly and identifies the target with fancy arrows.

I know assigning cards different unique number isn’t exciting, but it is a critical part of programming Magic. Most programming is very, very boring, and it takes a great deal of time to get anything working. So I’m very happy with MTG Forge :)

Thursday, August 16, 2007

Wild Draft

Do you remember that old TV show that was named the “Wild Wild Wild West,” well I wanted to name this column “Wild Wild Wild Draft.” Thankfully the sane part of my brain booted up and I decided against it. What sort of draft makes you choose between a Mox and Meloku the Clouded Mirror? The choices are antagonizing. One of my draft decks featured 2 Moxes, 3 Serendib Efreets, Ancestral Recall, and Keiga, the Tide Star, which makes it the most expensive limited deck ever.

No I wasn’t drafting Alpha, but I was drafting some of the best cards from Alpha and from all of Magic’s history. I wrote this little program called MTG Forge that lets you play and draft against the computer. Someone suggested drafting all of the cards programmed with no rarity, so Juzam Djinn comes up as often as a common land. I thought it was an insane idea, but I tried it. This sort of crazy drafting is the most fun ever. Picking between Flametongue Kavu and Rorix Bladewing is just grueling. What is better, Wonder or Regrowth? Does Godless Shrine beat Terror or vice versa?

The version of MTG Forge that I'm talking about is named "“08-06-mtgforge-crazy-limited” As always you can download MTG Forge from http://sourceforge.net/projects/mtgforge

OK, so I open my first pack and what do I see. The standout cards are Birds of Paradise, Helldozer, Jokulhaups, Keiga, the Tide Star, and Kiki-Jiki, Mirror Breaker. Man, I wish I could open a booster like this in real life. I read once that a game, video or otherwise, is made up of interesting choices, unlike life. Drafting like this gives you a ton of interesting choices. Once you draft a Mox, you will never go back.

Monday, August 13, 2007

Remembering Card Names

I love reading and comparing Magic articles. Does this writer agree with that one? Do they have the same opinion on anything? But I do detest having to look up about half or more of the cards to see what they really do. Yes we all know Shock deals 2 damage, but what does Sudden Impact do? I remember most cards by their art and I presume most other people do the same. I do tend to remember the card better if I have actually played with it.

To look up cards I could just click on the card, but I’m not online all the time, so I just use Apprentice. It may not be fancy, but it gets the job done. A few online stores show you the card text when your mouse is over that card, which I think is great. You can quickly lookup the cards you don’t know without all the cutting-and-pasting that I do.

I could do a whole side project that takes a web page and adds all the info when your mouse hovers over a card. I probably won’t, but it still would be a fun project that hopefully would be used by other sites also. I personally don’t know much about Javascript but it is supposed to be easy right? Just my two cents. :)

How many card names do you know?

Friday, August 10, 2007

MTG Forge – Crazy Draft Version

I really enjoy playing limited games on MTG Forge. Sealed is a nice challenge and is fun because I win and drafting is a harder challenge, but still very winnable. And best of all no money is exchanged for little bits of colored cardboard, you know what I mean right? Ok down to my point, I released a new version of MTG Forge called “08-06-mtgforge-crazy-limited” that lets you play draft and sealed with all of the cards with no rarity. You will see a Mox Jet as often as Llanowar Elves. As always you can download MTG Forge from http://sourceforge.net/projects/mtgforge

This type of flat rarity makes draft/sealed games more explosive than monkeys fishing with dynamite. Do you draft a duel land or a big, game-winning creature? The decisions are hard, but a lot of fun. No real archetypes exist since you are seeing cards from a pool of 400. I wanted to call this release of MTG Forge “Johnny Edition,” but I doubted anyone would know what I was talking about. MagicTheGathering.com column “House of Cards” writer, whatever his name is, writes articles that related to “Johnnys.” Supposedly Johnnys like surprises and crazy combos, but I’m not sure.

Also a word of warning, it is harder to win. Instead of winning 95% of the time, you will drop to about 70% because sometimes the computer will drop some bombs and there is no way to recover. So yes you will probably lose a fourth of all your games, get ready to be served.

I did do a few bug fixes. Akroma, Angel of Fury now has flying. I thought Akroma, Angel of Wrath was hard to cast at 7 (5WW), but she really costs 8 (5WWW). Animate Dead and Beacon of Unrest didn’t set the controller of the card correctly, so things like Soul Warden would give your opponent life instead of you. And the computer could target artifact creatures with Ashes to Ashes, which is a no-no. Ashes is an insane card, it basically destroys TWO creatures for only 5 life. I think it is even more unfair than Wrath of God. I removed Ashes from the sealed and drafting card set.

Once I drafted two Serra Angels, two Moxes, and two Glorious Anthems. It was a thing of beauty. What was your craziest draft?

Tuesday, August 7, 2007

Bug Hunting: Akroma

Sometimes I wish I was a treasure hunter that searched for Spanish gold hidden deep in the watery deeps but instead I have to search through text (Java programming code). Hi all, this column will be about how I found and fixed a bug in MTG Forge. For some reason Akroma, Angel of Fury can be blocked by non-flyers which truly puzzles me. The original, Akroma, Angel of Wrath, and other flyers have no problems and work correctly. But why is that red Akroma troublesome, who knows? Even as I am writing this I don’t know the answer and now I will go and hunt for bugs.

The first step in any bug hunt is to recreate the board position so that the error is reproducible. If the bug isn’t reproducible, how do you know if it is really fixed? Ok, the board position is setup in Run.java and it proves the computer does indeed block the red Akroma with Enormous Baloth but doesn’t block the regular white Akroma.

Second step, try to check the most brain dead, easiest thing first (i.e. The computer is not working because it is not plugged in). So I checked the card definition of Akroma in the file “cards.txt” I’m looking for any obvious mistakes like misspelling the keyword flying, not capitalize flying, etc… (Keywords like flying must be capitalized in MTG Forge.) WOW, the definition of Akroma looks like below.

Akroma, Angel of Fury
5 R R R
Legendary Creature Angel
no text
6/6
Flying, Trample

As you may or may not notice, keywords should go on separate lines, so it should look like this.

Akroma, Angel of Fury
5 R R R
Legendary Creature Angel
no text
6/6
Flying
Trample

Last step (hopefully), check to see if the computer does not block Akroma. YEAH!!! It is working like it should. It took 6 minutes total, which is a short amount of time to fix one small bug, but most bugs take at least 30 minutes. Hopefully this gives you an indication of the number of hours that I have put into this project.

I thought the problem might be in the file CombatUtil canBlock method, which says whether card A can block card B. This code has gotten a little messy considering keywords like fear, flying, abilities like “this creature cannot block” (Daggerclaw Imp) and unblockable (Phantom Warrior). As well as the cards like Cloud Sprite which can only block other creatures with flying and Skirk Shaman that has some sort of red fear and can only be blocked by artifact or red creatures. Thankfully I didn’t have to change any Java code and the listing for the canBlock method is shown below for interest value.

Well thanks for coming along with me on my little safari. Initially I didn’t know how long it would take. I’ll probably have more adventures in bug hunting. And remember a bug that isn’t fixed is a feature. Tromp the Domains incorrectly counts the number of lands and not land types. Remember that Tromp the Domains is a feature, ok :)

What “features” have you found in MTG Forge?


//taken from CombatUtil
//can “blocker” block attacker?
public static boolean canBlock(Card attacker, Card blocker)
{
if(blocker.getName().equals("Cloud Sprite") && !attacker.getKeyword().contains("Flying"))
return false;

if(attacker.getKeyword().contains("Unblockable"))
return false;

if(blocker.getKeyword().contains("This creature cannot block"))
return false;

if(attacker.getKeyword().contains("Flying"))
{
return blocker.getKeyword().contains("Flying")
blocker.getKeyword().contains("This creature can block as though it had flying.");
}

if(attacker.getKeyword().contains("Fear"))
{
return blocker.getType().contains("Artifact")
CardUtil.getColors(blocker).contains(Constant.Color.Black)
CardUtil.getColors(blocker).contains(Constant.Color.Colorless);
}

if(attacker.getName().equals("Skirk Shaman"))
{
return blocker.getType().contains("Artifact")
CardUtil.getColors(blocker).contains(Constant.Color.Red);
}

return true;
}

Thursday, August 2, 2007

Who Uses MTG Forge?

This question pops occasionally pops into my head and I’m not entirely sure what the answer is. So who does use my program? Players who are cheap? (That would be me!!) Players who don’t use Magic Online (Me again, lol.) Players who use land destruction and other mean decks. (Sometimes I do.) Players who are afraid of losing to another human player since their ego is so small. (Definitely me.)

Primarily, I would guess that the people who download and play MTG Forge are the casual crowd who just want to have an interesting, fun game of Magic. Yes winning is important, but having fun is more important. I enjoy winning and losing in an awesome, blow-up-the-world fashion. I love the games where the computer surprises me or I win with 1 life left. My goal is not to just win or lose, it is to get there in the most spectacular, remarkable way.

I also play MTG Forge to use great rares like Akroma, Angel of Wrath and Kokusho, the Evening Star, cards that I could/would never buy in real life. Playing with Korlash, Heir to Blackblade also lets me get a feel for cards that people are currently talking about. I also enjoy the crazy sealed deck and drafting games. Which card is better to draft, Mox Jet or Kokusho? Lol I don’t know, they are both awesome cards. I play Magic, and MTG Forge, in order to experience something. Why do you play Magic?