Tuesday, August 3, 2010

Simultaneity: Warp World

The first time I mentioned simultaneity is with combat. It was just a coincidence that this was the first time, but it is very reasonable, because simultaneity happens very often during combat: Technically, creatures become attacking creatures simultaneously, then the same happens with blockers, damage etc.

Simultaneity means multiple things, and I'm not sure if I have a full understanding of these. I'll take the example of Warp World, which is a classic example for discussing timing:

Each player shuffles all permanents he or she owns into his or her library, then reveals that many cards from the top of his or her library. Each player puts all artifact, creature, and land cards revealed this way onto the battlefield, then does the same for enchantment cards, then puts all cards revealed this way that weren't put onto the battlefield on the bottom of his or her library.

First, all permanents are shuffled into their respective owner's library, triggering from leaving play. All these abilities see all the cards leaving play, meaning that an ability like "leaves the battlefield" sees all the permanents. There is no variant where that ability leaves early and isn't active when the permanents leave play.

The "then"s in the card's text neatly separate the parts that happen simultaneously. All "enters the battlefield" abilities of cards trigger for cards that enter the battlefield at the same time as them; it seems like the abilities are active just a little earlier than they are in play... it's a little awkward in my opinion.

now hold on - Auras with "Enchant Enchantment" won't make it on the battlefield, because Enchant is not a triggered ability. The Comprehensive rules don't specify a wording for Enchant but rather give it extra rules. It feels, however, like a replacement effect, just like "As ... enters the battlefield" (which don't use the stack at all - they are effects generated by static abilities).

Lands with additional costs, like the painlands, are worded like this, because if it was a triggered ability, you could play the mana ability in response to the cost. So, just like "Enchant Enchantment" enchantments (^^) don't make it, lands like "As ... comes into play, return a land you control to your hand. If you don't, put ... into your graveyard instead." won't, too. Champion, however, is a triggered ability, so your champions can survive. you can even enchant the creatures you wish to exile, because the triggered abilities won't resolve or even be put onto the stack until Warp World finished resolving.


One last thing: after resolving the spells, all the abilities are put onto the stack, in an order depending on player seating and player choice. you can put abilities from entering the battlefield on the stack earlier that those from leaving the battlefield, even though these happened in another sequence...

4 comments:

nantuko84 said...

what you are describing is the most trickiest part of mtg implementation. along with sorting abilities\effects in the stack and last known information. =)

Silly Freak said...

sorting abilities/effects doesn't sound hard. I think it just means to store a list of abilities before actually putting them onto the stack when a player would receive priority. Getting the right order is trivial once you store them in a separate list.

Last known information... don't even mention it! why do the things that feel so natural have to be so hard to program?

nantuko84 said...

I remember someone suggested to use undo system for last known information. you just go back to the past to find the card you need on the battlefield.

Silly Freak said...

well, that was me^^ I'm not entirely sure if that is a good idea, but the fact that you can look at the whole game state at any point in time sounds good, as you can't forget to save some parameters needed for an effect. Do you save power? of course, but do you also save counters, copy effects, if power and toughness were switched? no need to think about

I will outline the problems I see in a separate post, because it makes for some great analogies^^