Thursday, December 13, 2007

Layers in Magic The Gathering. Rules.

This article is designed to describe and explain Rule 418.5 of the Comprehensive Rulebook, highlighting the changes that occurred with the Ravnica update. This rule and it's subrules cover the interaction of continuous effects, which is one of the most complicated concepts in the game. I hope this article will make it easier for players and judges to understand it. Next week, I'll follow up with examples [And charts. Lots of charts. -Seamus] to illustrate the rules at work.

The continuous effect is governed by four concepts, which are applied in priority order:
1. Layers
2. Dependency
3. Characteristic-Setting Abilities before others
4. Timestamp

What I mean by "priority order", is that each of these four concepts tell you a way of ordering or grouping effects. What I'm saying is which ones trump which. For example, dependency trumps whether or not an ability is a characteristic-setting ability and timestamp, but layers trump dependency.

I'll explain each of these four concepts, how to tell order effects based upon them, and finally end with some situational examples. So, let's get started

Layers
There are six layers, with the last layer having five sublayers. These layers sort the effects by what kind of effect they are. In other words, they're sorted by categories of what they do. The layers, in order from earliest applied to last applied, are:
Copy—Copy effects go here. Examples: Clone, Dimir Doppelganger
Control—Things that change an objects's controller go here. Examples: Control Magic, Vedalken Shackles
Text—Things that alter an object's text. Examples: Artificial Evolution, Mind Bend. [Note that this only refers to altering text, not adding or removing text. Humility doesn't fit in here. -Seamus]
Type—Things that change an object's type, subtype, or supertype. Examples: Opalescence, Mycosynth Lattice (1st ability), Sensei Golden-Tail, Blinkmoth Nexus.
Other—Anything that's not earlier in the list and doesn't alter power/toughness goes here, such as changing an object's color, or removing or granting it abilities. Examples: Shifting Sky, Humility, Mycosynth Lattice (2nd ability), Crimson Kobold, Kavu Runner.
P/T—Anything that alters power and toughness. This layer has five "sublayers". There is no rules discintion between the functionality of these as layers vs. sublayers, it's just clearer to understand with all the power/toughness effects grouped together in some way.

The sublayers for layer 6 are:

(6a) P/T CSAs—More on what a CSA (Characteristic Setting Ability) is in a minute (see 6c below). Examples: Maro, Nightmare.
(6b) P/T: Changes from resolving spells, triggered abilities, or activated abilities and changes from static abilities that set the P/T to specific number—Note this includes all P/T effects from things that resolve, regardless of what it does to the actual P/T. The "setting only" clause just applies to static abilities Examples: Giant Growth, Basking Rootwalla, Humility.
(6c) P/T: Changes from counters—Nothing too special here. That +1/+1 counter that's sitting on your Arcbound Ravager? Apply the +1/+1 here.
(6d) P/T: Changes from static abilities that adjust the power/toughness by increasing or decreasing them by a certain amount, not setting them to a number—Note the contrast here against 6b. Examples: Bonesplitter, Castle.
(6e) P/T: Switching—Apply switching of power and toughness here. Examples: Aquamoeba, Strange Inversion.

Splitting layers for fun and profit
As you'll notice, some effects apply in multiple layers. I cited Humility above as being in both 5 and 6b, for example. These are handled by splitting the effect up so each part applies in the appropriate layer. The "remove all abilities" part of Humility's effect applies in its layer (layer 5), and the "are 1/1" part applies in its layer (layer 6b).

Also note that an effect "locks in" what it does and what objects it applies to the first time any part of it is applied. So even if the effect generated by Humility removes the ability (because an Opalescence is in play, making Humility a creature), the p/t altering part will still apply.

(Reversal Note: It used to be that if some part of effect applied in the type layer (layer 4), and the rest applied elsewhere, that you'd apply the entire effect in that layer, without splitting it up. This is no longer the case. Also, the part about "locking in" the effect the first time part of it applies is a new concept that was previously not true.)

Dependency
If you read the rulebook, the first think you learn about dependency is that two effects in different layers cannot depend on each other. This is true, but if you follow the Layer-Dependency-CSA-Timestamp model, whether or not it is true becomes irrelevant, so I won't bother getting into it further.

Beyond that, you can determine dependency as follows: Effect A is dependent on Effect B if applying Effect B before Effect A would do any of the following:
change the text or the existence of Effect A
change what objects or players Effect A will affect
change what Effect A does to any of the things it applies to

For example, if something gives all creatures a given certain subtype, like Goblin, it depends on an effect that changes all lands to creatures, as changing the order they're applied in will change if the land-creatures become Goblins or not. Hopefully, this concept is fairly intuitive. [Don't confuse 'intuitive' with 'straightforward'—I've watched a cadre of Rules Managers, Level 3 and 4 judges, and Magic Online programmers bicker about whether two effects were dependant or not. -S]

How does this help define the order? The answer is simple. An effect dependent on one or more other effects can't apply until all of those effects have applied already (and it waits to do so). This means those land-creatures will end up being Goblins, in our example.

Note: It is possible for there to be a dependency loop, where Effect A and Effect B both depend on each other, for example. If this occurs, just ignore dependency entirely for those effects.

Characteristic-Setting Abilities (CSAs)
Looking at the glossary, a Characteristic-Setting Ability as an intrinsic ability that states the object the ability is on either:
"has" one or more characteristics
"is" a particular type, supertype, subtype, or color
has characteristics that "is" or "are" certain values

There's really not a better way than this to determine what a CSA is. Fortunately, it's easier to think about why we care about CSAs at all.

The idea is that they are abilities that define characteristics (power, toughness, color, etc.) that can't practically be on the card. Color is normally defined by mana cost, so Evermind (a card without a mana cost) cannot have a color, unless it is defined explicitly another way: by saying "Evermind is blue." on the card. Maro is similar, as it reads "Maro has power and toughness equal to the number of cards in your hand." There's no way to print this in the power/toughness box of the card, so an ability provides this instead.

Effects from CSAs apply before those that aren't from non-CSAs, unless (remember the precedence order) the layers or dependency indicate otherwise.

(Reversal Note: CSAs used to be applied before non-CSAs, even if a CSA was dependent on a non-CSA. This is no longer the case.)

(Reversal Note: In the past, a CSA could be granted on to an object, instead of having it intrinsically, and it would still be considered a CSA. This is no longer the case.)

Timestamp
Finally, we get to timestamp. The timestamp of an ability is, in general "when its effect began". Explicitly:
Spells, activated abilities, and triggered abilities have the timestamp from when they resolved.
Static abilities that are granted onto an object have the timestamp of when the ability is granted.
Static abilities that are on the object itself have the timestamps of when the object entered the zone that it is in.
Finally, an object that becomes attached to another object, and any abilities on the object being attached, get their timestamps reset to the time when the attach occurs. Note this actually only occurs if it wasn't attached before; attaching an object to an object it was already attached to doesn't get its timestamp reset.

Finally, it's possible that objects would get the timestamp by coming into play simultaneously due to an effect such as Replenish. If this occurs, the active player at the time chooses a relative timestamp order. Note that this does not change the fact that they come into play simultaneously; it just provides an order for continuous effect evaluation. Any triggered abilities will still see them all come into play simultaneously. This order is chosen at that time, and cannot be changed later.

So how does timestamp effect ordering? Simple. The earlier the timestamp, the earlier it applies. And, since timestamp (with the "active player" tiebreaker) provides a definitive order for all effects, then the order is never ambiguous.

Is all this really necessary?
Why all these layers? Why are they in this order? Is this just some random arbitrary order? No, it's not at all random. These came about by looking at all the cards and looking at the "natural dependencies". Control changing stuff needs to happen early, because a lot of effects depend on who controls a permanent. A lot of random effects depend on the type, supertype, and subtype effect of an object. Finally, no continuous effect modifier cares about the power/toughness of a creature, so those are last, and so forth.

Additionally, R&D spent time coming up with the "right answers" to the questions, and the rules were written such that the result of applying the rules was these "right answers". So are the "right answers" arbitrary, then? In a manner of speaking, yes. But a lot things are designed so they line up with the way it is believed most players who didn't know or didn't have access to the rule would assume it would work, and these layers (especially the Ravnica changes) attempt to accomplish just that.

That's it for now. We'll return shortly with examples to show these concepts at work. Thanks for reading!

-- Lee Sharpe, lee DOT sharpe AT gmail DOT com DCI Level 3 Judge