CP Calculation

It’s bothered me not knowing how the CP values on the hero cards are calculated. Here is some preliminary work on this:

Looking solely at the CPs of fully ascended 4* and 5* heroes, excluding last year’s Spring event, a simple linear regression gives a very good, but not perfect, fit using the formula:

CP = 40.26 * Stars + 5 * SpecialLvl + 0.2030 * Attack + 0.1650 * Defense + 0.080 * Health + 0.845 * Event + 3.62 * HotM

Standard error = 0.7595
Adjusted R-squared = 0.9808

So, 4* heroes start with a base of about 321 points (including the value of 8 levels of special attack) and 5* with a base of about 401. Attack is valued about 20% per point, while defense is about 16.5% per point, and health half of that.

The Event and HotM variables control for an effect I saw scanning the residuals from the simple form of the regression: Event heroes and, particularly, Heroes of the Month had CP values that didn’t line up with their estimated values. Event heroes have a small but statistically significant boost (0.845 points, P-value=0.3%). HotM have large and highly significant boost (3.62 points, P-value=1.7E-15). This suggests that SG just pins the HotM CP at 777 regardless of the underlying stats. I expect they’d rationalize that boost by pointing to the extra power of the special, but that opens a whole can of worms about trying to compare the value of specials across heroes.

BTW, I excluded Master Lepus and Jack O’Hare, specials from the Spring 2017 event, as they were large outliers and, as early one-off heroes, probably don’t tell us a lot about the current CP formula.

I intend to improve this calculation by adding in data from incomplete ascensions and 3* heroes. Anyone who’s got data they’d like to contribute, please throw it my way!

15 Likes

That’s impressive and convincing stuff. Thanks for sharing.

If you assume that HOTMs are pinned at 777, does excluding them (and their variable) improve your already bloated R-squared?

Putting in two vectors of indicator variables to control for the HotM and Event effects improved the adjusted R^2.

How about if you confine the regression to standard heroes, excluding all special event and HOTM characters? I’m just speculating that if there has been some manual fiddling with CP values for these heroes, then excluding them from the analysis might provide a cleaner formula for the others.

(Mind you, I’m really nit-picking here in an attempt to add some value - what you’ve found already looks pretty clean. Feel free to shoot me down.)

So with a little more data (added Avalon heroes and the January–April HotM), the regression results are highly stable. Here are the updated values:

CP = 39.9 * Stars + 5 * SpecialLvl + 0.2043 * Att + 0.1651 * Def + 0.081 * Health + 0.614 * Event + 3.93 * HotM.

Standard error = 0.8125
Adjusted R-squared = 0.9833
N=66

Excluding the event heroes and HotM as @Brobb suggested doesn’t change the values much, as one would hope.

CP = 40.0 * Stars + 5 * SpecialLvl + 0.2029 * Att + 0.1661 * Def + 0.081 * Health

Standard error = 0.7573
Adjusted R-squared = 0.9730
N=41

No changes to my conclusions in the OP.

3 Likes

Thanks, you helped me a lot

For those of us who don’t know, what is “CP”? :slight_smile:

4 Likes

No idea, but guess is ‘Card Power’

1 Like

Yes, it’s the “Power” number on the card. Sorry, I borrowed a Pokemon GO acronym.

3 Likes

@Kerridoc, did you ever update your formula after the 15.1 changes?

1 Like

Hmm, no. That’d be a good project.

2 Likes

If you decide to do it, please tag me when you publish :slight_smile:

1 Like

@Kerridoc
Is your calculation are still current?

I putted some data into a table…

Column “E” the power from the card and column “G” the fomula.

Just wodering I missed something or why isn’t it the same?
And what do you mean with the standard error

There has been a complete rework of CP since my original port, so the numbers eill have changed a lot. It’s one of my many projects that i’m Behind on…

Note: “CP” = Card Power

I’ve worked out the exact CP formula.

Each card has a base CP when stats are all 0. That value is:

1* Base CP: 0
2* Base CP: 10
3* Base CP: 30
4* Base CP: 50
5* Base CP: 90

Specials are worth 5 extra CP for each level after the first

Talent tree nodes are worth a flat 5 CP each, and stat increases from talent tree nodes don’t have a direct effect on CP (so whether the node gives you 15 Attack or 45 Attack, it’s still 5 CP). See the discussion in posts below for the details.

The Full Formula

CP=(base CP for stars) + floor(attack * 0.35 + defense * 0.28 + health * 0.14) + (special level - 1) * 5 + (Talent tree nodes) * 5

Examples:

Marjana at 4/80 special 8:

A: 669 D: 712 H:1404

floor(669*0.35+712*0.28+1404*0.14)=630
CP(calc)=90+630+35=755
True CP: 755

Gobbler at 1/1 special 1:

A:347 D:212 H:613

floor(347*0.35+212*0.28+613*0.14)=266
CP(calc)=50+266=316
True CP: 316

Hawkmoon at 3/41 special 8:

A:459 D:432 H:618

floor(459*0.35+432*0.28+618*0.14)=368
CP(calc)=30+368+35=433
True CP: 433

Tiburtus at 3/60 special 8:

A:548 D:525 H:868

floor(548*0.35+525*0.28+868*0.14)=460
CP(calc)=50+460+35=545
True CP: 545

Onatel at 4/10 special 8:

A:534 D:704 H:1242

floor(534*0.35+704*0.28+1242*0.14)=557
CP(calc)=90+557+35=682
True CP: 682

32 Likes

Talent Grid upgrades appear to tack on another 5 points per each node.

From my understanding, that’s consistent regardless of star rating, and I think regardless of what the actual upgrade is as well.

4 Likes

I believe that’s correct, although I haven’t verified it yet, so I left it off. I’ll edit it in when I have some cross-check data.

1 Like

Ok, I did some verification, and this is correct. The critical thing to note is that stat upgrades beyond max ascension max level do not affect Card Power

Example:

Rigard 4/70 special 8
A:595 D:673 H:1166

floor(595*0.35+673*0.28+1166*0.14)=559
CP(calc)=50+559+35=644
True CP: 644

At class 6, with with 2 levels of Manashield, 1 health, 2 defense. 1 attack, he has stats:
A:610 D:709 H:1202

His true CP is 674 (644 + 30).

4 Likes

Thanks for confirming — that was my anecdotal observation, but it’s good to have actual confirmation.

1 Like

Sure thing. I guess it makes sense that they did things this way:

15 pts of attack = 15*0.35=5.25
18 pts of defense = 18*0.28=5.04
36 pts of health = 36*0.14=5.04

The attack is the slightly better deal.

The % boost nodes are the ones where things can get a little out of alignment, because someone with unusually high stats can get a big boost for 5 pts.

Elena with a 4% attack boost gets 32 points of attack. That should be worth 11 CP, but only adds 5.

1 Like