Back to Blog
VideogamesNovember 24, 202616 min read

Slay the Spire: Designing With Perfect Information

The enemy tells you what it will do next turn. Why showing intents changes the kind of decision the player makes, from guessing to planning, and how it coexists with the randomness of the deck.

IM
Ignacio MelendezFull-Stack & Game Developer
Slay the Spire: Designing With Perfect Information

The player has five cards in hand, three energy and two enemies in front of them. Above the first one there is a sword with a 14, and it has 12 HP left. Above the second, a shield. There is no uncertainty about how the enemies are going to act. The strategic decision is built on that information. The challenge is finding the right, or optimal, combination. Every fight, every turn, becomes a small puzzle to solve.

Slay the Spire (Mega Crit, 2019) sets up those scenarios, with all their possible options. And choosing wrong is the heart of the game; the player doesn't lose HP to chance or to an attack they couldn't see coming. They lose it to a bad calculation with all the data on the table.

This article is about that system: intents. What it changes in the player's decisions. How the number shown above the enemy is calculated.

1. From guessing to planning

In most turn-based combat games, the player knows what the enemy can do, but not what it will do this turn. The optimal decision is a bet: block just in case it uses a powerful attack, or attack trusting that the enemy will do something harmless. When it goes wrong, it feels random. Even if the decision was correct, it didn't depend entirely on the player, and it can feel unfair.

Slay the Spire removes that layer. During the player's turn, every enemy shows an icon with what it will do on its next turn. If it's going to attack, the exact damage it will deal is shown. Combat stops being a probability problem and becomes an optimization problem: I have these resources, I know what's going to happen, what's the best play I can make?

That changes how losing feels. When an enemy deals 30 damage to the player in one turn, they already knew it was coming. If they couldn't avoid it, the problem was the deck they had been building for the last three floors. If they could and didn't, the problem was the player and their decisions. Either way, the defeat points to a decision that can be improved and learned from.

The Defect fighting a blue hooded enemy on floor 11. A 7 is shown above the enemy next to its intent icon, while a lightning bolt strikes it
The 7 above the enemy's head is the damage it will deal on its next turn. With that number in front of you, the hand below reads like a math problem. Image: Mega Crit.

Showing the intent doesn't make the game easier. It puts the full weight of decisions and consequences on the player.

2. The vocabulary of intents

For the system to work, the player has to read the intent at a glance, without opening menus, guides or tooltips. That's why Slay the Spire uses a small set of icons that repeats across every enemy in the game:

  • Attack: A weapon (bigger the more damage it deals) with the damage number. If there are several hits, it shows as 5x3.
  • Defend: A shield. The enemy is going to gain block.
  • Buff: The enemy is going to get stronger.
  • Debuff: It's going to apply a negative status to the player (Weak, Vulnerable, Frail, junk cards in the deck...).
  • Combinations: Attack with defend, with buff or with debuff, always with the damage number of the attack.
  • Special states: Sleeping, stunned, escaping (some enemies steal gold and run away) and unknown (a question mark).

The interesting part of this list is what it doesn't say. A debuff icon doesn't tell you which debuff it is, or how many turns it lasts. In the same way, a buff icon doesn't say how much Strength the enemy will gain. The exact number only appears on attacks, which is exactly what the player needs to decide how many resources to spend on blocking. The rest is learned by playing (or by hovering over the enemy, although that takes some of the magic out of the learning).

That asymmetry is well chosen. With every effect shown as a number, three enemies would make the screen unreadable. By keeping the precise figure only on damage, the game answers the most urgent question and leaves the rest for the player to learn.

3. The number is already calculated

The attack number isn't the move's base damage, but the final damage you're going to take with every modifier applied. And it updates in real time as you play cards. It's worth stressing that it's the value calculated before block is applied.

The three modifiers that matter most are:

  • Strength: Based on the enemy. It's added to the base damage of each hit.
  • Weak: Based on the enemy. Its attacks deal 25% less damage.
  • Vulnerable: A status on the player. They take 50% more damage from attacks.

The order in which they're applied matters. First Strength is added, then Weak is applied to that total, then Vulnerable, and finally it's rounded down:

damage=⌊(base+Strength)×0.75if Weak×1.5if Vulnerable⌋\text{damage} = \left\lfloor (\text{base} + \text{Strength}) \times 0.75_{\text{if Weak}} \times 1.5_{\text{if Vulnerable}} \right\rfloor

An example: with a base attack of 6, an enemy with 3 Strength and Weak, against a Vulnerable player: (6 + 3) × 0.75 × 1.5 = 10.125. The game shows it as 10, but it's the same calculation.

If the enemy didn't have Weak and a card that applies it is played, the intent number drops before the turn ends. The player doesn't have to "imagine" how much damage they're saving; they see it directly, in real time.

Some relics change those percentages. Paper Krane makes Weak reduce enemy damage by 40% instead of 25%, and Odd Mushroom makes the player take 25% extra damage while Vulnerable, instead of 50%. The intent includes them like everything else, showing the final result at all times, so the number is still the truth.

The Ironclad's red card library. Among them, Bash: costs 2, deals 8 damage and applies 2 Vulnerable
Bash, in the first row, applies 2 Vulnerable. What that Vulnerable does to an enemy shows up in your damage numbers; what it does to you shows up in the number of its intent. Image: Mega Crit.

The intent is only useful if it's exact. If the shown number and the real damage don't match even once (because of different rounding, or a modifier the preview forgets to calculate), the player will stop trusting it and start playing defensively. A preview that lies is worse than no preview at all.

4. Enemies that break the rule

If every enemy worked the same way (show an intent, execute it, pick another one at random), the game would boil down to solving the equation and repeating. That's why many of them skip part of the rule, always in a way that can be learned.

From this point on there are spoilers. So if you want to start playing and be surprised, now is the time to stop reading, play for a few hours, and come back to finish it.

4.1. Fixed patterns

Several enemies don't choose at random. Instead, they follow a predefined script.

The Cultist spends its first turn on an Incantation buff, which makes it gain Strength every turn from then on. After that it does nothing but attack. The first turn's intent only says "buff", but anyone who has played before knows that buff means the fight is against the clock: the longer it lasts, the more damage each hit deals, and the more likely you are to lose the run.

The Gremlin Nob (an elite enemy from the first act) does something similar, with more malice. Its first move is Bellow, another buff, which grants it Enrage: every time the player plays a Skill, the Gremlin Nob gains Strength. The intent only warns that it's going to power up. A new player discovers it by blocking with Defend for three turns and watching the number on the sword keep growing.

Many other enemies have subtler rules. They aren't shown on screen, but a player who has spent hours on runs senses them and starts predicting what will happen on the following turn too. Some examples are enemies that never use the same move more than twice in a row, or behaviors like using a buff first and then hitting.

4.2. Intents that depend on the player

The Guardian, the first act boss, switches to a defensive mode after taking a certain amount of damage. That threshold is shown as a visible effect on the boss, so the player controls the transition: they can decide when it suits them to force that change, or whether to wait another turn to prepare better.

The Hexaghost is the clearest example of an unknown intent. Its first turn shows a question mark, and on the second turn it casts Divider, a six-hit attack whose damage depends on the player's current HP. The more HP you have, the harder it hits. In this case the information is hidden for one turn, but the rule is fixed and learnable. So in the next encounter, the player can use that information to their advantage.

The Writhing Mass goes one step further: every time it takes attack damage, it changes its intent. What you see at the start of the turn may not be what it ends up doing, and the order in which you play your attacks decides which intent it keeps. The player has to plan the turn to end up "forcing" the enemy into one decision or another.

4.3. Trading information for power

There's a boss relic called Runic Dome. Its effect is granting one extra energy per turn in exchange for not seeing any enemy intents for the rest of the run. The designers treat information as a resource the player can sell, and give it one of the highest prices in the game.

The Council of Ghosts event on floor 21. Three masks float above a character and the text offers two options: accept five Apparitions by losing 50% of max HP, or refuse
Council of Ghosts offers five Apparitions in exchange for half your max HP. As with Runic Dome, power has a price, and the game shows you all of it before you decide. Image: Mega Crit.

All these exceptions share one property: they break the rule consistently. The Hexaghost always hides its first turn, the Gremlin Nob always opens with Bellow. What's missing on screen lives in the player's memory, and that rewards experience without arbitrary surprises. It also keeps fights from becoming monotonous.

5. Imperfect information in the deck

If the enemy is predictable, where does the uncertainty come in? The answer Slay the Spire gives is simple: in the deck itself. Every turn five cards are drawn from a shuffled deck, and the result is random.

Information about the enemy is almost perfect and very complete. Information about the player's own future resources, on the other hand, doesn't exist.

That split is what makes the design work. The current turn is a closed puzzle. The pieces are the player's hand and the intents. With them, the best possible play can be calculated. The next turn will depend on what gets drawn, so mid-term planning goes back to being a probability problem.

The twist is that the question becomes: what's the probability of drawing the card I need in time? And the player built that deck themselves.

A floor 3 shop with the Ironclad: seven cards for sale, relics, potions and the card removal service
The shop is one of the places where the uncertainty of future fights is decided. Every card you buy or remove changes what you can draw when the enemy shows its next intent. Image: Mega Crit.

The game plays with that boundary from both sides. There are relics like Frozen Eye, which lets you see the order of the draw pile, removing whatever uncertainty was left. On the other side, the Snecko (a second act enemy) applies the Confused status, which randomizes the cost of every card drawn. The enemy still shows its intents with total clarity, but the hand becomes unpredictable.

The Silent against a Snecko on floor 29, with the Enemy Turn button active while the enemy acts
A Snecko in the second act. Its intents read like any other enemy's; what it breaks is your hand, by randomizing card costs. Image: Mega Crit.

The article on RNG in roguelikes already covered randomness as a driver of gameplay. Slay the Spire uses a similar system, where randomness sits on the player's side (draws, rewards, the map) and the enemy is a system that can be read, learned and studied. Luck affects which problems come up during the run, but not whether the problem can be seen ahead of time.

6. Other examples of this system

Slay the Spire isn't the only game that shows the player what the enemy is going to do. The idea appears in other turn-based strategy games, and each one adapts it to its own kind of puzzle.

In Into the Breach (Subset Games, 2018) enemies mark on the board the exact tile they're going to attack, and the player can push them so the attack lands on another tile, on an empty building or on another enemy. It also shows where new enemies will spawn, and there's barely any randomness in the outcome of actions. The difference from Slay the Spire is that here the intent isn't just read, it's manipulated: changing which tile an enemy attacks is the core mechanic.

Monster Train (Shiny Shoe, 2020) shows enemy stats (attack, health, effects) as soon as they board the train, and the order in which combat resolves follows fixed rules. The information isn't in intent icons, but in each unit's numbers and in public resolution rules.

Inscryption (Daniel Mullins Games, 2021) places the opponent's cards in a staging row before they drop onto the board, so you see one turn in advance what's going to attack you and in which lane. Wildfrost (2023) gives each enemy a turn counter until its next attack, and many of the player's cards are there to delay it.

Don't Kill Them All (on), which hasn't been released yet, flips who is unpredictable. Enemies show what they're going to do before they move, but your orcs don't die: they get angry. Taking hits, losing resources or attacking too many times in the same turn raises their rage, and if they all end up shouting "KILL THEM ALL!" in the same fight, you lose the raid and the loot. With the enemy in plain sight, the risk lies in your own group's patience.

The same pattern repeats in all of them: the enemy's action is visible, and the uncertainty moves to something the player builds or manages (the deck, positioning, time, the temper of your units).

7. Implementing the intent system

When implementing the technical side, you need to separate choosing from calculating.

  • Choosing the move happens once, at the end of the enemy's turn, and stays fixed.
  • Calculating the displayed number happens every time the combat state changes.

If the preview also chooses, the enemy changes its mind with every player action.

To implement it, a good starting point is creating each enemy move as an asset with its intent type and base values:

1public enum IntentType
2{
3    Attack, Defend, Buff, Debuff,
4    AttackDefend, AttackBuff, AttackDebuff,
5    Sleep, Stun, Escape, Unknown
6}
7
8[CreateAssetMenu(menuName = "Combat/Enemy Move")]
9public class EnemyMove : ScriptableObject
10{
11    public string id;
12    public IntentType intent;
13    public int baseDamage;     // 0 if it doesn't attack
14    public int hits = 1;       // 5x3 => baseDamage 5, hits 3
15    public int block;
16    public bool hideIntent;    // the Hexaghost on its first turn
17
18    public bool IsAttack => baseDamage > 0;
19}

Next comes defining the preview (the intents) and the execution (the actions). Keep in mind that using two different functions, one for each, can end up with the values diverging. The player would see a 10 but take 11 damage. So both must use the same function.

1public static class DamageCalculator
2{
3    // Single source of truth: used by the intent preview and the real attack.
4    public static int Compute(int baseDamage, Combatant attacker, Combatant target)
5    {
6        float damage = baseDamage + attacker.Strength;
7
8        if (attacker.HasStatus(Status.Weak))
9            damage *= attacker.WeakMultiplier;        // 0.75 by default, 0.6 with Paper Krane
10
11        if (target.HasStatus(Status.Vulnerable))
12            damage *= target.VulnerableMultiplier;    // 1.5 by default, 1.25 with Odd Mushroom
13
14        return Mathf.Max(0, Mathf.FloorToInt(damage));
15    }
16}

Finally, the enemy separates choosing the move from calculating what it shows:

1public class Enemy : Combatant
2{
3    [SerializeField] private EnemyAI ai;
4    private System.Random aiRng;
5
6    public EnemyMove NextMove { get; private set; }
7    public event System.Action IntentChanged;
8
9    public void Init(int seed)
10    {
11        aiRng = new System.Random(seed);
12        RollNextMove();
13    }
14
15    // Called ONCE when the enemy's turn ends.
16    public void RollNextMove()
17    {
18        NextMove = ai.Choose(this, aiRng);   // patterns, "no repeat" rules, etc.
19        IntentChanged?.Invoke();
20    }
21
22    // Called every time the state changes (card played, debuff applied...).
23    public IntentView BuildIntentView(Combatant player)
24    {
25        if (NextMove.hideIntent || player.HasRelic("RunicDome"))
26            return IntentView.Hidden;
27
28        int perHit = NextMove.IsAttack
29            ? DamageCalculator.Compute(NextMove.baseDamage, this, player)
30            : 0;
31
32        return new IntentView(NextMove.intent, perHit, NextMove.hits);
33    }
34
35    // Writhing Mass: an explicit exception, not a side effect of the preview.
36    public override void OnAttacked(int damage)
37    {
38        base.OnAttacked(damage);
39        if (HasStatus(Status.Reactive) && damage > 0)
40            RollNextMove();
41    }
42}

The UI subscribes to IntentChanged (OnIntentChanged in Unreal) and to a global "combat state modified" event, so it can call BuildIntentView again.

On top of that, the cost of these calculations is minimal; it only takes a couple of multiplications per enemy.

Using a dedicated random generator for enemy AI (separate from the one that shuffles the deck or generates rewards) lets the same seed always produce the same fights even if the player draws differently. Slay the Spire splits its random streams by system, and that's what makes shared seeds reproducible. As developers, this also makes it easy to try out scenarios and test synergies and specific situations.

The exceptions from section 4 fit in without breaking the structure. Hiding an intent is a flag on the move, a reactive enemy is an explicit call to RollNextMove, and fixed patterns live in EnemyAI.Choose. The preview never decides; it only describes what has already been decided.

8. Summary of ideas

These are the ideas from Slay the Spire that I think are worth keeping in mind for any turn-based combat game:

  • Show the intent with the final number. The damage the player is going to take with every modifier applied, not the base damage. That way every debuff has a measurable effect.
  • Choose once, calculate always. The enemy's action is chosen at the end of its turn, stays fixed, and the preview only describes it.
  • A single damage function for preview and execution. If the number lies once, the system loses all its value.
  • Break the rule consistently. The exceptions (hidden intents, reactive enemies, patterns) reward the player who learns, instead of surprising the one who doesn't.
  • Move randomness to the player's side. Drawing and deckbuilding provide variety; the readable enemy provides the sense of control.

I'd also keep in mind that the amount of information given to the player can overwhelm them and have the opposite effect to the one intended. Slay the Spire works with small icons and a single number because there are rarely more than three or four enemies on screen. With many units, showing the exact intent of all of them overwhelms the player, and that's where solutions like Into the Breach (marking tiles on the board) or Wildfrost (one counter per enemy) scale better. Before showing everything, it's worth asking which number the player needs to make this turn's decision, and starting with that one.

Related Articles

View all articles
How RNG Works in Roguelikes

How RNG Works in Roguelikes

Roguelikes depend on chance, but that chance has structure. A deep dive into seeds, determinism, and how to implement a reproducible RNG system in Unity/C#.

Random Isn't Fair: When Your Game Should Cheat With Chance

Random Isn't Fair: When Your Game Should Cheat With Chance

A 25% crit chance can miss ten times in a row, and players will read it as a bug. Why crits need pseudo-randomness (PRD, shuffle bags, true hit) while loot can stay purely random.