An Analytical Approach to Valuing Cards – Part 1 of n

Over the last month or two or three, I’ve been inspired to grow my skills with the analysis program R.  As I thought through what kind of project/dataset I could use to hone those skills, I had 2 options: work related stuff or Star Realms related stuff.  You know how that went:

The specific analytical toolset I had used elsewhere and wanted to learn in R is a multiple regression analysis.   And to get this party started, the question I’m trying to explore is: how can we objectively quantify the value of cards?

The key number to think about when it comes to card value is the cost Wise Wizard assigned to each card.  My goal in this analysis is to see how well they did when choosing those costs in comparison to the card’s abilities.

As anybody who is reading this post already knows, one of the great things about Star Realms is that the value of cards is situational.  That first turn Freighter is enormously valuable, while that late game freighter can be the card that keeps you from drawing the one damage you need to win (amirite Deon?). 

What is regression analysis? 

Regression analysis is a tool to understand and quantify the relationships between variables.

In Star Realms terms, the basic question I’m trying to explore is: given the features of any particular card (econ/combat/draw/etc) what would the fair cost be for that card given the known costs of all the other cards?   Later in the article’s Appendix I give a detailed example on how this process works.

The Star Realms cards are reasonably well suited for this analysis since they have a set of relatively common attributes/abilities, and each card has a single variable (the cost of the card) for us to compare to.  

What did this regression analysis find?

Here’s graphic which shows how much each card’s calculated value differs from the cost (the higher the cards is on the graph, the more it is under-costed).   Note: for this first analysis I limited the dataset to ships only. A card at or near 0 has a fair cost. If you want to see this broken out for each individual card cost scroll down to the bottom of this post.

My R skills were barely enough to get the color coding for single-faction cards. Try as I might I couldn’t figure out multiple colors so those are all black.

I doubt that Ark and Cutter being near the top of the distribution will surprise too many players.  And, to me, it helps validate the analysis.   

But helllllllooooooo blockade runner. 

And on the bottom end, I knew Mech Battleship (the 8 cost card added to Le Commander games) was lousy but I don’t think I fully appreciated what an absolute stinker it is (with a card value of close to 6).

Here are the Top 10 cards with strong positive relative value:

Ship NameCostRelative Value
Blockade Runner11.8
The Ark71.4
Cutter21.1
The Colossus91.1
Blob Bot30.9
Peacekeeper60.9
Predator20.9
Solar Skiff10.8
Recycle Bot10.7
Crusher30.7

Generally makes sense, and actually quite an interesting mix of cards and card types in here. 

Most of these names are no surprise at all to me.   If there’s anything on here that surprised me, I would have to say Crusher.   Clearly a solid card, but I wouldn’t have thought it was a top-10 value buy.

Possibly conspicuous in its absence here is Fred (Federation Battleship).  The challenge with Fred is that there are no other ships in the analysis which have a “scrap to heal” ability.  And since the rest of Fred’s abilities are worth 7 according to this analysis, the regression program would give the result that Fred’s scrap ability doesn’t add any value.  Would the “Scrap to heal for 10” ability be worth at least the 0.7 trade to get it onto the list?  In Dodgeball and Endurance and other differential-based formats, almost certainly. 

And here’s the bottom 10:

Ship NameCostRelative Value
Mech Battleship8-1.8
Explorer2-1.2
Survey Ship3-1.2
Merc Battlecruiser6-1.2
Battle Mech5-1.1
Blob Alpha6-1.1
Battlecruiser6-1.0
Supply Bot3-1.0
Flagship6-0.9
Mech Command Ship8-0.8

A couple comments on this list:

  • The Vanilla set is heavily represented here, especially in the mid-cost range.  There’s probably a correlation between that fact and the fact that Vanilla is the slowest set.
  • It was certainly surprising to me that Supply Bot was on this list.  It is such a strong early-game buy in V format games. 
  • The analysis had trouble with the “scrap this card to destroy a base ability”.  That one has a negative coefficient, which is nonsense.  If that were valued more accurately, battlecruiser wouldn’t be on this list.
  • Congratulations to Mech Battleship on being the only card which is a worse relative value than an explorer.
  • For cards that have either/or abilities, like Patrol Mech, I put them in twice.  Once for each of their abilities.  “Patrol Mech A” is the trade version of the patrol mech.    I’m not happy with this methodology, as it totally misses the fact that the card gives you an option to pick whichever works better each turn. I also included a “PatrolMech AB” which treats the card as having both abilities, but that obviously overstates the power level of the card.

Here are a few specific card comparisons. Discuss amongst yourselves:

ShipAbsolute Value
Cutter3.1
Patrol Cutter2.2
One is a 2-cost and one is a 3-cost

ShipAbsolute Value
Viper-0.1
Scout-0.5
Chalk one up for team #scrapscouts

ShipAbsolute Value
Ark8.4
Nanobot Swarm8.6
One factor not accounted for in the analysis is Nanobots being the “heaviest” card

Key Takeaways

  1. Overall, the cards in Star Realms are very fairly valued. 
  2. The best value cards are generally already well understood.
  3. Remember, the value of a card varies from game to game and even within a game.  Buying the best “value” card on this list every time is not a recipe for success.
  4. Beware of the implied precision of these results, especially those in the appendices. This analysis isn’t robust enough and makes too many simplifying assumptions to have high precision results.

What’s next?

As the article title suggests, this is not the last of what I hope to do with this analysis. There is plenty more to dig into with this analytical approach. 

  1. Perform a similar analysis for bases, and then integrate that with the ships analysis
  2. Figure out a better way to handle (assign different values to) scrap from hand only vs scrap from discard only vs scrap from anywhere
  3. Apply this methodology to heroes and gambits
  4. Develop a better understanding of the implications of the -.5 intercept value in the regression analysis.
  5. Add a methodology to value triggering ally abilities.
  6. Include estimated values for unique abilities to enable valuation comparison of all cards
  7. Breakouts by set (V/W/R) to quantify power level differences between the sets
  8. Breakouts by factions
  9. Applying judgement to come up with value/rankings
  10. Do a similar analysis for hero realms

I’d be happy to discuss in more depth with anyone who is interested in further analysis or anyone who has ideas on other directions to take the analysis.


How long will it take for the follow up analysis and write-up to happen? Good question.

Appendix

Some more details on the regression analysis process and the results are included below

A simple regression example

Blob fighter has two abilities, one primary (3 combat) and one ally (draw).  Regression analysis will determine a value for each of those features, which you could then plug into an equation to get the “Calculated Value” for the card.

For this example, we’ll use the equation:  Calculated Value = -.51 + 3Combat + AllyDraw    (I’ll explain the -.51 later)

If the value of 3 damage is 0.84 and the value of an ally draw is 1.34, then equation looks like:

Calculated Value of Blob Fighter = -0.51 + 0.84 + 1.34 = 1.67

Since a Blob Fighter is a 1-cost card, a value 1.67 says that the a blob fighter is a good value as a 1 cost, but would be over-priced as a 2 cost.

What is and isn’t in the analysis

For my first pass at this analysis, I simplified it by just included ships.  No bases, no heroes. 

This analysis attempts to quantify the relative value of the cards based on the card costs.  The basic assumption is that the cards are generally fairly costed and in particular, there aren’t any glaring mistakes in how certain attributes are costed.  For example, if Wise Wizard mis-priced a feature like forcing a discard, but did so consistently across all the cards with those abilities, then this type of analysis would say the card is fairly priced even if it didn’t play that way.

There are also some small dataset issues.   The overall population of a couple hundred cards may not seem small, but there are so many different possible attributes on the cards (and enough of them are very rare) that several parts of the analysis ran into challenges.  As features get more rare, the reliability of this type of analysis can break down.

Also, by its nature this type of analysis is not well suited to unique variables, so I excluded all cards with one-of-a-kind abilities.  As I do more to flush out this analysis, I expect that judgement could be used to assign values to some of those abilities.  That would enable the inclusion of the rest of the cards in the dataset.

A comment on linearity

In a regression analysis the simple way to structure the analysis it is to use a linear assumption.    For example, you find the value of a single point of combat and then multiply that value by the combat on that card.   You’ll see throughout the article in this analysis that I treat a number variables (such as healing)  that way. 

The mechanics of Star Realms game play includes a limited hand size, which introduces scarcity.  And due to that scarcity having 2 of an ability on a card is generally more than twice as beneficial as just having one.

Unfortunately, to really get a good understanding of non-linearity you need alot data.  For the Star Realms universe there are only three attributes for which we have enough data:

  • Primary ability trade (1 to 10)
  • Primary ability combat (1 to 4)
  • Primary ability scrap (1 to 2)

After I present the analysis results I’ll talk in some more detail about trade and combat.

Detailed Regression Results

For those of you who are familiar with regression results, I’ll now let you dig in.  If the section immediately below this looks like intelligible nonsense, skip past it and I will explain how it works and some of the key takeaways.

                  Estimate Std. Error t value Pr(>|t|)   

(Intercept)       -0.51375    0.46790  -1.098 0.275505   

ToPlayCombat1      0.39263    0.66318   0.592 0.555497   

ToPlayCombat2      0.61347    0.56521   1.085 0.281015   

ToPlayCombat3      0.84112    0.40325   2.086 0.040178 * 

ToPlayCombat4      2.03056    0.46094   4.405 3.24e-05 ***

ToPlayCombat5      2.78293    0.44613   6.238 1.98e-08 ***

ToPlayCombat6      3.63929    0.46333   7.855 1.56e-11 ***

ToPlayCombat7      4.70369    0.54094   8.695 3.49e-13 ***

ToPlayCombat8      4.60244    0.63754   7.219 2.68e-10 ***

ToPlayCombat10     5.44246    0.68455   7.950 1.01e-11 ***

ToPlay1Trade       0.05942    0.49853   0.119 0.905421   

ToPlay2Trade       0.96109    0.44914   2.140 0.035415 * 

ToPlay3Trade       2.55651    0.45560   5.611 2.79e-07 ***

ToPlay4Trade       3.73785    0.57304   6.523 5.76e-09 ***

ToPlayHeal         0.40583    0.05643   7.191 3.04e-10 ***

ToPlayDraw         1.71419    0.14558  11.775  < 2e-16 ***

ToPlayCycle        1.12348    0.28778   3.904 0.000196 ***

ToPlayDiscard      0.66209    0.40966   1.616 0.109993   

ToPlayPunch        0.22466    0.26812   0.838 0.404574   

ToPlayScrap1       1.05551    0.24364   4.332 4.25e-05 ***

ToPlayScrap2       2.88745    0.35342   8.170 3.76e-12 ***

ToPlayDestroyBase  1.59219    0.57684   2.760 0.007160 **

ToHand             1.21684    0.65022   1.871 0.064940 . 

Requisition       -0.24252    0.43593  -0.556 0.579550   

AllyCombat         0.26403    0.06542   4.036 0.000124 ***

AllyTrade          0.28704    0.14217   2.019 0.046839 * 

AllyHeal           0.21588    0.06797   3.176 0.002122 **

AllyDraw           1.34081    0.23334   5.746 1.59e-07 ***

AllyCycle          1.80380    0.72806   2.478 0.015336 * 

AllyDiscard        0.65139    0.35979   1.810 0.073975 . 

AllyScrap          1.10044    0.30744   3.579 0.000589 ***

AllyDestroyBase    0.96937    0.32960   2.941 0.004277 **

AllyShipToTop      0.94887    0.47677   1.990 0.049984 * 

TrashCombat        0.15757    0.06119   2.575 0.011860 * 

TrashTrade         0.18047    0.15378   1.174 0.244052   

TrashDraw          0.50271    0.26406   1.904 0.060537 . 

TrashDiscard       0.52969    0.34641   1.529 0.130184   

TrashScrapAny      0.50031    0.53759   0.931 0.354833   

TrashDestroyBase  -0.16443    0.42411  -0.388 0.699261   

Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residuals:

     Min       1Q   Median       3Q      Max

-1.76561 -0.31745 -0.06696  0.32501  1.79519

Residual standard error: 0.6956 on 80 degrees of freedom

Multiple R-squared:  0.9392,    Adjusted R-squared:  0.9103

F-statistic: 32.52 on 38 and 80 DF,  p-value: < 2.2e-16

Using these values and applying them to the cards gives an output that looks like this:

Two quick things to notice on that graph

  1. The upward linear trend and reasonably tight grouping says that this model generally works quite well at using the card attributes to predict the cost.
  2. You can see there is a spread with a range of 1-2 in value for each of the card costs, which will let us highlight some relative values.

Making sense of this by tying this back to the Blob Fighter Example

As you look through the table, focus on the first two columns.  The first one has the variable name, which I used to describe the attribute.  The next column is the estimated coefficient for that variable.    Going back to the blob fighter example, you can find the 3 terms of the equation from that example.  Specifically: the intercept (-.51), 3 combat (.84), and ally draw (1.34).

                  Estimate Std. Error t value Pr(>|t|)   

(Intercept)       -0.51375    0.46790  -1.098 0.275505   

ToPlayCombat3      0.84112    0.40325   2.086 0.040178 *

AllyDraw           1.34081    0.23334   5.746 1.59e-07 ***

Another Example

Ok, hopefully this is making some sense at this point.  Let’s get a little more complicated with another example: Ram

                  Estimate Std. Error t value Pr(>|t|)   

(Intercept)       -0.51375    0.46790  -1.098 0.275505   

ToPlayCombat5      2.78293    0.44613   6.238 1.98e-08 ***

AllyCombat         0.26403    0.06542   4.036 0.000124 ***

TrashTrade         0.18047    0.15378   1.174 0.244052   

Ability TypeAbility DetailRegression CoefficientCalculated Value
Primary5 combat2.782.78
Ally2 combat0.260.52
Trash3 trade0.180.54

Note that only primary trade and primary combat have the non-linear factors.  Ally trade/combat and trash trade/combat are set up as linear variables so the ally and trash abilities for the ram are multiplied by the quantity of that attribute.

Calculated Value of Ram = -0.51 + 2.78 + 2*(0.26) + 3*(0.18) = 3.34

Sanity Check

One of the things I like to look at as I’m trying to make sense of an output like this is to do a common sense check.

More trade is valued higher than less trade?   Check.

Draw is worth more than cycle?  Check

Primary abilities are worth more than the same ability when ally-triggered?   (mostly) Check.

No negative values?  (mostly) check. 

For the more statistically inclined of you, the other set of columns to note is the far right numbers as well as the stars next to them. These show the statistical significance of each variable.  The easy way to think about that is the more stars you see, the more reliable the results.  If it doesn’t have stars, it was either a wide range of values for that attribute or (more likely) a limited number of samples.

Some Observations on the Results Table

Value of Draw (1.71)– a draw ability on a card is worth a little less than 2 to the value of the card.   Having draw be the most highly valued abilities makes a lot of sense.  It also aligns with Admiral Rasmussen hero.

Value of Scrap (1.05) – given the value of scrap in Star Realms, this valuation for the scrap ability may seem a little low.  However, keep in mind that while machine cult cards are often great value early in the game, they can easily become dead weight later. 

Scrap from Hand / Discard / Any – one important note on scrap.  I treated any ability to scrap a card as the same ability, even though they are CLEARLY not.  There just weren’t enough cards to make the analysis work for the scrap from hand only and scrap from discard only cards.  So if I were going to tweak the values, the value for a scrap from anywhere would be higher, the value of scrap from hand would be about the same, and the value of scrap from discard only would be lower.

Value of Discard Primary Ability (.66) and Discard Ally Ability (.65) – this one is interesting in that they’re valued very similarly.   Given the real value of discards is when you’re able to stack multiple discards, this does make some sense to me that they would be closer in value than some other abilities.

Value of Trade from Trashing a Card (0.18) – this value feels quite low. 

Making Sense of the Intercept – a negative value for the intercept is a quantification of the scarcity of a star realms hand.  A card which had no abilities would be worth less than 0 in your deck.

Trade

Lets dig deeper into trade, as this is quite interesting.  Given that you can only play 5 cards per hand and that the big bomb cards cost 6 or more, being able to pack a lot of trade into a single card should be very valuable.  And, in fact, that’s what we see.

                  Estimate Std. Error t value Pr(>|t|)   

ToPlay1Trade       0.05942    0.49853   0.119 0.905421   

ToPlay2Trade       0.96109    0.44914   2.140 0.035415 * 

ToPlay3Trade       2.55651    0.45560   5.611 2.79e-07 ***

ToPlay4Trade       3.73785    0.57304   6.523 5.76e-09 ***

Having a single trade on a card doesn’t do much.  This makes sense to me, as this is amount of trade you’re getting from a scout and in a vacuum having one trade on a card isn’t particularly valuable. 

Jumping from 1 trade (0.05) to 2 trade (0.96) is an increase of almost 1 in the value of the card.  This seems reasonable at a glance and is probably what you’d expect if we just continued a linear model.

Jumping from 2 trade (0.96) to 3 trade (2.55) is where we really see the non-linearity in the value of trade.  Adding that one trade increased the card increased the value by almost 1.6.  

We continue with a large increase when jumping from 3 trade (2.55) to 4 trade (3.73).  I find it interesting that the step is not quite as large as it is from 2 to 3 – I suspect there is some sample size issues at play with this result.

Combat

As the most common ability, combat provide a bit more depth of data to play with. 

                  Estimate Std. Error t value Pr(>|t|)   

(Intercept)       -0.51375    0.46790  -1.098 0.275505   

ToPlayCombat1      0.39263    0.66318   0.592 0.555497   

ToPlayCombat2      0.61347    0.56521   1.085 0.281015   

ToPlayCombat3      0.84112    0.40325   2.086 0.040178 * 

ToPlayCombat4      2.03056    0.46094   4.405 3.24e-05 ***

ToPlayCombat5      2.78293    0.44613   6.238 1.98e-08 ***

ToPlayCombat6      3.63929    0.46333   7.855 1.56e-11 ***

ToPlayCombat7      4.70369    0.54094   8.695 3.49e-13 ***

ToPlayCombat8      4.60244    0.63754   7.219 2.68e-10 ***

ToPlayCombat10     5.44246    0.68455   7.950 1.01e-11 ***

In fact, there is enough data and enough variables that we can graph the value of combat as it increases.

A few things stand out to me here. 

  1. The big step up from 3 combat to 4.  I believe this is intentional by WWG and reflects the fact that 4 combat ships can kill many bases on their own that 3 combat ships can not.
  2. The line clearly has a different slope from 4-and-above than it does for the first 3 combat.  For the first 3 combat, the slope is about 0.3 (each additional combat is worth 0.3 trade).  For 4-and-above, the slope is 0.56
  3. There is an outlier at 7 combat.  It clearly doesn’t pass the smell test that 7 combat would be worth more than 8, and if we’re making common-sense adjustments to the values we’d probably drop that one by about 0.6 to fit it into the trend line.

Breakdown of Cards of by Cost

1 thought on “An Analytical Approach to Valuing Cards – Part 1 of n

  1. Pingback: Podcast Episode 118: One of N | Megahaulin Blog for Star Realm Strategy

Leave a comment