Introduction

Gloomhaven is a popular, co-operative dungeon crawler board game in which you play as a group of mercenaries living in the town of Gloomhaven, fighting monsters for money and glory. One mechanic that made the game so popular is its combat system, where your hand of cards represents your stamina. Over the course of the game you lose cards, reducing the actions you can take, until eventually you don’t have enough cards and your character is exhausted. In order to succeed in Gloomhaven, you need to know how to manage your cards. This article will explore how the number of cards you currently have determines the number of turns you have left.

For the impatient, I’ve written a simple trick below, showing how to calculate the number of turns you have left before you exhaust. For the interested, I’ve written the rest of this article explaining how I figured out the trick and going into a lot more detail.

Combat

I’ll briefly explain the combat rules in Gloomhaven and some terminology. If you’re already familiar with the rules you can skip to the ‘Some questions’ section.

Players start the game with a hand of cards that determine the actions their character can take during a turn. The exact number of cards a player has depends on their character, but it is normally between 8 and 12.

The game consists of a number of rounds. At the start of each round, players pick two cards from their hand to play. During each round, each player (and any enemies) take a turn, in which they will take some actions like moving or attacking. At the end of a player’s turn, the two cards they picked are either discarded or lost (they can also remain active, but we’ll ignore that for now).

When a player has less than two cards in their hand, they will be unable to pick two for that round, so must rest. Players can either short rest or long rest, but for our purposes the result is essentially the same. To rest, one card from the discard pile is put in the lost pile and the rest of the discarded cards are returned to the player’s hand. If the player still has less than two cards in their hand, they are exhausted and out of the game.

Some questions

  • Given a hand of n cards, what’s the maximum number of turns a player can have before becoming exhausted?
  • How many turns will a player lose if they make an action that loses a card?
  • Is it better to lose cards early or late in the game?
  • Players can rest even if they have two or more cards in their hand - how does this affect the number of turns they have.

How many turns do I get?

Let’s assume a player starts with a hand of ten cards, and every turn they discard two cards (rather than lose any). After five turns their hand will be empty and they must rest. In resting, they lose one of their discarded cards and return the remaining nine to their hand. Now they can take another four turns before their hand contains just one card and they must rest again. So they lose another card and get a hand of eight.

[Graph of cards in hand, discarded, or lost over time]

The table below shows the number of cards in a player’s hand and the number of turns before they must rest. I’ve included hands of one and zero cards for completeness.

Cards in hand Turns before resting
105
94
84
73
63
52
42
31
21
10
00

To find the total number of turns a player has before becoming exhausted when starting with 10 cards we sum all the turns in this table, which equals 25. More generally, when a player has n cards, the number of turns they have is the sum of all the rows for n cards and below.

Adding triangles

Looking at the table of turns, you can that the number of turns decreases by one every other rest, so it like the series for triangular numbers, but stretched out. Another way to think of this, as two triangular numbers. For example, to get the total number of turns when starting with ten cards we add the triangular numbers, $T(5)$ and $T(4)$.

5 4 4 3 3 2 2 1 1

If we call the maximum number of turns a player can have, given a starting hand of n cards $G_n$, then $G_{10} = T(5) + T(4)$.

Even numbered hands

If a player has an even number of cards in their hand, then our equation becomes:

$G_{n} = T(\frac{n}{2}) + T(\frac{n}{2} - 1)$

Plugging the values into the equation for the nth triangular number:

$G_{n} = \frac{1}{2}\left(\left(\frac{n}{2}\right)^2 + \frac{n}{2}\right) + \frac{1}{2}\left(\left(\frac{n}{2} - 1\right)^2 + \frac{n}{2} - 1\right)$

$G_{n} = \frac{1}{2}\left(\frac{n^2}{4} + \frac{n}{2}\right) + \frac{1}{2}\left(\frac{n^2}{4} - \frac{n}{2}\right)$

$G_{n} = \frac{n^2}{4} = \left(\frac{n}{2}\right)^2$

We can visualise adding two consecutive triangular numbers by lining up arranging two triangles. For example, combining a triangle with side length 5 with a triangle with side length 4 gives us a complete square with side length 5.

So when we have 10 cards, we get a square with length 5, hence $G_{10} = \left(\frac{10}{2}\right)^2=25$

Odd numbered hands

The situation is only slightly different if we start with an odd number of the cards. For example, if we start with 9 cards, we have two sets of the same triangular number.

$G_n$, then $G_{9} = T(4) + T(4) = 2T(4)$.

More generally, if a player has an odd number of cards in their hand, their number of turns is given by:

$G_{n} = 2T(\frac{n-1}{2})$

If we plug these values into the equation for triangular numbers, we get an equation for the number of turns given n cards:

$G_{n} = 2 \times + \frac{1}{2}\left(\left(\frac{n}{2} - 1\right)^2 + \frac{n}{2} - 1\right)$

$G_{n} = \frac{n^2 - 1}{4} = \left(\frac{n + 1}{2}\right)\left(\frac{n - 1}{2}\right)$

Again, we can visualise this by combining two triangles, this time of the same size. For example, combining two triangles with side length 4, gets us a rectangle with side lengths 4 and 5.

$G_{9} = \left(\frac{9 + 1}{2}\right)\left(\frac{9 - 1}{2}\right) = 5 \times 4 = 20$

Summary

So for an even number of cards we have:

$G_{n} = \left(\frac{n}{2}\right)\left(\frac{n}{2}\right)$

And for an odd number of cards we have:

$G_{n} \left(\frac{n + 1}{2}\right)\left(\frac{n - 1}{2}\right)$

So we essentially want to divide the total number of cards by two then square, but in the odd case, we effectively divide by two and round up, multiplied by dividing by two and rounding down. That's where I got the idea that you can split you cards into two piles as evenly as possible and multiply those two numbers.

This table summarises the results

Cards in handTurns to exhaustion
00
10
21
32
44
56
69
712
816
920
1025