Thursday, May 6, 2010

New Version

(I am only 35 or so hours late. I should never predict when I’m going to do something.)

Forge now has 115 new cards, which brings the grand total to 2,961 cards. All of the credit goes to DennisBergkamp, RobCashwalker, Chris H, Jim, and slapshot5. Thank you for your work.

OK, the good stuff, the cards. Forge now supports unearth and has 11 cards with that keyword including: Hellspark Elemental (1R, 3/1, trample haste, sacrifice at EOT) and lets you attack again for 1R with unearth. Dregscape Zombie is a generic 2/1 that costs 1B but "Unearth: B" gives the card some depth.

A bunch of lands were added. City of Brass produces any color of mana but also deals damage to you. Exotic Orchard is quirky land that depends on the lands that you opponent has. Reflecting Pool is similar but it depends on the lands that YOU control, basically it clones one of your lands.

Some older cards include: Copper Tablet, 2, artifact, which deals 1 damage to each player during their upkeep, sort of a clock of doom. The Rack, 1, artifact which punishes your opponent for having more than 3 cards, combine this with Howling Mine and force you opponent to draw cards with Ancestral Recall for maximum damage. The land Diamond Valley "tap: Sacrifice a creature: You gain life equal to the sacrificed creature's toughness." And the enchantment Karma which punishes your opponent for using Swamps.

AND, I almost forgot, Quest now has a Card Shop for added variety. The quest mode is the best way to play against the computer, oh the thrill of victory! :)

Forge has a ton of just fun cards like the green morphing Thornling which has 5 activated abilities or Isochron Scepter that lets you abuse any cheap instant or the artifact Time Vault which lets you skip a turn now for an extra turn later.

In the deck editor if you want to look at the new cards, click on the "Sort By" menu and select "Newer cards first". (I know that sounds a little weird but I didn't know what to call it.) Sometimes a card will be redone as a keyword, so while the card isn't strictly new, its implementation is new. (Some cards are created at runtime using special keywords that represent spells and abilities. Look at Exotic Orchard, Shock, or Vithian Stinger in cards.txt for more info.)

Forge 04-10 Version (8 MB) - 04-10 is when it was released on the forums.

Download Pictures
(78 MB) - The card pictures can be downloaded by the Forge program or you can just grab this file.

Monday, May 3, 2010

How Good Is Java?

I wrote Forge using Java for mainly one reason: I know Java very well. I've worked with Java for a number of years and I enjoy it. Using Java has resulted in a few positive consequences such as Forge being portable and able to run on Linux and Mac which probably accounts for roughly 5-10% of the downloads. People from both communities seem excited to play Magic. Magic knows no boundaries, not even operating systems, ha.

I was worried that people might not have Java installed on their computer. While this may be a problem a small percentage of the time, most people seem to already have Java. Part of me really hates requiring users to download extra libraries like Java. I honestly thought about programming Forge in C++ because it wouldn't require any extra libraries.

(I personally see Java as a cleaner C++. Java seems to be at the same level of abstraction as C++ since both languages make it hard to pass a function to a function, so called higher order functions. And technically yes you can do it in C++, Java, and even in C if you want to but it is very messy.)

Java isn't perfect. It is a little slow and the default user interface will always look fake compared to normal Windows components. (Yes I know that this can be solved by using libraries like SWT which let you use native gui components. I already knew Java's Swing so I used it.) Other than that I can't think of any real weaknesses. Forge is a relatively straightforward program and I always knew that I could coerce Java to do my biding given enough time.

Java seems to be one of the more popular languages, at least according to langpop.com, which uses a variety of sources in order to calculate the popularity of computer languages. Language popularity is important because people might submit code if they know the language. Forge has around 3 active coders and two of them learned Java just so they could help out, "Hi Rob and Chris." (I'll say hi to Dennis, the current lead developer, so he won't feel left out.)

Other Magic programs that I know of have used languages other than Java. Incantus uses Python which lets you easily create higher order functions and has other properties of a dynamic language. Wagic is designed to work on a PSP uses C++ and has to deal with limited memory issues. (Just thinking about memory issues scares me half to death.) MagicWars uses Java and is based on Forge's code. And Firemox uses Java also.

For a quick summary of the above programs:
Player versus player over the Internet: Incantus, MagicWars, Firemox
Player versus the computer: Wagic, which also runs on Windows, Linux, Mac

Make sure to come back on Wednesday, I'll be posting a new version of Forge.

p.s.
On a side note, I have also taken Sun's Java Programmer's test. The test really helped me understand Java because it went over some obscure details. I would recommend taking a certification test for whatever language that you use the most because it would challenge you to learn the "nooks and crannies" that you normally overlook.

p.p.s.
And the most green mana symbols on a card goes to....Khalni Hydra with an outstanding 8. How many years will this record last? Who knows?

p.p.p.s.
I can’t seem to get done, too many postcripts. “C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows away your whole leg” from Bjarne Stroustrup, creator of C++. I got that quote from the oustanding book “Expert C Programming” by Peter van der Linden. The book is mostly about C and answers obscure questions about C and dives in the mysterious world of pointers.

The book also answers the question of why this code snippet doesn’t compile. “Since the types char ** and const char ** are both pointers to unqualified types that are not the same type, they are not compatible types.

foo (const char **p) {}

main(int arg, char **argv)
{
foo(argv);
}

Monday, April 26, 2010

Should Forge Have Bad Cards? - Part 2

People seem to really enjoy this topic, so I thought that there should be a sequel. One person commented that Mark Rosewater (big-shot Wizard guy) wrote a very good article about this subject, When Cards Go Bad. One of his explanations is that "Magic is a game of discovery." Cards that you thought were bad can be very good in the right deck.

I think that Forge should have less powerful cards so you can enjoy the really powerful ones. Mark Rosewater says, "Ancestral Recall is only very good unless we print a card that lets you draw 4 cards for U". If you never used less powerful cards, you would have no idea that such-and-such card was really powerful.

I love so called "bad cards" because they provide variety. In quest mode I have enjoyed using a variety of mediocre cards because those were the best cards that you had at the time. In the right deck a "bad card" magically transforms itself into a pretty decent card.

Shimmering Barrier is a good example of a fairly weak card, "1W, 1/3 defender, first strike, and cycling 2". This type of card was very good in my last quest deck because I had some flyers and he helped me jam up the ground attackers. Inner-Chamber Guard seems weak at first glance, "1W, 0/2, bushido 2 (When this blocks or becomes blocked, it gets +2/+2 until end of turn"). I half-heartedly threw this guy into my deck but he is an awesome 2/4 blocker that only costs 2 mana, wow.

Samurai Enforces is a little generic looking, "4WW, 4/4, bushido 2" but he works very good as a finisher. Patrol Signaler is a little 1/1 that has an untap ability, " 1W, Untap: Put a 1/1 white Kithkin Soldier creature token into play". Creating tokens for only 1W is very cheap and when the computer's deck was slow, this little guy dominated the field by generating a ton of chump blockers. Icatian Priest is a 1/1 that costs W and has a nice pump ability, "1WW: Target creature gets +1/+1 until end of turn" which dominates the game in the later turns.

And the list of crappy cards could go on and on. I remember thinking how bad Tarmogoyf was when Future Sight was first printed but he turned on to be a pro-tour winner in the right deck. Forge has Tarmogoyf, so go and have yourself some fun. :+]

Monday, April 19, 2010

What is a Card?

What is a card is a complicated question. In real life a card is a physical object. In Forge a card is a class, a piece of code. At first the card object started out simple. It had the basic methods: getName(), getManaCost(), getOwner(), getController() and getAttack(), getDefense(). But as Forge grew the card class grew as well. Now the card class has two pages of variables and around 200 methods. (I’m not saying that the Card class is too big, I’m just saying that it is big.)

The Card class keeps track of lots of information such as “is this card tapped”, “does this creature have summoning sickness”, and “which keywords does this creature have”. The Card class also keeps track of other obscure data like “who dealt damage to me”, “is this card uncastable”, “did this creature attack or block this turn”, “is this a morphed creature”, “should this card be sacrificed at end of turn” and “how much damage does this card deal damage during the upkeep”.

Other convential Card attributes include keywords and Forge implements a whole number of Magic keywords such as flying, haste, wither and as well as other “internal keywords” that correspond to spells and abilities, which makes it much easier to add cards like Shock and Ancestral Recall. Forge’s “interal keyword” system has gotten very sophisticated and implements such cards as Blossoming Wreath. A full list of keywords can be found on the forum here.

Blossoming Wreath
G
Instant
no text
spGainLife:X:You gain life equal to the number of creature cards in your graveyard.:Blossoming Wreath - player gains X life
SVar:X:Count$TypeInYourYard.Creature

In real life Magic if a card creates or copies a card, a token is created. In Forge the same thing happens except that a token has special properties like it cannot go to the graveyard or be bounced to your hand. One of the first “extra” methods that I ever added to the card class was setToken(boolean) and isToken() which simply answers the question, “Is this card a token?”.

The first card that created tokens was probably Future Sight’s Llanowar Mentor. An odd thing happened when I used its ability. A token was created but I was surprised to see that the token had the picture for Llanowar Elves. The second token maker I coded was Raise the Alarm which makes two 1/1 tokens for 1W. And the third card was probably the awesome, fan-favorite Kiki-Jiki, Mirror Breaker.

WOW, I just realized the Forge now has 11 cards with unearth. (1R: Return this card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)

You can see the full Java source code for the Card class here.

p.s.
Technically the methods getAttack() and getDefense() should be named getPower() and getToughness but I like the terms attack and defense better.

p.p.s.
In case you don’t understand, the words “object” and “class” they just mean “lines of Java source code”.

Friday, April 16, 2010

Rise of the Eldrazi

The official visual spoiler for Rise of the Eldrazi is out

Wizards Visual Spoiler

Wizard articles you might have to read:

Creatures On Another Level - talks about the new "level up" creatures.

On the Rise - Mark Rosewater talks about the set design.
-part 1
-part 2
-part 3

Below is taken from Wizard's Rise of the Eldrazi product page:

But unknown to the plane's denizens, there's a sinister reason for Zendikar's danger: for millennia, the plane has served as a prison for the Eldrazi, astral monstrosities native to the Blind Eternities. Now, the perils facing adventurers on the plane of Zendikar have taken an even deadlier turn. The Eldrazi have been released.

Hailing from the Blind Eternities, the space between planes, the Eldrazi have transcended the colors of mana as we know them. As a result, the Eldrazi progenitors themselves and those closest to them are colorless. But don't let the mana cost fool you—these Eldrazi are not artifacts.

Each of the colossal Eldrazi spawns its own "brood lineage." The three brood lineages are composed of Eldrazi Drones and other subordinate beings, each reflecting the image of its progenitor. The smaller Eldrazi Drones that are aligned with colored mana and many of these drones, as well as some spells, produce Eldrazi Spawn creature tokens. These 0/1 colorless creatures can be sacrificed to add one colorless mana to your mana pool—perfect for casting those enormous Eldrazi.

The Rise of the Eldrazi set also marks the debut of colorless instants and sorceries. Like their Eldrazi creators, these versatile spells can be put into almost any deck.

Monday, April 12, 2010

This and That

I don't have anything specific to talk about so I downloaded Forge's source code. I'm just going to talk about various things that catch my attention.

Door to Nothingness is an interesting card that lets you win for only 10 mana, what a deal! I had no idea how it was coded since Forge doesn't have specific way to make one player win (or lose) a game. As it turns out the implementation was very simple, the losing player's life was set to 0, voila.

I didn't know Forge had Goblin Charbelcher. It is an odd card that rewards decks that use fewer lands or you can rearrange your deck with cards like Sensei's Divining Top.

I remember coding Erratic Explosion a long time ago and that card always makes me laugh because it is very, well... erratic.

The deck editor "filter" option takes up a hefty 700 lines of code. I find it very useful, so I don't really care how many lines it takes but I do get curious. The guy who coded the filter option used CloudGarden's Jigloo SWT/Swing GUI Builder (www.cloudgarden.com). I don't know anything about Jigloo but I'm going to check it out.

Some parts of Forge have been rewritten and improved like the way Forge's stores decks. All decks are now stored in separate deck files which is great. Originally I crammed all of the decks into one single file which has its pros and cons but generally it makes it harder to download new decks.

The biggest improvements have been the user interface. People sent me code that resizes the card images in order to display them on the battlefield. The "removed", "grave" and "flashback" zones can easily be viewed just by clicking on them, which is a nice little feature. New high quality scans of Magic cards can be downloaded so can satisfy you inner Vorthos and drool over the fantastic card art. Other huge improvements include X spells like Blaze and adding a mana pool for cards like Dark Ritual.

Since I'm not slogging through the source code everyday, I forget how big Forge's source code actually is and how much new stuff that has been added. When I stopped working on Forge it didn't have any aura's (creature enchantments) but now there are 55. Dennis, Rob, and the other guys on the forums have added many great features and cards to Forge.

And I didn't know Forge had Force of Will, which is insanely powerful.

It seems weird to thank you for downloading Forge and reading this blog but thanks anyways. Forge was literally started in a garage on a whim. Much of the framework that I wrote has changed. I didn't think it would ever become this successful. I personally think Forge is insanely fun (and replayable).

Thanks to the guys on the forums for the great updates and thank you for downloading this kid's dream. (OK, I'm a big kid but I'm still a kid a heart.) And of course thanks to Wizards and Richard Garfield for creating a game that is so enjoyable. Even 5 and 10 year old cards are still fun which is quite an accomplishment.

p.s.
Not all of Garfield's games are as good as Magic but he is a very talented game designer.

Monday, April 5, 2010

Should Forge Have Bad Cards?

When I first started working on Forge I thought that it shouldn't have any "bad cards" because no one would use them. But after thinking about it, I decided that Forge should have every Magic card that it could support.

I thought that I could easily classify cards as good and bad but the lines get fuzzy very quickly. Sometimes a mediocre card might be good in a tribal deck or maybe that card is pretty good in one of Forge's "limited modes" like sealed, draft, or quest. If you are using all of the cards you probably wouldn't include many 3 mana creatures that are only 2/2 but they make up the backbone of most limited decks.

Winding Wurm is a good example. He is a 6/6 creature that costs 4G but also has an echo cost of 4G. (Echo means that you have to play 4G again on your next turn, so the total cost is 8GG.) Back in the day this card might have been used in a constructed deck but without trample he is a little weak. I happen to get him during a quest and he was amazing. Even though he didn't have any other abilities, he was a one man Godzilla. Winding Wurm is mediocre is some formats and exceptional in others.

This is also a good example of why I don't think Forge is costing Wizards any money. Most of the cards in Forge are not in print. Also, Forge enables players to use fascinating cards from Magic's long history like Winding Wurm, Ali from Cairo, and Skullclamp.

p.s.
I wanted to write an April Fool's column like, "Wizards is going to buy Forge" or "I got hired by Wizards" but I didn't want to be too stupid.