Do you like to play with fire? Has this ever happened to you? Hi, my name is Josh Durica and I’m a gameplay engineer on Hearthstone. The designers on Hearthstone are constantly coming up with cool new cards. And as a gameplay engineer, it’s my job to code these new cards and their interactions. I’m here today to talk about two small rule changes we’re making so interactions, like the one you just saw, are clearer. So what exactly happened in that clip? Before I explain that, let me first tell you a bit about “Whenever” and “After” terminology in Hearthstone. Some cards, like Violet Teacher, say “Whenever you cast a spell, summon a 1/1 Violet Apprentice.” Other cards, like Wild Pyromancer, say “After you cast a spell, deal 1 damage to ALL minions.” Both cards trigger off the same action; A spell being cast.

However, they trigger at slightly different times. Cards that say “Whenever” trigger before a spell’s ability activates. Cards that say “After” trigger after a spell’s ability activates. Armed with that knowledge, let’s revisit the opening clip. We begin with our unsuspecting player having a Violet Teacher on the board and a Mindgames in their hand. Mindgames’ ability puts a copy of a minion in the opponent’s deck into your battlefield. When our player casts Mindgames, Violet Teacher says “Whenever”, so she triggers first, spawning a 1/1 token. Next, Mindgames’ ability activates, pulling a Wild Pyromancer into the battlefield. Finally, that same Wild Pyromancer activates after Mindgames’ ability, dealing one damage to all minions, and destroying all our player’s hard work. When this sort of things happens to players in real games, it can be a very frustrating experience. How did Wild Pyromancer trigger? He wasn’t there to see you when you cast the spell in the first place? This leads me to our first rule change. In order for “After” triggers to activate, they need to be present for the original action.

For example, Wild Pyromancer says, “After you cast a spell”, so in order to activate, it needs to be on the board at the time you actually cast the spell from your hand. Let’s take a look at that new rule in action. Once again, our player casts Mindgames. Violet Teacher triggers spawning a 1/1. And then, Mindgames’ ability activates pulling Wild Pyromancer into the battlefield. However, this time, Wild Pyromancer does not trigger because he wasn’t on the board when Mindgames was cast. That’s one rule change down! Now let’s take a look at another interaction that will help me explain our second rule change. To begin, our player has the minion, Bolvar Fordragon, on the board, which reads, “Whenever a friendly minion dies while this is in your hand, gain +1 Attack.” They also have the spell, Spirit Echo, in their hand which has the ability, “Give your minions Deathrattle: return this to your hand.’” First, they’ll cast Spirit Echo, giving Bolvar the return to hand Deathrattle power.

Next, our friendly opponent will give poor Bolvar a fiery death, causing his granted Deathrattle to trigger, sending him back to our player’s hand. Here’s where it gets weird. After returning to the hand, Bolvar’s ability triggers off his own death, and he gains +1 attack. Why does this happen? Well, in Hearthstone, the order in which triggers are activated is based on what zone they are in. First, we activate all in-play triggers for Player 1. These include Deathrattles, and abilities on cards like Wild Pyromancer. Next, we activate in-hand triggers for Player 1, like Bolvar Fordragon. Finally, we activate any in-deck triggers for Player 1. Then we do the same thing for Player 2. So, in our case, Bolvar’s granted Deathrattle triggers first, because it’s an in-play trigger. Then, when we activate in-hand triggers, this includes our newly resurrected Bolvar, and he gains attack from his own death. We think it’s pretty unintuitive that Bolvar is allowed to trigger off of his own death, especially because he wasn’t in your hand at the time that he died. As such, our second rule change is a subtle tweak to how we activate triggers.

Before activating any trigger, we now first look through all the zones and compile a list of all active triggers. Then, when we go zone by zone, we only activate triggers that are contained in that original list. That means if activating one trigger, creates a new trigger, that new trigger will not itself be activated. It’s important to note that triggers still activate in the same order as they did before our changes. Taking a look at the second rule change in action, we can see that when Bolvar returns to your hand, this time he doesn’t gain 1 attack because obviously, he wasn’t in your hand when he died. As you might have noticed, most of these interactions affected by these rule changes are edge cases. However, these interactions generally felt bad when they did occur, so we think it was worth the time to fix them. And, of course, that work doesn’t stop here. If you’re wondering why your particular Hearthstone pet peeve wasn’t fixed, or if these changes seem tiny to you, keep in mind these are changes to the core systems of Hearthstone. Code where one line swap can affect 1000 cards.

We want to make these changes incrementally and carefully. And we need your help! Please tell us about gameplay interactions that don’t make sense to you. As a final note, if you’re more interested in in-depth details about these rule changes, check out the official blog post, which goes into way more detail. It should be an interesting read for anyone who wants more insight into how Hearthstone runs under the hood.

We’ll also be answering as many community questions as possible! From everyone on the Hearthstone team, thank you for listening and we’ll see you in the tavern. Bye!.

As found on Youtube