Disclaimer: This was posted on 8-October, 2021. The further away from the 8-October we get, the more likely that something has changed. Legend of Solgard, like all Snowprint games, is a living world and it evolves and grows. Please consider this a snapshot in time, a deep dive into what goes into a simple in-game number. And please raise a toast to Christin, the programmer who wrote this out for you!

 

Team Power Calculation

by Christin Kalina, Programmer

The calculation of the Team power value is one complex beast, and today we are going to break it down for you. This calculation compresses Embla’s stats, the stats of the lineup, (optional) boosts from the encounter as well as buffs from (optional)  booster items and (optional) buffs from the Guild and Hero Arena into one neat number that can be used to estimate your chances to beat the battle you are looking at.

The calculation collects all the aforementioned values together to get to Embla’s and the Creatures’ final stats. Those are then converted into power values and summed up. This post will first look at how Embla’s final stats are collected and converted, and then at how this is done for the creatures. Finally, we’ll look at how to calculate the power of the entire team.

Embla’s power

Embla’s raw buffed power is what you see when no creatures are selected in the lineup. “Raw” means that no hero contribution from the lineup was counted. “Buffed” means that the buffs from guild, hero arena and booster items are applied though. Since this does not include any hero contributions from creatures, and the buffs are applied after adding all those and Embla’s raw stats together, Embla’s power will be different after a lineup is selected.

Let’s go through Embla’s power calculation step by step:

  1. First Embla’s stats are gathered – These are the ones that are shown on the Hero screen.
  2. Then the hero contributions from each creature in the lineup is added on top (including encounter boosts and idols).
  3. On those summed up stat values the boost factors from guild and hero arena (and items) are applied.
  4. Step 3 gave us the final Embla Stats which are then converted into power values using constant factors and added up into Embla’s power value.

And for extra clarity, here is an example for an Epic Treasure hunt:

First things first: Embla’s raw power.

Without having any creature selected for the lineup, Embla’s raw stats are only enhanced by the buffs. For example, her Hit Points originally start at 53 and are buffed by 9% (from the guild buff). To get the actual value for the 9% of 53, we use the percent formula: 53 divided by 100 times 9 results in 4.77. This is then rounded up to 5 since we do not want to calculate with floating point values going further. Added to the 53 from Embla’s stats it gives us 58 for the final Hit points value.

Converting Embla’s final stats into the power value then works like this: Each single stat is multiplied by a stat-to-power factor that our game designer has carefully curated to represent the weight each of the stats actually carries in the encounter. Then all of those are added together to yield the power value for Embla which in this case is the team power value as there are no creatures selected yet. The power value simply disregards the numbers after the comma when converted into an integer.

With fStat representing the power conversion factor for the respective Hero Stat and PTeamEmbla representing the Team Power of an empty lineup:

PTeamEmbla = 1069

= Round ((Buffed Hit points * fHP + Buffed Spell Power * fSpellPower  + Buffed Mana * fMana  + Buffed Barrier Strength * fBarrier  + Buffed Sun Burst * fSunBurst  + Potency *fPotency )/100)  

= Round ((58 * 1000 + 17 * 550 + 44 * 150 + 6 * 2500 + 5 * 1500 + 42 * 250) / 100)

= Round ((58000 + 9350 + 6600 + 15000 + 7500 + 10500) / 100) 

= Round (106950/100)

= Round (1069.50) 

= 1069

And that is how Embla’s power is calculated. Which in this case of an empty lineup is also the Team power.

 

Lineup Power

Now, let’s add a creature to this to see how the team power value changes when selecting the lineup.

This rank 9 Valkyrie looks good. 

She has two of her gems slotted, both her attack and spell ability are level 11.

She also has a rank 7 Vidar sun idol and a rank 7 Muninn moon idol, which gives her additional creature stats as well as the hero contribution (via Embla’s stats).

Valkyrie’s final creature stats and hero contribution. These include the guild buff values (+ 1% Crit Chance and + 2% Block Chance). The + 9% HP are not counted here since they are applied to Embla’s final value.

Now, let’s check out the calculation for Valkyrie’s power which is 2684.

For that, we add together the power from the creature’s stats, the power from their abilities, and the power from their hero contribution. Those power values are again (like the hero stats before) a weighted sum of the individual values.

 

Creature stats power PCreature Stats

Since critical hit chance and block chance are percentage values, they need to be applied to the strength value first, in order to be converted into actual values. In addition, the Growth and Sync bonuses are weighted by the hold value of the creature.  The numbers and calculations that you see here are tweaked meticulously by Tove, our creature designer.

With fstatrepresenting the power factor for the corresponding stat:

Block power

PBlock = (1 + Hold) * Block Chance * Strength * fBlock = (1 + 1) * 17 * 25 * 0.03 = 25.5

Critical Hit power

PCrit = (4 – Hold) * Crit Chance * Strength *  fCrit = (4 – 1) * 29 * 25 * 0.05 = 108.75

Growth power

PGrowth = (2+ Hold) * Growth * fGrowth = (2+2) * 15 * 5 = 225

Sync power

PSync = (4 – Hold) * Sync Bonus * fSync= (4-1) * 15 * 3 = 135

Creature Stats Power

PCreature Stats = 1456

= Round (Strength * fStrength + PGrowth + Merge bonus * fMerge + PSync + Big Bonus * fBig + Shape Bonus * fShape + PCrit + PBlock)

= Round(25 * 20 + 225 + 21 * 12 + 135 + 13 * 10 + 16 * 5 + 108.75 + 25.5)

= Round(500 + 225 + 252 + 135 + 130 + 80 + 108.75 + 25.5)

= Round(1456.25)

 

Creature Abilities Power PAbilities

The abilities also count toward the power of a creature. Here again, each stat is multiplied by a power conversion factor, and all of them are summed together to represent how strong the ability is.

Since the abilities are very different from each other, the power factors for abilities are adjusted for each ability individually.

Attack Ability Power

PAttack = 306

= Power * fPower + Luck * fLuck + Bonus * fBonus + Evolve * fEvolve

 = 7 * 30 + 50 * 0.2 + 12 * 3 + 1 * 50

Spell Ability Power

PSpell = 391

= Power * fPower + Luck * fLuck + Bonus * fBonus + Evolve * fEvolve 

= 7 * 30 + 55 * 0.2 + 10 * 3 + 7 * 20

Abilities Power

PAbilities = PAttack+PSpell = 306 + 391 = 697

Hero Stats Contribution Power PHeroContribution

This step is skipped when calculating the power the creature has in a lineup, since all hero contributions are counted together before applying the buffs.

When looking at the creature individually, though, the Hero Stats contribution is added to the final power value of the creature.

This calculation is the same as calculating Embla’s power. Since this was demonstrated earlier, let’s skip right to the value:

PHeroStats = 531

Summing all those power values together, we get:

PCreature = PCreature Stats + PAbilities = 1456 + 697 = 2153

PCreatureStandalone = PCreature  + PHeroContribution = 2153 + 531 = 2684

Team Power

To get the team power from Embla’s stats and the stats of the creatures, first the power of the creature without the hero contribution power is summed up. Then the hero power is calculated from the sum of Embla’s power and the lineups’ hero contributions. Added together, those give us the final team power.

PLineupFinal = Sum(Pcreature1, …, Pcreature4) = 2153

PHeroStatsFinal = Sum( ((Embla stats + Sum(Hero Contribution) ) * BuffHeroStat ) * fHeroStat )

The buffed sums of Embla’s stats and lineup’s hero contribution is shown when selecting a creature for the team. So for the example with Valkyrie we have:

For Hit points: 

HPunbuffed = (HPembla + HPValkyrie) = 81

HPfinal = HPunbuffed + HPunbuffed*HPBuff = 81 + 81*9% = 88

This then is repeated for all other stats and their power conversion factor is applied as when calculating Embla’s power alone.

PHeroStatsFinal 

= Round(( HPfinal*fHP + SpellPowerfinal*fSpellPower + Manafinal*fMana + BarrierStrengthfinal*fBarrierStrength + SunBurstfinal*fSunBurst + Potencyfinal*fPotency)/100)  

= Round((88*1000 + 34*550 + 44*150 + 10*2500 + 6*1500 + 59*250)/100) 

= 1620

Let’s go back to the beginning of this example: Embla’s power alone was 1069, and Valkyrie’s hero contribution was 531, which would be 1600 added together. The 20 points there is the difference that the timing of adding the buffs makes, and thus also one of the reasons why adding up all the creature powers does not result in the team power.

Now, adding PHeroStatsFinal with PLineupFinal results in 1620 + 2153 = 3773…which is the team power that we see on the pre battle screen.

 

Hope you got something out of this little demonstration, and thank you for reading this far. Here is a little bonus info for you: In the code, we often use the working titles of features, and because of that, the sun burst is secretly called “color bomb.”

What else would you like to know?