Pattern Recognition #23 - The Stack

Features Opinion Pattern Recognition

berryjon

6 April 2017

2662 views

Hello everyone! My name is berryjon, TappedOut's resident Old Fogey, and general opinionated person. Welcome back to Pattern Recognition, where I talk about whatever crossed my mind.

And I've just realized that I've been writing this for six months now, give or take. Huzzuh!

Today's subject is one that will really help cement how old of a Magic player I am. Today, I'm going to talk about The Stack. For the vast majority of you, you are totally comfortable with this concept in Magic, and can recite the rules or it easily. For people like me though? Well, we remember when the Stack wasn't a thing.

Normally, I would start with the origin of the idea, then work my way forward to the glorious present, but the more I think about it, the more I suspect that going backwards would better serve my purposes.

I want everyone reading this to realize that this isn't an official ruling. This is my trying to explain one of the more complicated rules in the game in more general language. Don't cite me when you call for a Judge! I am hoping to impart understanding, not telling you how to exploit it to your advantage!

So, the Stack. This is a set of rules in Magic that determines the order in which things happen once spells are being cast. And for the most part, it's actually quite simple. you play a spell, your opponent has a chance to respond, and everyone winds up happy - or at least tolerant of the outcome. Let me give an integrated example.

When doing the old Judge Training, all of our example scenarios were given with two player's names. One always began with A, and the other with N. Why? Well, they represent the Active Player and the Non-Active Player. What's the difference? Well, the Active player is the one whose turn it is, and therefore 'controls' the Stack, for the given definition of 'control' where the rules are quite clear about who can do what and when.

In it's default state, the Stack is empty. There are no spells or abilities on it, and that means that nothing is actually happening. The Active player is always the first person to have the opportunity to add a spell to the stack. That can mean casting anything. In this first example, our Active player ... let's call them ... Andy ... Andy will cast a creature spell. Raging Goblin.

Andy, with sufficient mana in the mana pool, puts the Raging Goblin onto the stack. After leaving Andy's hand, the creature doesn't actually enter the battlefield yet. Rather, it exists on the stack. Andy then passes priority to the Non... Nancy. Nancy will be our other player. This "Passing Priority" is the signal that Andy is letting Nancy perform any legal action she could. In this case, she passes back to Andy.

Andy now chooses to resolve the stack, being the Active player, and all other players having a chance to react. This is the important part - The Stack cannot be resolved until all players have had a chance to react to the latest action. This may seem simple, but it can get confusing in multiplayer games.

Anyway, there is only one spell on the Stack - Raging Goblin - so it now resolves. To Resolve is to complete the effect of the card. And in this case, it is the creature entering the battlefield. The Stack is now empty!

This is all a very complicated way of describing "Andy casts Raging Goblin", isn't it? Well, the technical details are about to get a little more complicated. Let's reset, and add another complication. Andy has Dragon's Claw. Now, he casts Raging Goblin, and before passing priority, he chooses to trigger the Dragon's Claw.

A Trigger, or a triggered ability, is a reactive action that comes from permanents, be they on the Battlefield, in the Graveyard, in hand or even in Exile. Some are optional, some are not. But the key to them is that they are reactive. Something has to happen first before they can be put onto the stack. In this case, the Dragon's Claw allows for the controlling player to gain one life when a spell is cast.

Now, Andy can add as many things as he wants to the stack, but he still has to pass priority and allow their opponents to respond before he can actually get the benefit of any of this. And in this case, Nancy does nothing, passing priority and allowing the stack to begin to resolve. Neither player actually controls the stack during this process, as it is automatic in nature. And as the stack resolves, everyone gets a chance to add new cards or abilities to the stack after each effect is removed.

The Stack has an interesting property to help sort out the order of operations, or how the cards are resolved. And that is "First In, Last Out," or "FILO". If you are concerned that you don't understand what that means, imagine that whenever a spell or ability goes onto the Stack, it is added on top of the previous spell or ability, like a pile ... or even a Stack of cards! And once the stack is being resolved, the card at the top of the pile is resolved first, then the next effect below it and so on and so forth until everything has been taken care of.

In this case, the stack looks like this:
Dragon's Claw (In response to casting Raging Goblin)
Raging Goblin

Now that the stack is being resolved, the Dragon's Claw goes first, giving Andy 1 point of life. Then the Raging Goblin resolves, entering the battlefield.

Time for another complication. Nancy has a Soul Warden on the battlefield. Everything happens as it has in the last example, but now as the Raging Goblin resolves, the Soul Warden can now be triggered.

Here's the important part you have to remember - once the Stack starts to resolve...

No. That's the wrong phrasing. But it's just too easy to write. So from here on out, when you see me say "when the stack starts to resolve", what I'm really saying is that that is "when the topmost object on the stack resolves". That's more accurate, but more wordy. So, when the topmost object, be it a spell or ability on the stack resolves, more abilities and actions can be added to the stack, going on top and being resolved before the original portion of the stack can be taken care of. In this case though, the triggering condition is "Whenever a creature enters the battlefield". This means that Nancy can add the Soul Warden's effect to the stack as the Raging Goblin leaves it. Then Andy has a chance to respond, and the Stack can resolve as normal.

In this example, both Andy and Nancy are both at +1 Life, and Andy has his creature in play. The stack started empty, had things added, technically-but-not-really resolved to empty and then added again then resolved again.

Yeah, it's a headache. And I'm about to make things more complicated.

Same set up. Andy has Dragon's Claw, Nancy has Soul Warden. Andy casts Raging Goblin. Now, in response, Nancy casts Bone to Ash. Now, she has to declare the legal target for the spell, though in this case, the target is obvious. The Stack currently looks like this:
Bone to Ash (Targeting Raging Goblin)
Dragon's Claw (In response to casting Raging Goblin)
Raging Goblin

With no further responses, the Stack starts to resolve. Bone to Ash resolves, countering Raging Goblin. Nancy draws a card as her counterspell resolves (though technically, she draws after the Goblin is countered), and both cards are removed from the stack and placed in their respective owner's graveyards. At this point, the stack looks like this:
Dragon's Claw (In response to casting Raging Goblin)

At no point does the Soul Warden trigger.

First thing; Bone to Ash has two effects despite being only one card. Thus, both effects have to resolve when the card goes off the stack. And to determine the order in which they happen, it's the order in which things are written on the card. So for Bone to Ash's case, the counterspell effect happens first, then Nancy draws a card becuase they are on two separate lines.

Story time! This one was related to me by someone whom I trust, so I'm willing to bet it happened. Back during the Lorwyn/Shadowmoor block, there was a certain Standard tournament going on. One of the players was playing Fairies, and the other was running some Aggro deck. The Aggro player dropped a creature, and the other player responded by playing Cryptic Command, choosing to counter the creature and draw a card. That player then draws their card before the Aggro player could respond. Naturally the Judge got called, and the situation was explained. The Blue player says it wouldn't make a difference, there is nothing the Aggro guy could do and it was two separate things anyways.

Aggro taps a Mountain and casts Guttural Response on Cryptic Command. Spell countered, and the Blue player has to return a card from their hand to their library, then shuffle it to avoid foreknowledge of the next draw.

So, never assume your opponents can't do anything, and always resolve all aspects of a card at the same time.

Here's the second thing. Despite the removal of the initial trigger, the Dragon's Claw is still on the stack. Spells and abilities on the stack exist independent of their sources. Nancy won't do anything else, so Andy gets his point of life as a consolation prize.

Counterspells are the primary means of interacting with the stack. Not to say that they are the only one, but the one most people will have experience with.

So, one more example, then I move on to history lesson time!

A spell, you see, must have a legal target both when it is cast, and when it resolves. That is to say, if you're in a position where a spell you have cast, has their target removed or rendered invalid by other spells previously resolved, they fizzle, which it the technical term for 'spell has no effect, and goes to the graveyard'.

This one did happen to me, and it one of the reasons why my hatred of Jace Beleren is eclipsed only by my rage at the existence of New Phyrexia.

I was playing casually, a deck, and my casual opponent goes second. I play New Benalia, and scry, then pass the turn. My opponent plays an Overgrown Tomb, then taps it for Glistener Elf.

I could see where this was going. Thankfully, I have a solution in hand. Turn 2, I play a basic Plains, and pass. It's casual, I could afford to mess around, right?

My opponent plays a Forest of his own, and on his first main phase, casts Might of Old Krosa on his Elf. He then declares he's moving to the Declare Attackers step. I agree. He swings with his Elf. I agree. He casts Giant Growth on the Elf with his last free mana, then throws Mutagenic Growth on for the finisher. He proudly declares that I've taken 10 poison damage, and therefore I die. Both spells are still on the stack at this time, he's just assuming there is nothing I can do to counter it.

I smirked, then announced my counter. "In response to you playing Mutagenic Growth on your Glistener Elf, I cast Bathe in Light on your Elf, giving it Protection from Green."

Those of you who recognize what I just did keep quiet. The rest of you? Read on.

So, here's the Stack at this time:
Bathe in Light (Targeting Glistener Elf, with 'Green' as the chosen colour)
Mutagenic Growth (Targeting Glistener Elf)
Giant Growth (Targeting Glistener Elf)

Bathe in Light resolves, and the Elf now has protection from Green. What this means is that the Elf no longer takes damage from Green sources, and cannot be targeted by Green spells.

Mutagenic Growth, being Green, fizzles, as while the Elf was a legal target when the spell was cast, it is no longer a legal target, and is discarded without effect as it resolves.

Same thing happens to Giant Growth.

Nothing I could do about the Might of Old Krosa spell, though, and I still take five damage and five poison counters. But now my opponent has failed his attempt to kill me in one blow, and is in a bad position to recover from, especially when I play Order of the White Shield on my turn three. Hey, I did say this was casual!

However, had the opponent cast and resolved each spell individually, rather than adding things to the stack without thought to my two untapped mana, then they could have allowed more damage through and I would have been in a worse position. But my opponent was getting ahead of themselves. You see, unless you have a pressing need to add more spells to the stack, you should also always let the stack resolve in smaller chunks rather than going all-in. This minimizes the damage a single spell can do to your carefully laid plans.

Now, it is time for the history lessons.

The nature and invocation of the stack has changed over time, usually in response to other rules being updated and refined over the years. As far as I can tell, there are three major 'break points' where the nature of the stack had to be seriously revised in response to rules changes, and not simply made to have an iterative update.

Going backwards in time, the more recent change was removing Damage from the stack.

Nowadays, the rules have it that damage from a source is resolved at the same time as the source itself. I cast Lightning Bolt, and the three damage is resolved when the spell does. That wasn't always the case.

You see back before the M10 rules update (Thanks Boza for reminding me!), when a source would deal damage, that damage went onto the stack. So in the case of the Lightning Bolt, the spell would resolve, be removed from the stack, then the three damage would then go onto the stack.

This allowed players to act in response to damage.

Note that in this case, 'damage from any source' included combat damage between creatures. Which is where things really got annoying for Wizards. You see, one of the biggest responses to a creature taking lethal damage was to sacrifice it. Or, if you were white, tap something like Samite Healer to prevent the lethal damage now that you knew that there were no further surprises coming.

Wizards didn't like this, as it added a layer of complexity to the game that it didn't need, and the only time that it was invoked was when someone was abusing it for their own gain.

So in response, Wizards removed damage from the stack. But this had an interesting side effect with combat. You see, damage would still be resolved during combat. But now you had to be preventative with your responses, rather than reactive.

This of course led to its own rules interaction. What happens when an attacking creature has its blocking creature removed from combat? The answer is to, when this sort of thing happens, is that the creature is still considered blocked, but by nothing. A nothing that has an effective toughness of 0, which only matters when the attacker has Trample to blow through the lack of toughness and still deal damage to the defending player or Planeswalker.

Yeah, way to make things simpler there, Wizards.

Now, the next previous update to the stack is actually much, much older. Like, 5th Edition old.

Let me introduce to you, the card type "Mana Source". Like Dark Ritual. Yes, you read that right.

So, let me explain just what is up with this. There are certain 'privileged' actions, ones that cannot be responded to. In most cases, adding mana to your mana pool is one of them.

The others are Morphing a Creature, and removing your clothes in response to Hurloon Wrangler attacking.

Well, that's not completely true. You see, those are pretty much the actions that you as a player can choose to make. There are some actions that ignore the stack, and happen without priority, but they are automatic in nature. Drawing a card during your draw step, or declaring attackers or blockers for example.

Anyway, adding mana to your mana pool would at first seem like a cut and dried thing. You just do it, and can use your mana on your spells. Except it's not so easy. When you tap lands for mana, the rules are quite clear. But what about Dark Ritual? Or Seething Song?

Well, in the modern rules, they go onto the stack. You don't actually add the mana to the mana pool until the spell resolves.

But before then, Wizards couldn't settle on a ruling. The card type 'Mana Source' was an attempt to resolve this issue by specifying that these cards were a Mana Source, and thus bypassed the normal rules regarding when spells could be cast and the rest of the stack as well.

As you might imagine, this was ... awkward. Because then you ran into problems like Llanowar Elves and other activated abilities. What was the timing on those? What happens when a creature is sacrificed to Ashnod's Altar? Can someone react to that?

((Answer: No. As it's part of the cost of an activated ability, you cannot react to that.))

Mana Source as a card and ability type was very quickly doomed. Too much confusion for too little gain. So the rules settled on the modern version: actions that directly add mana to your mana pool without additional requirements (such as with basic lands or Llanowar Elves) are privileged and cannot be reacted to.

Defined, a Mana Ability is an ability that adds mana to your pool (sorry, Impact Tremors), have no targets (sorry, Deathrite Shaman) and are not loyalty abilities (sorry, Koth of the Hammer). They can be activated without having something to respond to and they cannot be responded to.

For clarification, the Mana Filters from Odyssey and Lorwyn/Shadowmoor (Skycloud Expanse or Fetid Heath) and the Signet cycle of Ravnica (Grull Signet et al...) are bypass the stack, even though there is technically a cost to the action.

And that brings me to my last point. I really don't want to talk about it, but it needs to be done.

Let's talk about Interrupts

When Magic first started, there was no Stack. It was an invention to go with 5th Edition. There was sorcery speed, which is what Sorceries, Enchantments and Creatures used, Instant speed, which could be played in response to a sorcery, and Interrupts, which could be played in response to an Instant. Counterspell was the pinnacle example of its time. And once an Interrupt was played, only other Interrupts could be played. No Instants. As you were literally Interrupting the actions of another player.

Let me repeat that: There was no Stack, so casting could become a free-for-all as players tried to usurp each other and get their things done over, around and other players and their actions.

It's been 20 years on, and I still remember that system of play. It was ugly, and the formalization of the Stack was a godsend. (No, not Godsend. Yeesh.)

So, that's the history and vitality of the Stack. Any game that involves players reacting to each other (like all of them) will need rules to show how they interact. Magic went through growing pains, but the Stack is an elegant and workable solution.

I'm not going to talk about some of the other games I've played with bad rules. Those are memories best left buried.

Join me next time when I talk about something that ... well ... let's just say you won't see it coming.

Until then, I'm selling out! Or is that tapping out? Basic donors get a preview copy of the final article, while advanced donors get that as well as the opportunity to join me in a podcast version of the series

This article is a follow-up to Pattern Recognition #22 - I Hate Jace The next article in this series is Pattern Recognition #24 - Ninjutsu

Izu_Korasu says... #1

Gruul Signet not grull

aside from that, in the infect stack:

"Nothing I could do about the Might of Old Krosa spell, though, and I still take five damage and five poison counters. But now my opponent has failed his attempt to kill me in one blow, and is in a bad position to recover from, especially when I play Order of the White Shield on my turn three. Hey, I did say this was casual! "

while that is technically true, infect deals damage in the form of counters, so the damage+poison wording may confuse readers ..... maybe a rewording like:

"Nothing I could do about the Might of Old Krosa spell, though, so I still receive five poison counters. However my opponent has failed his attempt to kill me in one blow, and is in a bad position to recover from, especially when I play Order of the White Shield on my turn three. Hey, I did say this was casual! "

aside from that, interesting read

March 30, 2017 10:36 p.m.

Hamster2558 says... #2

berryjon- You said that he cast Giant Growth before Mutagenic Growth at one time, then said he cast Mutagenic Growth before. Understood what you meant, but I'm just letting you know. Nice article btw, and I am hoping to see more.

April 6, 2017 3:56 p.m.

Rhadamanthus says... #3

I don't think it really matters in the long run, but a couple of things got confused in your explanation of older versions of the timing rules.

The "damage on the stack" that existed from 6th Edition through 10th Edition only applied to combat damage, not damage from other sources. Players would get priority after combat damage was assigned, giving them an opportunity to make responses before it was dealt. What you're thinking about when you describe damage from spells, etc. is from the older ABUR through 5th Edition rules. Right after any event that dealt damage, combat or otherwise, the game would insert a special Damage Prevention Step before checking state-based actions. During this step, players were allowed to respond with spells and abilities that could prevent or redirect the damage (and nothing else). 6th Edition was the first rule-set to introduce the proactive "damage prevention shield" concept, doing away with the Damage Prevention Step entirely.

The timing/priority structure before the introduction of the stack wasn't a wild free-for-all, but it was messy. The key terms are Batch and Series. Generally, the active player held priority while there were no active Batches or Series. Playing any non-"interrupt speed" spell or ability could start a Batch, and players could add "fast effect" responses to a Batch once it got started. When they were done, the Batch started resolving in LIFO order and everyone had to wait until it was completely finished before doing anything else. Any damage generated during the resolution of the Batch also waited until the end to be applied (meaning a Lightning Bolt in response to Giant Growth didn't kill the creature! weird!). Playing an interrupt-speed effect would immediately start a Series (a Series could be inserted into a Batch as a fast-effect response), and players were only allowed to add interrupt-speed responses to a Series. A Series resolved much like a Batch except for one quirk: after the topmost object resolved, all of it's controller's other objects in the Series would resolve in LIFO order, then the other player's remaining objects in the Series would start resolving in LIFO order (again, weird!).

So yeah, those details will never actually matter to anyone ever again, but since this is an educational series I figured I might as well throw in a contribution.

April 6, 2017 5:15 p.m.

jandrobard says... #4

Rest in peace Mogg Fanatic. You used to be relevant when damage was on the stack, now...

April 6, 2017 8:16 p.m.

Winterblast says... #5

I can still remember how angry we were about combat dmg being removed from the stack...back then it felt as if the game suddenly lacked complexity.

One question that is probably relevant for multiplayer games:
If the active player passes priority after casting a spell and the other players refuse to respond, does the active player again have a chance to respond to his own spell, or does the stack start to resolve automatically after the last passive player refuses to respond?

You wrote "Andy now chooses to resolve the stack, being the Active player, and all other players having a chance to react." which implies that Andy again has a choice if he wants to respond to his own spell or not. For example: I cast a Time Warp and pass priority to check if anyone wants to counter that spell - after every opponent has refused to respond, do I get priority again and can I still cast Twincast on my Time Warp? The opponents could still respond to the Twincast in this case, but I knew before casting it, that no one wanted to react to the original spell so it's unlikely they have any tricks left (such as countering the original spell, thus letting the twincast fizzle).

April 7, 2017 3:24 a.m.

AngryKitten says... #6

Those of you technical fellas probably know the stack is a "common"-ish programming data structure. Knowing how the data structure worked before ever actually playing made understanding how the stack works in MTG a breeze for me. Infoz here.

Also, thanks again for the great article, berryjon!

April 7, 2017 9:16 a.m.

TheRedGoat says... #7

So MTG used to be Yugioh? No wonder we have old cards that are busted as hell and yet others that are less useful than dirt.

April 7, 2017 11:49 a.m.

berryjon says... #8

Winterblast: Yes, everyone, including the original caster gets a chance to respond. Then if you cast Twincast or Fork, the other players can respond to that as well.

April 7, 2017 1:09 p.m.

Rhadamanthus says... #9

@Winterblast: No, you don't get another chance for a response in your example. If each player passes in succession instead of choosing to do anything, the topmost object on the stack will start resolving. In order to make absolutely sure you get your chance to respond to your own spell you need to hold priority after casting and make your response at that time. If you pass instead, and then everyone else also passes, it's too late.

To clear up another point, it's not that the active player "chooses to resolve the stack" and then waits for responses. As it's explained elsewhere above, the active player can choose to either hold priority or pass after casting a spell.

April 7, 2017 2:17 p.m.

Winterblast says... #10

That's what I thought too Rhadamanthus, but the sentence with "chooses to resolve the stack" was misleading and I felt like I might have missed some possible tricks with passing priority.

April 10, 2017 2:31 a.m.

Gidgetimer says... #11

No, you missed nothing. I was actually coming down here to comment on that sentence before continuing with my read. It is super important to speak correctly when doing an authoritative post. So both saying that Andy "chooses" and saying "resolve the stack" are incorrect and misleading.

The stack doesn't resolve, items on the stack resolve and there is a round of priority between each. You emphasize that all players must have a chance to respond to the latest action, but really players have a chance to respond to each spell immediately before it resolves. For example if Andy and Nancy both have Grizzly Bears and Andy casts Prey Upon and responds to his own spell with Giant Growth, Nancy can allow Giant Growth to resolve and then cast Reprisal before Prey Upon resolves.

April 10, 2017 1:22 p.m.

Please login to comment