Documentation

Summoners War Mechanics

This page documents two core chapters in SWCALC: Damage Formula and Speed Calculation. Formulas are practical prediction formulas used in the optimizer.

Chapter 1: Damage Formula

Complete damage pipeline with terms 1 through 8.

Final Damage Equation

This is the full execution order used by the model.

Damage=(MultipliersCritDMG%DefenseFactorVariance+Additional)(1Reduction%)Damage \allowbreak = \allowbreak \Bigl( \text{Multipliers} \cdot \allowbreak \text{Crit} \cdot \allowbreak \text{DMG\%} \cdot \allowbreak \text{DefenseFactor} \cdot \allowbreak \text{Variance} + \text{Additional} \Bigr) \allowbreak \cdot \allowbreak \left(1\nobreak-\nobreak\text{Reduction\%}\right)

Jump to term

Term 1

Base Hit Scaling (Multipliers)

Core skill scaling from ATK/DEF/HP/SPD coefficients per hit.

Multipliers=StatMultiplier\text{Multipliers} = \sum \text{Stat} \cdot \text{Multiplier}
Multipliers
The sum of each scaling stat multiplied by its coefficient.
Stat
The stat used by the hit (ATK, DEF, HP, SPD, etc.).
Multiplier
Skill coefficient for that stat contribution.
Deep notes and example

Multipliers are the values shown in swarfarm or in the skill selector in `/damage-optimizer`.

1 × [ ATK × 1.9 + MAX HP × 0.15 ]
Term 2

Critical Damage Term

Adds all crit-related sources into one multiplicative crit bucket.

Crit=\text{Crit} =(1+Skillups\bigl( 1 + \textbf{Skillups}+CDrune+ \text{CD}_{\text{rune}}+CDarti+ \text{CD}_{\text{arti}}+CDbonus+ \text{CD}_{\text{bonus}}CDtaken)- \text{CD}_{\text{taken}} \bigr)
Skillups
"Damage +X%" skill-up bonuses; additive with all crit damage sources.
CDrune
Crit damage shown on the monster in-game.
CDarti
Artifact lines that include crit damage; additive in the same term.
CDbonus
External bonuses such as Euldong, tower, lead.
− CDtaken
Enemy artifact "Crit DMG Taken −N%" applied as subtraction.
Artifact crit damage line behavior
  • CD High/Low HP +N% always active, applies to all hits.
  • S1 / S2 / S3 Crit DMG +N% only applies when that specific skill is used.
  • First Attack Crit DMG +N% applies only on the first hit of the attack.
  • Own 1-target CD +N% applies on the monster's turn for all hits.
Own 1-target interaction during coop is still uncertain and needs testing.
Term 3

Damage Bonus Term (DMG%)

Elemental damage dealt, co-op modifiers, branding, and passives/skill effects.

DMG%=1+ArtifactOnElement+ArtifactCoOp+Branding+Other\text{DMG\%} = 1 + \text{Artifact}_{\text{OnElement}} + \text{Artifact}_{\text{CoOp}} + \text{Branding} + \text{Other}
ArtifactOnElement
Damage dealt on element lines.
ArtifactCoOp
Co-op attack artifact modifiers.
Branding
Brand debuff damage increase.
Other
Skill/passive-based damage increase effects.
Examples of other bonuses

Other includes passives (Lucas, Sonia, Leah) and skill effects (Brandia S3, Argen S3).

Term 4

Defense Factor

Enemy defense, ignore-defense ratio, and defense break combine into one reduction factor.

DefenseFactor=10001142+3.572DEF\text{DefenseFactor} = \dfrac{1000}{1142 + 3.572 \cdot \text{DEF}}DEF=Defense(1Ignore%)Dbreak\text{DEF} = \text{Defense} \cdot \left(1 - \text{Ignore\%}\right) \cdot \text{Dbreak}
Defense
Target defense stat before reductions.
Ignore%
Ignore-defense ratio from skills and effects.
Dbreak
0.3 with Defense Break active, 1 otherwise.
Deborah and Herteit modeling details

Deborah Deborah is modeled as debuff-strength amplification:

Dbreak = 1 - (0.70 × (1 + DeborahBonus))

DeborahBonus is 0.30 (normal) or 0.15 (boss).

Herteit Herteit S3 Absorb is treated as stat transfer:

stolen = rate × knowledge × BaseStat

Rate is 0.25 (normal) or 0.10 (boss).

Term 5

Random Variance

A random ±3% factor applied to non-fixed damage.

Variance[0.97, 1.03]\text{Variance} \in [\,0.97,\ 1.03\,]
Variance
Random factor in the interval [0.97, 1.03].
Scope
Applies to damage before fixed/additional bucket is added.
Practical sampling model used

The simplest model matching observed behavior is a triangular-like sample:


function sampleRandomVariation () {
  return 1 + (Math.random() + Math.random() - 1) * 0.03
}
          
Term 6

Additional Damage Bucket

Flat add-on damage from fixed hits and Additional Damage by +N% of stats.

Additional=Fixed+ATKAddatk+DEFAdddef+HPAddhp+SPDAddspd\text{Additional} = \text{Fixed} + \text{ATK} \cdot \text{Add}_{\text{atk}} + \text{DEF} \cdot \text{Add}_{\text{def}} + \text{HP} \cdot \text{Add}_{\text{hp}} + \text{SPD} \cdot \text{Add}_{\text{spd}}
Fixed
Fixed damage component that bypasses crit/defense interactions.
ATK · Addatk
Additional damage by +N% of final ATK.
DEF · Adddef
Additional damage by +N% of final DEF.
HP · Addhp
Additional damage by +N% of final HP.
SPD · Addspd
Additional damage by +N% of final SPD.
Behavior and fixed-hit example

Additional damage by X% cannot crit, does not benefit from DMG dealt on Element, and bypasses DefenseFactor. This fixed damage is added to every hit.

Example, Coco S3: 5 hits dealing Fixed damage.

5 × [ ATK × 1.5 Fixed ]
Term 7 Needs Testing

Final Reduction

Late-stage damage decreases from artifacts/passives applied after additional bucket.

Reduction%=Artifact-Dmg%+passive\text{Reduction\%} = \text{Artifact}_{\text{-Dmg\%}} + \text{passive}
Artifact-Dmg%
Incoming damage reduction lines from artifacts.
passive
Passive-based final damage decrease effects.
This term is still marked NEEDS TESTING and should be treated as provisional. What needs testing is the stacking behavior: whether reductions stack additively, stack multiplicatively, or if only one value is used (for example first-applied or highest value). Many damage-reduction passives explicitly state they do not stack with each other.
Term 8

Ignore Defense

Term 8 in damage: ignore defense reduces effective DEF input but does not remove the DEF=0 floor.

DefenseFactor=10001142+3.572DEF\text{DefenseFactor} = \dfrac{1000}{1142 + 3.572 \cdot \text{DEF}}DEF=Defense(1Ignore%)Dbreak\text{DEF} = \text{Defense} \cdot \left(1 - \text{Ignore\%}\right) \cdot \text{Dbreak}
DefenseFactorDEF=0\text{DefenseFactor}\big|_{\text{DEF}=0}=10001142+3.5720= \dfrac{1000}{1142 + 3.572 \cdot 0}=100011420.876= \dfrac{1000}{1142} \approx 0.876
DefenseFactor|DEF=0
At DEF = 0, the factor is still 1000/1142 ≈ 0.876, not 1.
Ignore defense
Reduces the DEF input; does not remove formula floor unless effective DEF logic reaches zero through full ignore setup.

Chapter 2: Speed Calculation

Tick simulation, speed buckets, and ordering rules.

Speed Calculation

Tick-based turn simulation with combat speed recalculated from active effects.

ΔATBper tick=CombatSpeedTickSize100\Delta \text{ATB}_{\text{per tick}} = \text{CombatSpeed} \cdot \dfrac{\text{TickSize}}{100}
CombatSpeed=BaseSpd(1+Spd%)+FlatSpdSlowSpdBuff\text{CombatSpeed} = \left\lceil \text{BaseSpd} \cdot \left( 1 + \sum{\text{Spd\%}} \right) + \sum{\text{FlatSpd}} \right\rceil \cdot \text{Slow} \cdot \text{SpdBuff}

Jump to term

Spd%=Totem+Lead+Other Spd% Effects\sum{\text{Spd\%}} = \text{Totem} + \text{Lead} + \text{Other Spd\% Effects}FlatSpd=RuneSpd+OtherFlatBbonuses\sum{\text{FlatSpd}} = \text{RuneSpd} + \text{OtherFlatBbonuses}
SpdBuff%=30(1+SpeedUpEffect100)\text{SpdBuff\%} = \left\lfloor 30 \cdot \left(1 + \dfrac{\text{SpeedUpEffect}}{100}\right) \right\rfloor
Slow={0.7,if Slow debuff is active1,otherwise\text{Slow} = \begin{cases} 0.7, & \text{if Slow debuff is active} \\ 1, & \text{otherwise} \end{cases}SpdBuff={1+SpdBuff%100,if Speed Buff is active1,otherwise\text{SpdBuff} = \begin{cases} 1 + \dfrac{\text{SpdBuff\%}}{100}, & \text{if Speed Buff is active} \\ 1, & \text{otherwise} \end{cases}
ΔATBper tick
Attack bar gain each tick from current combat speed and tick size.
CombatSpeed
Ceiled speed from base speed scaling, flat speed, slow, and speed buff.
SpdBuff%
floor(30 × (1 + SpeedUpEffect/100)).
Slow
0.7 if slow debuff is active, 1 otherwise.
SpdBuff
1 + SpdBuff%/100 if speed buff is active, 1 otherwise.
Implementation rules and edge cases

Swift correction: the game display uses ceil() on rune speed and ignores speed lead/tower/swift interaction in that view, so SWCALC corrects the rounding error when calculating true combat speed.


const frac = (BaseSpd * 0.25) % 1
const swiftCorrection = (isSwift && frac > 0) ? (1 - frac) : 0
const speed = speed - swiftCorrection
          

Speed-up effect truncation: potency is truncated down. Example: +22% speed-up effect gives floor(30 * 1.22) = floor(36.6) = 36%, not 36.6%.

Leo rule: if Leo exists, non-Leo monsters are capped to the lowest Leo combat speed.

Turn trigger: a unit can move when attack_bar >= 100. If multiple units are ready, highest attack_bar goes first.

Same speed order: when monsters have the same speed/priority, they move in the same order they were selected in setup.

Worked example

Unit has 105 base SPD, lead 33%, totem 15%, +150 speed on Swift, Speed Buff active, and Speed Up Effect of 13%.

Step 1: Base-with-lead+tower speed = 105 × (1 + 0.48) = 155.4.

Step 2: Swift correction: frac = (105 × 0.25) % 1 = 0.25, so correction = 1 - 0.25 = 0.75, and effective rune speed = 150 - 0.75 = 149.25.

Step 3: Add rune speed = 155.4 + 149.25 = 304.65.

Step 4: Round up before buff: ceil(304.65) = 305.

Step 5: Speed Buff potency = floor(30 × (1 + 0.13)) = floor(33.9) = 33%, so buff multiplier is 1.33.

Step 6: Apply buff: 305 × 1.33 = 405.65 combat speed.

Result: Final combat speed is 405.65.

Note: If the unit is not Swift, no correction is applied, so pre-round speed is 155.4 + 150 = 305.4 and ceil(305.4) = 306, exactly 1 higher.

Does Agrius Ignore Defense in Dragons?

Agrius has 104 base SPD, tower 15%, +145 speed on runes, Speed Buff active, Speed Up Effect of 24%, no lead.

Step 1: Base-with-tower speed = 104 × 1.15 = 119.6.

Step 2: Add rune speed = 119.6 + 145 = 264.6.

Step 3: Round up before buff: ceil(264.6) = 265.

Step 4: Speed Buff potency = floor(30 × (1 + 0.24)) = floor(37.2) = 37%, so buff multiplier is 1.37.

Step 5: Apply buff: 265 × 1.37 = 363.05 combat speed.

Step 6: Enemy speed is 163, so gap = 363.05 - 163 = 200.05.
Result: Agrius is more than +200 faster, so he gets full ignore defense.

Agrius Ignore-Defense Check

Computes combat speed and checks whether the speed gap meets the ignore-defense threshold.

Base SPD: 104 Enemy SPD: 163 Threshold: 200
Spd Buff
37%
× 1.37
Pre-Buff Speed
265
Raw: 264.60
Combat Speed
363.05
Pre-round ceil: 265
Speed Gap
Ignores
200.05
needs ≥ 200
Show math (exact steps used for the numbers above)

Step 1: Base-with-tower speed = 104 × 1.15 = 119.6.

Step 2: Add rune speed = 119.6 + 145 = 264.6.

Step 3: Round up before buff: ceil(264.6) = 265.

Step 4: Speed Buff potency = floor(30 × (1 + 0.24)) = floor(37.2) = 37%, so buff multiplier is 1.37.

Step 5: Apply buff: 265 × 1.37 = 363.05 combat speed.

Step 6: Enemy speed is 163, so gap = 363.05 - 163 = 200.05.

Result: Agrius is more than +200 faster, so he gets full ignore defense.

Pre-round raw: 264.60
SpeedGap check: 200.05200

Speed % Increases

Percent speed effects stack additively in one bucket before base speed multiplication.

BaseSpd(1+Spd%)\text{BaseSpd} \cdot \left( 1 + \sum{\text{Spd\%}} \right)
ΣSpd%
Totem + lead + other percent-speed effects stack additively.
Example
+24% lead and +15% other source behave as +39% total on base speed.

Flat Speed Bonuses

Flat speed is applied after base-speed percentage scaling.

SpeedBeforeRound=(BaseSpd(1+Spd%))+FlatSpd\text{SpeedBeforeRound} = \left( \text{BaseSpd} \cdot \left( 1 + \sum{\text{Spd\%}} \right) \right) + \sum{\text{FlatSpd}}
ΣFlatSpd
Rune speed + other flat speed effects from skills/passives.
Order
Applied after base-speed percent calculation, before slow/buff multipliers and ceil rounding.

Unit-Specific Info

Special-case behavior for selected units.

Deborah

Deborah Deborah is modeled as debuff-strength amplification:

Dbreak = 1 - (0.70 × (1 + DeborahBonus))

DeborahBonus is 0.30 (normal) or 0.15 (boss).

Herteit

Herteit Herteit S3 Absorb is treated as stat transfer:

stolen = rate × knowledge × BaseStat

Rate is 0.25 (normal) or 0.10 (boss).

Chilling

Chilling Chilling: Chilling gets 19.5 < x < 20 speed from passive in combat, but initial sorting is done from pre-combat speed (speed_base) and remains stable by pick order. If multiple monsters share that pre-combat speed, Chilling stays behind them in that tie group and effectively goes last among them regardless of his in-combat ~+39.5. (If you know the exact value PLEASE do let me know)

Sonia

Sonia Sonia: Sonia gets full bonus at +50 speed faster than the enemy.

Leah

Leah Leah: Leah gets full bonus at +150 speed faster than the enemy.

Agrius

Agrius Agrius: Agrius gets full ignore defense at +200 speed faster than the enemy.

Notes

Practical model scope and validation status.

Predicted damage is usually within ~0.1%, and only rarely up to ~0.3% difference.
These are model formulas for prediction and tuning, not reverse-engineered game source code.