Monday, March 24, 2008

Wizards is Trying to Kill Me

Yes, the tagline is totally outrageous and false, like all good taglines. :) Checkout Beseech the Queen, a new Shadamoor card. That is some funky mana. I assume it means “You can pay BBB or 2BB or 4B or 6”. This has to be correct or very close since Mark Rosewater (head Wizard card designer) mentioned that the converted mana cost is 6. What this means to me, is more programming and more headaches, aka Wizards is trying to kill me. (By the way that sounds like a bad Dungeons and Dragons dream.)

A few weeks ago, while waiting for a job interview I sketched out an idea to program hybrid mana costs, introduced in Ravnica. And while I didn’t get the job, I did come up with a pretty nifty solution. Thankfully with a little bit of tweaking, it worked. I’m not sure exactly how to implement this new mana cost, but maybe something will come to me. If not, I’ll just code, test, debug, and repeat until finished. Hopefully it will only take me 1 hour, but maybe I’m just blowing my own horn.

Currently the mana cost is just a string. A string is a sequence of letters like “I am a string”. All text that you see on the screen is a string. This new mana, along with split cards, make any operations like finding the converted mana cost more difficult. The solution is to replace the string mana cost with a class that represents the mana cost.

A class is a collection of operations, called methods, that act on the same data. A number class would have methods add and subtract. The mana cost class should have methods like getConvertedCost and getCardColor. The card’s color is important and is usually determined by the mana cost, some exceptions are Pact of Negation and Ancestral Vision. The mana class could also have the methods addToCost and reduceCost for cards like Thorn of Amethyst (Noncreature spells cost 1 more to play) and Cloud Key (Spells you play of the chosen type [Creature, Instant, etc...] cost 1 less to play).


Anonymous said...

Hey Forge -- I'm not sure who you're interviewing with, but with your skills, you should have no trouble. I am a former IBMer and would have picked you up in a second. Don't settle on a lame IT gig.

incantus said...

Hey Forge,

I was recently thinking about implementing hybrid mana costs in Incantus as well, and came to the same conclusion as you. I was using simple strings for mana, but when you can have conditional mana it's really hard to represent that as a string. But that means I have to completely redo the way I treat mana (if I want to go the object route). By the way, are there any cards that generate hybrid mana, or only cards that require it in their costs?

Rob Cashwalker said...

Hybrid is (currently) only an alternative cost kinda thing. G/B means you can pay either G or B, not 1/2 green and 1/2 black like in Un-land. There were the bounce lands and signets that produced GB (total of two mana, one green and one black) which covered the full cost of the guildmages.

incantus said...

That's what I was thinking. It would be too much bookkeeping during game play to produce hybrid mana (ie {W/B} mana that could satisfy either W or B or C mana requirement), especially when the mana ability could just give you the choice between generating either W or B. So it's only for costs.

Silly Freak said...

It really is that way. CR says producing W/B means the same as producing W or B. However, the reminder text of the dual lands says "T: Add W or B to your mana pool." But it really doesn't matter.

Forge said...

Well I have had a few interviews, but no one is really impressed with my programming skills, not even Wizards.

I just enjoy programming. It is a challenge that I am good at. I know Java pretty good and now I am conquering Python (with good success). I'm glad a former IBMer has my back, lol. IBM = Big Iron :)

Forge said...

About strange mana. Internally I will still represent mana as a string, but it will look pretty wierd (2/BG)(2/BG) This means that you can pay 4, 2G, 2B, or BG. Just regular hybrid mana would be like (BG)(BG), which requires BB, GG, or BG.

Other oddball mana includes Coldsnap's snow mana. That isn't very important, because well Coldsnap wasn't very important, lol.

Marek14 said...

I just found this site :)

When implementing hybrid mana, please remember Elemental Resonance and Phosphorescent Feast. When Elemental Resonance is on a hybrid permanent, the player should get an option what to get for every hybrid mana symbol in the mana cost (i.e. Golgari Guildmage with Elemental Resonance can give you BB, BG or GG).

And Phosphorescent Feast counts hybrid mana symbols as green if they have green symbols in them, so (g/w), (g/u), (b/g), (r/g) and (2/g) would all count for it.