In the face-off against monstrous beasts and nefarious priests, the most pure-hearted intentions and serious training may not suffice. The whims of chance, (or is it fate?), ultimately will have a say in the outcome.

Such is the case in the world of **Gloomhaven**, where fortune’s voice isn’t heard through the roll of dice, but rather in the drawing of cards (from the modifier deck).

As you venture deeper into the game, you’re afforded the chance to tweak this deck, through **perks** that adds or removes cards of your choosing.

However, these **perks** can take multiple forms, and their impacts are seldom straightforward…

This is what we will examine today, and see if we can learn a thing or two about decks of cards and their probabilities!

## Why Gloomhaven ?

I recently started playing **Gloomhaven: Jaws of the lion** with my son, a **fantasy-themed, campaign-based tactical skirmish game** (according to wikipedia). This game was judiciously offered to him (something in which I may have had a say).

As in any roleplaying game, plenty of choices are to be made that impact how the game evolves. Improving your character abilities, and giving you some sense of progress as you get deeper into the campaigns.

As I was confronted with these choices myself, some of which critically influenced my character’s combat capabilities, I decided to take a closer look and, as is my custom, share my journey with you!

This post focus specifically on one aspect: the **Modifier Deck**, and a unique mechanism to manipulate it: **The Perks**.

## Other resources

As it is difficult to have a truly original idea, it is not surprising that I found others who wrote about the same topic, and even wrote great interactive simulators or apps.

However I was not fully satisfied with them, **since** **the resources I found mostly ignore the impact of reshuffling**, which is surprisingly impactful on the deck behaviour, and I thought deserved the present blog post!

Some references:

## What is the modifier deck

In **Gloomhaven: Jaws of the Lion**, each time your character attacks, the base amount damage is known, but modified by a card drawn from **your modifier deck**.

Each character has it’s own deck, but they all start with the same cards:

The plus or minus modifier simply add or subtract from the damage done by an attack.

So if your attack inflige 2 damage, and you draw a **+1** **card** from the modifier deck, your attack will do 3 damage, and so on…

The two last one are cards that **void** or **double** the damage done, and they also sport the following symbol:

It indicates that once drawn, those cards cause a reshuffling of the modifier deck.

**A rather important aspect of the deck I will come back to.**

## What are the perks?

The perks are bonus you obtain after completing certain objectives, or level your character.

They are a fun way to improve your fighting abilities in the game, and since I had to select perks for my character, I decided to investigate the real impact of those perks on your character impacts (on the bad guys)!

**They allow you to alter your modifier deck by adding, or removing, cards.**

Each character has it’s own list of perks to choose from, but many of them are the similar, here is a non-exhaustive list:

- remove four -0 cards from your deck
- remove one -2 card and one +1 card
- Remove two -1 cards
- Replace one +0 Card by a +1 card (with some other effect)
- Replace one +1 Card by a +2 card with some effect
- Replace one +1 card by a +3 card
- add one +2 card (with some effect)

Even when not considering the additional effects (like wounding, poisoning, pushing, disarming, and more) it is not immediately obvious which perk you should start with.

And since you will only get to select a handful of them during the whole campaign, its better to evaluate with care the best ones get first.

## Evaluating the impact of the modifier deck

Let’s start by examining the composition of the initial deck, looking simply at the probabilities of drawing each modifier card from a freshly shuffled deck:

This however ignore two important aspects of the game: **The attack being modified** and **the reshuffling**.

## The attack being modified

In **Gloomhaven**, characters will have different attack style. Some involve multiple small attacks, each causing 1 damage, others involve causing a large amount of damage in a single attack.

Having one of your small attack cancelled by a **x0** card is one thing. Losing the unique large blow of your turn is another…

But even with small attacks, modifiers matter. For an attack causing 1 damage, the modifier cards have the following effect:

**-1 cards**will bring your attack to 0- But the -2 card also bring it to 0…
**+1 card**will double your attack,**+2 card**triple the damages.- x2 will have the same effect than the +1

So if we look strictly at the final effects, the modification probabilities for an attack doing 1 damage would look like:

- 30% for +0
- 30% for +1
- 35% for -1
- 5% for +2

For the more visual here are graphs of the effect of the modifier deck on a **1 damage** and on a **4 damage** attack:

This demonstrate that your character attacking style should impact how you select your perks.

But before going further on this, remember that I said that the base attack is not the only thing that matters when it comes to the modifier deck… there is also the easy to miss impact of **reshuffling**.

Something that I did not anticipate when I first started working on this post…

## The effect of re-shuffling

Interestingly, the cards that cause a reshuffle of the deck also change the probabilities of drawing the cards.

Think about the following:

- With 2 reshuffle cards in a deck, on average, you will end up drawing a reshuffle card after using
**only a third of your deck**. - When that happen, instead of simply going to the discard pile,
**the reshuffling cards re-enter the deck**immediately. - So you will end up
**drawing reshuffling cards more often**than a normal card would!

In a freshly shuffled deck, the frequencies are unchanged, but over the course of a game, the frequencies is quite different!

One important aspect to note is that the way the modifier deck is built, the frequency of **x2** and **x0** do not change the average damage of attacks. But it is only because the x2 and x0 cards cancel each other in term of damage, so changing their odds of being drawn do not affect the average damage value.

## What is the effect on the average attack?

At first I was not sure how the change of frequency of reshuffling cards would impact the game. So I decided to run a little experiment:

- Draw 20 millions times from a deck, reshuffling each time we draw the card asking for a reshuffle.
- Keep track of how often we see each card.

The results is interesting:

**X2 and X0 cards** each represented about 7.14% of the drawn cards.

Which is a bit less than 1.5 times their actual weight in the deck (each card being 5% of the 20-cards deck).

So while they do not influence the average return, the less cards there are in the deck, the more often those reshuffle cards will appear, making a small deck much more chaotic in its results.

Here are the adjusted attack pie-charts with the modifier deck impact on 1 and 4-damage attacks, taking reshuffling in consideration:

Now, if someone was to remove four **+0 cards** and two **-1** **cards** with their perks…

They would end up drawing a **x2 **or **x0 card** about **20% of the time**!

This is more than the14.28% that someone simply looking at the deck content would expect…

It would means drawing a reshuffle every five cards instead of every seven cards… A rather major change!

## How to calculate that?

To be fair, I did not calculate it myself, I found a reddit thread where someone better in math than I am who did it.

I do not want to appropriate their work, so you can check it, but I simulated the deck drawing over millions of iteration and can confirm that it works.

If you are interested: Reddit Thread on reshuffling Math.

The gist of the math argument is the following: If you have 2 reshuffling cards in a deck, on average you will draw a third of the deck before drawing one.

So for each sequence of drawing until hitting a reshuffling card:

- Non reshuffling cards have a 1/3 chance of being drawn
- Which reshuffling card you draw is evenly split between x0 and x2. So each reshuffling cards has a 1/2 chance of being drawn in a sequence of drawn until reshuffle.

It’s like if the deck is 3 time smaller for the reshuffling cards.

So we multiply chance of being drawn by 3, and divide it by 2 (Half of the time it’s the other reshuffling card that is drawn)

It means reshuffling cards would have about 1.5 times their normal probability of being drawn!

This is however a bit of a simplification, the actual weight is more 1.428, since it involves multiplying by n/n+1 (n being the number of cards in the deck) But I hope you get the overall idea.

**If someone can explain it in simpler term, do not hesitate to add it in the comments below!**

Let’s see now what is the base deck expected attack using this reshuffling simulation

## Individual Perk impact of modifying the deck

Now with the perks. I decided to calculate the final average damage done for attacks between 1 and 4 damage.

First. for the default deck, and then for each different perks, taken individually.

Damage | 1 | 2 | 3 | 4 |

Unmodified Deck | 1.048 | 2.000 | 3.000 | 4.000 |

Here we can see one very interesting thing. At the beginning of the game,** the average impact** of the modifier deck is **exactly zero**!

This is easy to explain, there are the same number of cards having opposite effect:

- Five +1, Five -1 cards
- One +2, One -2
- Six +0 cards
- One x2 card, One x0 card

**The only exception is for attacks of strength 1, the -2 cards act as a -1 card, so the +2 create a slightly positive effect.**

This gives a hint to the best perks to be used, the one that will change the balance the most, by removing negative cards, or adding positive ones.

Here is a table of all the perks available (not all are available to all characters) with their real effects on the damage:

You can see the average final attack for damage between 1 and 4.

The Yellow line shows the average final attack using the unmodified perk deck.

Here the perks impact are sorted from least to most on their effect on attack doing 1 damage.

But you can easily find out the few that are out of order for the others.

## The best Perk

One good news is that one of the best Perk (B: **Remove two -1 card**) is available to all Jaws of the Lion Characters.

The best of all perk (add a +3 card) is only available to the **Void Warden**.

## The worst Perk

The worst perk, at the start at least, is definitively the remove four +0 cards. Since it does not change the average, only making the deck more chaotic.

Once the deck is slanted positively, it’s impact is greater, but this is not the first Perk to get for sure.

## What to choose Next ?

I redid the same exercice for the second perk (this time, using the starting deck with two -1 cards removed as the starting point)

Maybe not surprisingly, the ordering of perks do not really change from the first to the second. The only difference being the Remove four +0 cards, that start closing in on the next best perk. One could extrapolate that its interest will increase as the deck gain in positive modifier.

## Who benefit most from Perks

We can see that several small attacks are greatly advantaged by the Perk system, possibly gaining 30% in strength after only 2 perks. (The impact on attack causing 4 of damage is proportionally far less impressive!)

Now, some specific attacks are impacted differently by the deck. Some character attack do 0 damage, relying on the deck to provide the actual damage. This makes the removing of +0 cards suddenly interesting, since it increase the chance of doing actual damage.

## Conclusion

I hope you found this little analysis interesting!

Aside from the perks themselves, I personally learned a great deal about the impact of cards causing a reshuffling of the deck.

It will probably inform my decisions in other game with a similar mechanism.

Let me know what you think, and if other aspects of Gloomhaven would deserve some insights!