34
Mathematics Extended Essay Statistical Evaluation of CCG Cards To what extent does ordinary least squares regression accurately assess the true mana cost of Hearthstone cards in a randomly drafted format? Word count: 3847

Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Mathematics Extended Essay

Statistical Evaluation of CCG Cards

To what extent does ordinary least squares regression accurately assess the true mana cost of

Hearthstone cards in a randomly drafted format?

Word count: 3847

Page 2: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Table of Contents...............................................................................................................2

1 Introduction.................................................................................................................4

1.1 Preface to Collectible Card Game Analysis........................................................4

1.2 Rules of Hearthstone...........................................................................................4

2 Elie Burzstein Method of Card Appraisal................................................................6

2.1 Representation of Individual Cards.....................................................................6

2.2 Simple Linear Regression...................................................................................7

2.3 Generalized Ordinary Least Squares Regression..............................................10

3 Results........................................................................................................................11

4 Evaluation..................................................................................................................12

4.1 Error from Mana Cost.......................................................................................14

4.1.1 Overview of Opportunity Cost Calculation...............................................14

4.2 Error from Misevaluation of Attributes.............................................................16

4.2.1 Error of Stat Distribution............................................................................18

4.2.2 Error of Delayed Effects............................................................................18

4.2.3 Error of Anti-Tempo Play..........................................................................20

4.2.4 Error of Synergies and Parasitic Mechanics..............................................20

4.3 Iterative Reduction of Error..............................................................................20

5 Alternative Theoretical Methods of Card Appraisal.............................................21

5.1 The LightForge Method....................................................................................22

5.2 The Metagame Clock........................................................................................22

6 Conclusion.................................................................................................................22

7 Appendix....................................................................................................................23

A. Computational Methods.......................................................................................23

B. Description of Attributes.....................................................................................24

2

Page 3: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

C. Attribute Coefficients..........................................................................................25

8 Bibliography..............................................................................................................26

3

Page 4: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

1. Introduction

1.1 Preface to Collective Card Game Analysis

Collectible card games (CCGs) are turn-based two-player zero-sum card games that

utilize hundreds if not thousands of different cards. Each card in a CCG has a unique

combination of attributes – effects – with integer values. This paper aims to assess the

relative power level of cards in HearthstoneTM by Blizzard Entertainment.

The ratio of a card’s attributes and its cost determines its power level. Cards cost

mana crystals to play, a refreshing resource that each player has access to during their turn. If

a 2 mana card provides attributes that normally sum up to 2.5 mana for other cards, it is

obviously powerful. In this case, the real mana cost of 2 does not align with the true mana

cost of 2.5, and the card is said to be undervalued (Elie, “How to Find Undervalued

Hearthstone Cards Automatically”). The goal of this research is to assess the power level of

cards by determining their true mana cost.

Note that calculating the true mana cost of a card is only a fraction of the complexity

of deckbuilding. An independently powerful card may not synergize well with other cards.

The metagame also has an influence, where the fact that opponents are likely to play counters

decrease the effectiveness of a card. This research will assume that the game is played in an

Arena format, in which card selection is mostly random, so that card synergy and the

metagame has negligible influence.

This paper improves upon Elie Burzstein’s method, which utilized ordinary least

squares regression to approximate the true mana cost of cards available at the inception of

Hearthstone. With newly available card performance statistics that collect data from plugins,

it is now possible to evaluate the accuracy of the Elie Burzstein method. Furthermore, this

paper will attempt to analyze complex card types that were not included in the original Elie

Burzstein’s card pool, while providing updated data for newly printed cards.

4

Page 5: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

With this knowledge, the formal research question can be phrased as: “To what extent

can Elie Burzstein method be modified to accurately represent the true mana cost of

Hearthstone cards in the Arena format?”

1.2 Rules of Hearthstone

This sample gameplay will explain the rules of Hearthstone and provide context to

card attribute analysis provided below.

Figure 1. The mulligan phase.

5

Page 6: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

At the start of a game, the first player draws 3 cards and the second player draws 4

cards from their shuffled deck of 30 cards. This game is shown in the second player’s

perspective, who has drawn 2 Mana Wyrms, a Frostbolt, and a Chillwind Yeti.

In a turn-based card game, the first player will have an intrinsic advantage. To

compensate, the second player draws 1 more card at the beginning of the game.

The blue number at the top-left of each card is its mana cost. Chillwind Yeti costs 4

mana. In Hearthstone, the number of mana crystals available is equal to the number of its

turn, with a maximum of 10 mana crystals per turn. It means that, regardless of how many

mana was spent on the previous turns, there will be 2 mana available at the start of the second

turn, 5 mana on the fifth turn, 10 mana on the tenth turn, and still 10 mana on the twentieth

turn. Chillwind Yeti, then, is unplayable in turns 1, 2, and 3. Not willing to have an

unplayable card in the early turns, the second player puts the Chillwind Yeti into the bottom

of the deck and draws a different random card, Blizzard.

6

Page 7: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Figure 2. Card types and the end game goal

The game has begun. The number beside the player character portrait is each player’s

life points. Both players start with 30 life points and try to reduce the opponent’s life points to

a non-positive integer while preserving ally life points for a victory.

7

Page 8: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

At the beginning of the game, the second player receives The Coin, a spell – cards

with an instantaneous effect – that grants 1 extra mana crystal for one turn, which also

mitigates the first player advantage.

Each player draws a card from their deck at the start of their turns.

The available mana crystals are shown at the bottom right of the gameboard. The

second player uses 1 mana to play the Mana Wyrm onto the board. Mana Wyrm is a minion

–cards that stay on the gameboard – with 1 attack (yellow) and 3 health (red). The second

player uses The Coin to gain 1 more mana crystal, and play another Mana Wyrm.

Figure 3. Spell usage

The first player plays a minion with 3 attack and 2 health on their second turn with 2

mana. The second player uses the spell Frostbolt to decrease the opponent minion’s health by

3 and remove it from the board.

8

Page 9: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Figure 4. Life total reduction

Now that a turn has passed since the Mana Wyrms were played, they can now attack

enemy characters once each turn. The Mana Wyrms attack the opponent’s life total directly

and decrease it by to their attack value. The second player ends the turn.

9

Page 10: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Figure 5. Minion combat

Figure 6. Kobold Geomancer

The opponent plays a Kobold Geomancer. To prevent

the it from reducing ally life total, an ally minion attacks the

Kobold Geomancer. Since both minions have attack values,

the ally minion deals 3 damage to Kobold Geomancer, and it

deals 2 damage back. Both minions are removed.

At the end of the minion combat, the second player still

has a Mana Wyrm on board, which will reduce opponent’s

life total each turn. For this reason, controlling more minions

than the opponent is a core strategy of Hearthstone. The

second player continues to maintain a minion board advantage, and successfully reduces the

opponent’s life total to zero for a victory.

10

Page 11: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

2. Elie Burzstein Method of Card Appraisal

2.1 Representation of Individual Cards

To compute the true mana cost of all cards relative to each other, every card should first

be represented in a mathematical equation. To illustrate, suppose that a player is holding the

card Chillwind Yeti in their hand:

Figure 7. Chillwind Yeti

A player may decide to spend 4 mana crystals to

play Chillwind Yeti from their hand to the board. They are

trading 1 card and 4 mana crystals in exchange for 4 attack

points and 5 health points.

4×mana+1×card=4×attack+5×health

Note that mana crystals are the unit – the basis – of all other attributes. Hence, remove

the term mana and isolate the mana cost:

4=4×attack+5×health−1×card

∴4=4 a+5h−c

In the above equation, a is the attribute coefficient for the attribute attack, the mana

cost of a single point of attack. Similarly, h is the mana cost of a single point of health.

Regardless of the attributes of a card, the term – c is a constant. In a 3D graphical

representation of all minions, where the mana cost is the y-axis and attack and health are the

x and z-axis, ( x , y , z )=(0 ,−c ,0) would be the y-intercept. In other words, a card that does

nothing will cost −c mana. For this reason, Elie Burzstein named the constant −c as the

intercept, abbreviated i. Then, equations for all cards can be generalized as:

11

Page 12: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Manacost=∑k=0

n

(effect k )+i

or

Manacost=∑k=0

n

(attribute coefficientk )× (attribut ek)+ i

This mathematical representation of individual cards is based on the following assumptions

(Elie, “How to Apraise Hearthstone Card Values”):

Mana cost is linearly proportional to card power. If card power is exponentially or

logarithmically proportional to mana cost, only expensive or cheap cards would be

played, respectively. Both are not the case.

Card effects have a constant price. This paper will also improve upon prior research

by attempting to evaluate complex effects with fluctuating mana value.

A card has an intrinsic value. This is reflected by the intercept.

The value of a card is the sum of its attributes.

2.2 Simple Linear Regression

Simple linear regression allows the regression of a single attribute coefficient and the

intercept, which can be used to compute the true mana cost of cards with the attribute. It is a

clear illustration of a process that can be later generalized (Federico) for cards with more than

one attribute. For simplification, assume a format in which only the attribute damage exists.

Figure 8. Legal damage cards in the Wild format.

12

Page 13: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

The five cards above form this data set where y is the mana cost and x is damage.

Car di={y i , x i }i=15

Moonfire={0,1 }

Arcane Shot={1,2 }

Darkbomb={2,3 }

Fireball={4,6 }

Pyroblast={10,10 }

Graph the data set in an (x , y ) coordinate:

Figure 9. Damage VS mana cost for 5 legal damage cards and its linear fit.

13

Page 14: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Each point on Figure 9 can be represented by this equation where ε i is the residual, the

vertical distance between a point (x i , y i ) and the linear fit.

y i=α+β x i+ε i…… (2.2.1)

The goal of simple linear regression is to find a line of best fit y=α+βx on the scatter

plot that minimizes the sum of squares of residuals. Optimizing ∑ ε2 instead of ∑ ¿ε∨¿¿

not only allows calculus applications but also heavily penalizes points that are far away

(Federico).

ε i= y i−α−β x i∵Equation 2.2.1

∑i=1

5

εi2=∑

i=1

5

( y¿¿ i−α−β xi)2¿

Substitute raw data:

∑i=1

5

εi2=(0−α−β )

2+(1−α−2 β )

2+ (2−α−3 β )

2

+(4−α−6 β )2+ (10−α−10 β )

2

Simplify by computing:

∑i=1

5

εi2=5α 2+44 αβ−34 α+150 β2−264 β+121……(2.2 .2)

Figure 10. 3-dimensional graph of ∑i=1

5

εi2.

Equation 2.2.2 forms a 3-dimensional

surface with vertical axis ∑i=1

5

εi2 and

horizontal axis α and β. To find its local

minimum, set its partial derivatives with

respect to α and β as zero.

14

Page 15: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

∂∂α

(5α2+44αβ−34α+150β2−264 β+121 )=10α+44 β−34=0

∂∂ β

(5α2+44αβ−34α+150β2−264 β+121 )=44 α+300 β−264=0

Solve the system of equations:

α=−177133

, β=143133

α=−1.33 , β=1.08

In conclusion, a card costs −1.33 mana whereas a point of damage costs 1.08 mana. To

assess the true mana cost of cards, substitute α and β back to y i=α+β x i.

The Elie index will be defined as:

Elie Index for card i=I E ( i )=TrueManaCost i−Manacos t i

Elie index serves as a single indicator of a card’s power level. Cards with higher Elie index

are more powerful than those with a lower index.

Figure 11. Results of simple regression. Card Mana cost Damage True mana cost Elie indexMoonfire 0 1 -0.26 -0.26Arcane Shot 1 2 0.81 -0.19Darkbomb 2 3 1.89 -0.11Fireball 4 6 5.12 1.12Pyroblast 10 10 9.42 -0.58

Figure 11 shows that Fireball is the only card with a positive Elie index, making it the

best card. Although cards like Moonfire and Arcane Shot deal high ratio of damage compared

to its mana cost, the cost of losing a card is too severe. This result means that deckbuilders

should generally aim to include Fireball, and possibly the second best card, Darkbomb, in

their decks, whereas the other damage cards should be avoided.

2.3 Generalized OLS Regression

15

Page 16: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

To account for numerous cards and attributes, the matrix form of OLS regression is

required. The general process is similar: collect data, isolate ∑ ε2, find the partial derivative

with respect to α and β, solve the derivative, then substitute back (Federico).

Each data point – a card – can be written as:

y i=α+β1 x1 i+ β2x2i+β3 x3 i+⋯⋯+ βk xki+ε i…… (2.3.1)

where βn are the attribute coefficients, y i the mana cost, α the intercept, and ε i the residuals.

This data set can be written compactly in matrices, where the 1st column of X represents i:

Car di={y i , x1 i , x2 i , x3 i ,⋯⋯, xki }i=1n

Y=[y1y2y3⋮yn

]X=[111⋮1

x11 x21 x31x12 x22 x32x13 x23 x33

⋯xk 1xk 2xk 3

⋮ ⋱ ⋮x1n x2n x3n ⋯ xkn

]β=[αβ1β2⋮βk

]ε=[ε1ε2ε3⋮εn

]Substitute the matrices into equation 2.3.1:

Y=Xβ+ε……(2.3 .2)

Isolate ε :

ε=Y−Xβ∵Equation 2.3.2

The sum of squares of residuals will depend on variable β, since X and Y are unchanging raw

data. Define Q(β ) as the sum of squares of residuals.

Q(β )=∑i=1

n

εi2=ε ' ε

Note that ε needs to be multiplied by its transpose, since the number of columns in the first

matrix needs to be equal to the that of rows in the second matrix in a matrix multiplication.

Substitute:

Q (β )=(Y−Xβ )'(Y−Xβ )

16

Page 17: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Expand:

Q (β )=Y 'Y−β ' X ' Y−Y ' Xβ+β ' X 'Xβ

β ' X ' Y and Y ' Xβ are equivalent. For a simple demonstration, note that β is a (k+1)×1

matrix, X is n×(k+1) matrix, and Y is a n×1 matrix. Then, both β ' X ' Y and Y ' Xβwould be a

1×1 matrix.

Q (β )=Y 'Y−2Y ' Xβ+ β' X ' Xβ

Find the derivative of Q (β ) with respect to β which includes both α and β:

dd β

Q (β )=dd β

(Y 'Y−2Y ' Xβ+β ' X 'Xβ )

Treat X and Y as constants and use chain rule:

dd β

Q (β )=0−2 X 'Y +2 X ' Xβ

Set the derivative equal to zero and solve for β:

0=2 X ' Xβ−2 X 'Y

X ' Xβ=X 'Y

∴ β=(X ' X )−1

(X ' Y )……(2.3 .3)

Given the raw data X and Y , we are able to compute the attribute coefficients matrix

β with equation 2.3.3. Then, by substituting β back into Y=Xβ, it is possible to compute the

true mana cost of all cards with the correct attribute coefficients, the goal of this paper.

17

Page 18: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

3. Results

The tables below show 20 of the most undervalued and overvalued cards in the pool.

Fully processed results are available in Appendix B and C, and the computational

methodology in Appendix A. Note that there are the following changes to Elie Burzstein’s

original matrix of 130 cards:

Only cards from the modern Arena format are used.

Only cards from the Un’Goro (mid-2017) period are used, as it would be

meaningless to analyze the cards of the past. All modified cards are updated.

Over 200 cards with simple attributes are included. Complex attributes are too

complex for ordinary least squares regression.

Figure 12. Most undervalued cards in the Arena format according to Elie method. Card Name Mana Cost True Mana Cost Elie IndexDon Han'Cho 7 14.795 7.795

Onyxia 9 12.210 3.210Dust Devil 1 3.188 2.188Public Defender 2 3.669 1.669Power Word: Shield 1 2.646 1.646Binding Heal 1 2.608 1.608N'Zoth's First Mate 1 2.556 1.556Grimstreet Smuggler 3 4.464 1.464Fire Elemental 6 7.315 1.315Soulfire 1 2.266 1.266

Figure 13. Most overvalued cards in the Arena format according to Elie method. Card Name Mana Cost True Mana Cost Elie IndexEldritch Horror 8 6.731 -1.269Faceless Behemoth 10 8.696 -1.304

18

Page 19: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Kabal Courier 3 1.669 -1.331Assassin's Blade 5 3.612 -1.389Soggoth the Slitherer 9 7.595 -1.405Ravenholdt Assassin 7 5.501 -1.500Priestess of Elune 6 4.425 -1.575Volcanic Potion 3 1.416 -1.584Pyroblast 10 8.309 -1.691Circle of Healing 0 -3.095 -3.095

Figure 12 and 13 show the most powerful and the least powerful cards in the Arena

format, respectively. A notably powerful card is Don Han’Cho, surpassing Onyxia by 4 mana

crystals worth of attributes.

Pyroblast is, surprisingly, the second worst card in the format with an Elie index of

-1.691, whereas the simple regression suggested an index of -0.58. It means that there are

more efficient damage cards that were excluded in the simple regression analysis due to

having more than one attributes. This discrepancy alone shows the value of generalized OLS

regression with multiple attributes.

19

Page 20: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

4. Evaluation

To answer to what extent the Elie Method can accurately compute the true mana cost

of cards in the Arena format, it is necessary to compare the results to real statistical data.

HearthArena is a service that collects various card win-rate statistics in the Arena format and

converts it into a HearthArena index.

Although experimental data has its own biases, the HearthArena index is the only

reliable measure of a card’s power level available, collected by thousands of Arena players. If

the two indexes low correlation, it is likely that the Elie index is the more inaccurate measure.

To find the correlation between the two indexes, first, use simple regression. Then,

find the coefficient of determination or the R2 value that represents which percentage of the

variance in the Elie Index can be explained by the regression line.

R2=1−σ line2

σElie2

Where,

σ Elie2

=∑i=1

n

( I E ( i )− IE )2∧σ line

2=∑

i=1

n

ε2

These equations simply mean that the variance of each index is the sum of squares of

the difference between the data points and the average value.

20

Page 21: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Figure 14. HearthArena Index VS Elie Index

-10 10 30 50 70 90 110 130

-4

-3

-2

-1

0

1

2

3

4

R² = 0.05

Heartharena Index VS Elie Index

Heartharena Index

Eli

e In

dex

The computed R2 value is 0.0475, which means that there is close to no correlation

between the two indexes. Further error analysis is required to examine why the Elie method,

which is meant to approximate the true mana cost of cards, is highly inaccurate. The

following are several major sources of error that may have caused such discrepancy between

the two indexes.

4.1 Error from Mana Cost

21

Page 22: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

The most likely source of systematic error is mana cost. Even with the intercept, as

Figure 10 shows, the Elie Burzstein method systematically overvalues cards that cost less

than 4 mana. These cards rapidly run out, so that the player cannot fully utilize mana crystals.

This drawback needs to be incorporated in card evaluation.

Figure 15. Comparison of true mana cost and the mana cost

0 1 2 3 4 5 6 7 8 9 10-1.0000

0.0000

1.0000

2.0000

3.0000

4.0000

5.0000

6.0000

7.0000

8.0000

9.0000

10.0000

11.0000

Mana Cost VS True Mana Cost

Mana Cost

True M

ana C

ost

by E

lie M

eth

od

4.1.1 Overview of Opportunity Cost Calculation

Calculating the opportunity cost of playing numerous low-cost cards is complex and

beyond the scope of this research. Instead, a grossly simplified model is proposed.

First, let f (t) be the probability distribution function of the length of a game in

Hearthstone where 0≤ t ≤40∩t∈ R (after 40 turns, the game is a draw). Next, let x be the

average mana cost of all cards in a deck, 0≤ x≤10∩x∈R. Then, define h( t) to be the sum of

the mana cost of all cards that drawn during the game, given x. Also, let g(t ) be the

maximum mana crystals a player could have spent in t turns.

22

Page 23: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Because mana crystals cap at 10 per turn:

g ( t )={∑i=1

t

i=12t ( t+1 )=¿

12t2+12t ,0≤ t ≤10¿

∑i=1

10

i+10 ( t−10 )=10 t−45 ,10<t ≤40

Since the player draws 3.5 cards on average at the beginning of the game and draws 1 more

card each turn:

h (t )=3.5 x+ tx

The total mana that is left unspent after t turns due to running out of cards would be the

difference between g (t ) and h (t ).

g ( t )−h ( t )={ (12 t2+12t)− (3.5x+tx )=

12t2+( 12−x )t−72 x ,0≤t ≤10

¿ (10 t−45 )−(3.5 x+tx )= (10−x ) t− (45+3.5 x ) ,10<t ≤40

However, the opportunity cost only matters if it is positive, since the drawback of running

low-cost cards only matters when there is leftover mana that is wasted.

g ( t )−h ( t )>0

12t 2+( 12−x ) t−72 x=0at t=

( x−12 )±√( 12−x)2

+2×72x

1={k1 , k2 }

Because k1≤0, and 0≤ t, k1 is irrelevant.

The situation in which a deck runs out of cards after 10 turns is largely irrelevant, since the

average game length in Hearthstone is shorter (“Hearthstone Gameplay”). Any deck that

plays for longer should not worry about running out of cards.

Opportunity cost of running low-cost cards in a deck would be the integral of all mana

crystals that were wasted due to running out of cards:

Opportunity cost=∫k2

40

f ( t ){g ( t )−h (t ) }

23

Page 24: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

This opportunity cost calculation will allow for all low-cost cards to be readjusted in the

Elie index for a more accurate true mana cost assessment in further research. It will,

theoretically, achieve the goal of more accurately assessing the true mana cost of cards.

4.2 Error from Misevaluation of Attributes

Another source of systematic error could be overestimating or underestimating the

power level of some attributes. To test this hypothesis, there needs to be a single indicator of

the difference between the two indexes. First, represent both indexes in a normal distribution

fit.

Figure 16. Histogram and normal fit of the Elie index.

Figure 17. Histogram and normal fit of the HearthArena index.

Then, compute the z-score, the measurement of how above or below a point is from

the arithmetic mean of the normal fit in terms of standard deviation.

Zi=I i− Iσ I

where the arithmetic mean and the standard deviation are:

I=1n∑i=1

n

I i∧σ I={∑i=1

n

( I (i )− I )2}12

Define the z-error as the difference between the z-score of a card in the Elie index and

the HearthArena index.

24

Page 25: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Zerror=Zscor e Elie−Zscor eHearthArena

The goal of this computation is to determine which attributes the Elie Burzstein

method is systematically overvaluing or undervaluing compared to the HearthArena index.

To do so, define two matrices:

Z=[Zerror1Zerror2Zerror3⋮

Zerrorn] X=[

111⋮1

x11 x21 x31x12 x22 x32x13 x23 x33

⋯xk 1xk 2xk3

⋮ ⋱ ⋮x1n x2n x3n ⋯ xkn

]Multiply to obtain

Z∑ ¿=X ' Z ¿

where Z∑ ¿¿ represents the total z-error caused by every point of attribute in the card pool. To

determine how much z-error that a single point of an attribute causes, divide the elements of

Z∑ ¿¿ by the sum of points of respective attributes:

Znormalized=Z∑ ¿

∑ attribute¿

Figure 18. Most overvalued attributes by the Elie Burzstein Method. Attributes Total z-error Normalized z-error Sum of AttributesHandbuff attack 40.998 6.833 6Handbuff health 40.998 6.833 6Can't attack 4.7289 2.364 2Restore ally hero health 38.5989 1.608 24Opponent draw 2.5226 0.631 4Restore health 38.5151 0.611 63

Opponent attack 3.4237 0.571 6Windfury 13.1792 0.549 24Weapon buff durability 0.901 0.451 2Spell damage 5.5865 0.372 15

Figure 19. Most undervalued attributes by the Elie Burzstein Method. Attributes Total z-error Normalized z-error Sum of AttributesDamage opponent hero -15.6864 -0.654 24Damage -44.5282 -0.665 67

25

Page 26: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Weapon durability -20.5755 -0.686 30Attack on opponent's turn -7.6093 -0.846 9Weapon attack -19.4515 -0.926 21Overload -16.8402 -0.991 17Freeze board -2.2514 -1.126 2Destroy opponent minion -6.7993 -1.133 6Opponent board damage -47.394 -1.554 30.5Ally board damage -21.1193 -2.112 10

For example, if a card had a single point of the Handbuff attack attribute, it would

have been evaluated 6.8 sigma higher by Elie index compared to the Heartharena index. Most

of these grossly overvalued or undervalued attributes stem from four different sources of

error or limitations, explained below. These errors underlie the fundamental weakness of the

Elie method for accurately evaluating the true mana cost of cards.

4.2.1 Error of Stat Distributions

Because the Elie Burzstein method assumes that the mana cost of a card is the simple

sum of its attributes, it cannot distinguish between a Spider Tank and a Razorfen Hunter,

which has its attack and health points distributed across two bodies.

Figure 20. Spider Tank and Razorfen Hunter.

4.2.2 Error of Delayed Effects

Delayed effects are worth less mana than the equivalent immediate effects. However,

the Elie Burzstein method cannot distinguish the two, thereby overvaluing handbuff attack

and handbuff health attributes, since all attributes are treated equally in the matrices.

26

Page 27: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

One such delayed effect, Deathrattle, is a conditional attribute that activates when the

character is removed from the gameboard. For example, Deathrattle: Draw means the player

draws a card after the character dies. It is not included in the computation above, since

attributes like Deathrattle: Draw is a combination of two attributes. One solution is to simply

introduce more attributes.

Figure 21. Five legal Deathrattle cards in the Standard format.

The five cards above form these matrices, where A is deathrattle attack, H is deathrattle

health, and D is deathrattle draw. We expect there to be a linear relationship between

{i , a , h , A ,H , D} and the mana cost.

β=[αahAHD

]X=[1 1 1 1 1 01 2 1 0 0 1111

246

3 2 1 02 0 0 15 4 4 0

]Y=[12346]

where β are the attribute coefficients of {i , a , h , A ,H , D}, X is the attributes of the five

cards, and Y is the mana cost. Then, with equation 2.3.3 to solve by OLD regression,

β=(X ' X )−1

( X 'Y )

27

Page 28: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

∴ β=[iahAHD

]=[0.0000.0921.3160.527

−6.0180.000

]Then, solve another system of over-determined equations by substituting aγ=A, hγ=H , and

dγ=D where γ is a conditional attribute of deathrattles.

a=0.092

h=1.316

aγ=0.527

hγ=−6.018

dγ=0.000

However, there are several drawbacks to adding new attributes for all deathrattle

effects. First, it assumes that it is equally easy to activate deathrattle effects on any type of

minion, despite it clearly not being the case: minions with higher health are harder to kill.

Second, it adds numerous attributes to a given matrix, causing it be close to singular, where

the values are too small to be accurately calculated by a computer. Moore-Penrose

pseudoinverse was used for the above sample, which is an approximation of an inverse

matrix.

4.2.3 Error of Anti-Tempo Play

As illustrated by the sample game in section 1.2, minion board advantage is a crucial

component of Hearthstone (“Hearthstone Gameplay”). Attributes that can remove threats or

introduce new threats, such as damage, weapon attack, weapon durability, overload, destroy

opponent minion, and opponent board damage are inherently powerful.

4.2.4 Error of Synergies and Parasitic Mechanics

28

Page 29: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Some attributes – can’t attack, weapon buff durability, and spell damage – inherently

require multiple synergistic cards in the deck to become powerful. They are, therefore,

underpowered in the Arena format, the focus of this research.

The Elie Burzstein method assumes that cards with the same attribute are competing

against each other. For example, the simple regression section 2.2 showed that Fireball is

superior to Darkbomb. Then, if a deck wants to run one damage spell, Darkbomb is out-

competed by Fireball. Parasitic mechanics, on the other hand, becomes more powerful the

more cards with the same attribute are in the same deck. These mechanics skew the Elie

method.

4.3 Iterative Reduction of Error

It is possible to increase the accuracy of the Elie Burzstein method by manually

iterating on the attributes and attribute coefficients.

Figure 22. Data versions and their coefficient of determination. Method R2 ValueElie Burzstein method 1.0 0.047Version 2.0:

Converted all “Taunt” attributesequal to 1.

0.062

Version 3.0: Removed outlier cards Succbus,

Mind Blast, Dust Devil, and Circleof Healing

Separated “ally board heal” attributefrom “ally board damage.”

Removed “can’t attack” attribute.

0.091

Figure 17 shows that iteratively removing or modifying outlier cards and attributes is

only increases by the R2 value by a marginal amount. It means that the inaccuracy does not

29

Page 30: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

stem exclusively from few outliers. The most effective method of improving the accuracy of

the Elie method, then, would be to solve systematic errors like the mana cost.

5. Alternative Theoretical Methods of Card Appraisal

5.1 The LightForge Method

The LightForge, a team of professional Arena players, has internally developed a

mathematical model that can assess the power level of a card in a vacuum. Then, with

statistical input and professional players’ feedback, they adjust the scores to publish the

LightForge Index, which has a high correlation with the HearthArena Index (ADWCTA et

al.). While the team does not disclose its methods, the model is known to be able to mitigate

the error of stat distribution and delayed effects.

Figure 23. Comparison of HearthArena index and LightForge index.

30

Page 31: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

0 20 40 60 80 100 120 1400

20

40

60

80

100

120

140

160

180

200

R² = 0.78

HearthArena Index VS LightForge Index

HearthArena Index

Lig

htfo

rge

Inde

x

5.2 The Metagame Clock

Even the rather accurate LightForge index fails in the Standard format, where players

can freely build decks. In an environment where card selections are not random, the power

level of individual cards is less significant than that of established deck archetypes. It is more

adequate to use game theory to estimate the relative match-up winrates and popularity of a

deck in a given environment of other decks. Such a model, dubbed the Metagame Clock, has

been developed by competitive players based on matchup win-rate statistics (Krumov).

6. Conclusion

While the Elie Burzstein method allows for the evaluation of the power level of a card

in a format without any prior playtesting, it is a grossly inaccurate approach at best.

The significance of this paper is that it updated the method for the modern Arena

format, provided further analysis of the results which lacked in the original paper, and

provided suggestions for possible improvements.

While the Elie Burzstein method may not be accurate enough for professional players,

it is simpler than the LightForge method as a tool for developing prototypes of cards.

31

Page 32: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

However, both HearthArena and LightForge index suggests that thorough statistical data

collection and player input is required for both game designers and professional players alike.

7. Appendix

A. Computational Methods

All raw data was collected from Hearthpwn card database and recorded into Microsoft

Excel. Then, it was imported into MatlabTM with this syntax:

filename = ‘Extended Essay.xlsx’;

sheet = ‘Sheet1’;

xlRange = ‘A1:Z256’;

X = xlsread(filename,sheet,xlRange)

Other matrix and statistical operations were also done in MatlabTM:

Inverse matrix: inv(matrix)

32

Page 33: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Pseudoinverse matrix: pinv(matrix)

Matrix product: matrix1*matrix2

Transpose matrix: matrix.’

Arithmetic mean: mean(array)

Standard deviation: std(array)

B. Description of Attributes

Figure 19. Description of all attributes analyzed. Classification Attribute DescriptionBasic Intercept The cost of playing an empty card. Always 1.

Attack Attack points of a minion. Health Health points of a minion.

Basic keywords Charge Can attack the turn this minion is summoned. Divine shield The first instance of damage is negated. Elusive Cannot be targeted by spells or hero powers. Poisonous Destroys any minion damaged by this minion. Overload Reduces available mana next turn. Spell damage Ally damage spells deal more damage. Stealth Cannot be targeted until it attacks. Taunt Enemy characters must attack this first. Windfury Can attack twice a turn.

Attack, damage & health

Damage Reduce life total or health points. Restore health Increase life total of a character. Buff attack Increase the attack points of a minion. Temporary buff attack Buff attack this turn only. Buff health Increase the health points of a minion.

Weapon Weapon attack Ally hero can attack with a weapon equipped.

33

Page 34: Mathematics Extended Essay Statistical Evaluation of CCG ... › Media › Jeewoong-Chang-Mathematics-EE.pdf · Mathematics Extended Essay Statistical Evaluation of CCG Cards To what

Weapon durability Number of times that a weapon can attack. Weapon buff attack Buff attack points of equipped weapon. Weapon buff durability Buff the durability of equipped weapon.

Minion Minion damage Deal damage to a minion. Opponent attack Give opponent a minion with attack points. Opponent health Give opponent a minion with health points.

Hero attack, damage & health

Restore ally hero health Increase the life points of ally hero. Damage opponent hero Decrease the life points of opponent hero. Hero attack Give ally hero attack points this turn only.

Destroy minions

Destroy ally minion Destroy an ally minion. Destroy opponent minion Destroy an opponent minion.

Board control Opponent board damage Deal damage to all opponent minions. Ally board damage Deal damage to all friendly minions. Freeze board Freeze all opponent minions.

Card manipulation

Draw Draw a card from the top of the deck. Opponent draw Opponent draws cards. Discard Move a random card from your hand to the graveyard.

Mana manipulation

Gain mana Gain empty, permanent mana crystals. Gain temporary mana Gain usable mana crystals this turn only.

Other effects Can’t attack This minion cannot attack. Freeze Prevent a character from attacking next turn. Silence Remove the text of a minion.

Set mechanics Adapt Choose one upgrade to a character. Attack on opponent’s turn Buffs attack during opponent’s turn. Handbuff attack Buff attack of a random minion in your hand. Handbuff health Buff health of a random minion in your hand. Summon Jade Golem Summon a Jade Golem which increases in attack and

health the more Jade Golems you summon.

C. Attribute Coefficients

Figure 20. Attributes and their computed attribute coefficients. Attribute Method version Attribute Method version

V1 V2 V3 V1 V2 V3Intercept -

0.0878-0.1146

-0.2278

Opponent health -1.9590

-2.3301

-2.3365

Attack 0.49140.4653 0.489

Restore ally herohealth

0.25410.2582 0.3047

Health 0.38700.4283 0.4222

Damage opponent hero

0.49510.4923 0.3553

Charge 0.3226 0.3137 0.3102 Hero attack 0.7166 0.7217 0.7273Divine Shield 0.4017

0.4348 0.4285Destroy ally minion

-3.0301

-3.0646

-3.0901

Elusive 0.39590.5497 0.5377

Destroy opponent minion

4.89724.9058 4.984

Poisonous 0.89520.8039 0.8791

Opponent board damage

1.56721.5703 1.787

Overload -0.8027

-0.7414

-0.7673

Ally board damage

-0.8154

-0.8021

-0.6677

Spell damage 0.5452 0.4918 0.5157 Ally board heal n/a n/a 0.3737Stealth 0.2134 0.2431 0.2516 Freeze board 3.0206 3.0443 2.9408Taunt 0.1496 0.5389 0.5804 Draw 1.7436 1.7525 1.7802

34