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.
Jump to term
Base Hit Scaling (Multipliers)
Core skill scaling from ATK/DEF/HP/SPD coefficients per hit.
- Multipliers
- The sum of each scaling stat multiplied by its coefficient.
- Stat
- The stat used by the hit (ATK, DEF, HP, SPD, etc.), including ATK/DEF/SPD buffs on the final stat: +50% / +70% / +30% of the overall stat.
- Multiplier
- Skill coefficient for that stat contribution.
Example
Multipliers are the values shown in swarfarm or in the skill selector in `/damage-optimizer`.
Buffed stats: ATK/DEF/SPD scaling uses the overall stat, so ATK buff, DEF buff, and SPD buff multiply the total stat by 1.5, 1.7, and 1.3 respectively before the hit scales from it.
ATK/DEF Increasing Effect: the bonus is calculated as BaseBuff% × (1 + effect/100) and truncated. Example: +11% ATK up effect gives ATK buff 50 × 1.11 = 55.5% potency, which gets truncated to exactly 55%, not 56%. Similaryly DEF buff 70 × 1.11 = 77.7%, which gets truncated to 77%, not 78%.
SPD Increasing Effect: uses the same truncation rule. Example: +24% effect gives SPD buff 30 × 1.24 = 37.2%, which gets truncated to 37%.
Critical Damage Term
Adds all crit-related sources into one multiplicative crit bucket.
- 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.
Damage Bonus Term (DMG%)
Elemental damage dealt, co-op modifiers, and passives/skill effects.
- ArtifactOnElement
- Damage dealt on element lines.
- ArtifactCoOp
- Co-op attack artifact modifiers.
- Other
- Skill/passive-based damage increase effects.
Examples of other bonuses
Other includes passives (Lucas, Sonia, Leah) and skill effects (Brandia S3, Argen S3).
Defense Factor
Enemy defense, ignore-defense ratio, and defense break combine into one reduction factor.
- 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
Defense Factor and Effective HP
Ignore Defense
Term 5 in damage: ignore defense reduces effective DEF input but does not remove the DEF=0 floor.
- 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 the formula floor.
Random Variance
A random ±3% factor applied to non-fixed damage.
- 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
}
Additional Damage Bucket
Flat add-on damage from fixed hits and Additional Damage by +N% of stats.
- Fixed
- Skill fixed damage bypasses crit/defense interactions, but still scales with DMG% bonuses.
- ATK · Addatk
- Additional damage by +N% of final ATK. Not affected by DMG% bonuses.
- DEF · Adddef
- Additional damage by +N% of final DEF. Not affected by DMG% bonuses.
- HP · Addhp
- Additional damage by +N% of final HP. Not affected by DMG% bonuses.
- SPD · Addspd
- Additional damage by +N% of final SPD. Not affected by DMG% bonuses.
Behavior and fixed-hit example
Additional damage by X% cannot crit, does not benefit from DMG dealt on Element, and bypasses DefenseFactor. Skill-based fixed damage also cannot crit and bypasses DefenseFactor, but unlike artifact additional damage it is still multiplied by (1 + DMG%).
Example, Coco S3: 5 hits dealing Fixed damage. Each fixed hit still scales with artifact DMG% bonuses, while artifact Additional Damage by +N% stays as a separate flat add after that.
Reductions
Late-stage reduction stack applied after the additional damage bucket.
- Additive
- Artifact + Passive - Mirinae/Branding.
- Multiplicative
- Other damage decrease effects such as Camilla S3 or Reflect Damage. Apply each DamageDecrease effect one by one.
Additive
Passives in this bucket DO NOT stack, only the highest will apply.Passives that do not stack: Darion, Dias, Byungchul, Grego. Usually if a passive says "reduce damage by %" it falls in this bucket
Multiplicative
Reflect Damage buff: Acts as a separate DamageDecrease effect and reduces incoming damage by 30%. Passives that reflect damage also decrease the damage taken and fall in this bucket. Reflected damage is calculated from the Raw damage before any damage decrease but after defense factor. Examples of effects: Camilla, Dark golem, Reflect damage buff These lists are not exhaustive, and each effect not listed here, should be tested on a case by case basis.
Chapter 2: Speed Calculation
Tick simulation, speed buckets, and ordering rules.
Speed Calculation
Tick-based turn simulation with combat speed recalculated from active effects.
Jump to term
- Δ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.
▸ 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.
Speed % Increases
Percent speed effects stack additively in one bucket before base speed multiplication.
- Σ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.
- Σ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
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).
Chilling
Chilling:
Chilling gets exactly +20 flat speed for each buff on himself. If 2 monsters have the same highest attack bar, the tie-break turn order only considers pre-combat speed, which excludes passives. That means Chilling will always go last in a speed tie-break scenario.
Tested with Rigna and Tablo on various speeds, speed lead, and swift/non-swift configurations.
Sonia
Sonia:
Sonia gets full bonus at +50 speed faster than the enemy.
Leah
Leah:
Leah gets full bonus at +150 speed faster than the enemy.
Agrius
Agrius:
Agrius gets full ignore defense at +200 speed faster than the enemy.
Birgitta / Rigna / Tirsa
Full ignore defense at +126 speed faster than the enemy.
Rigna: Rigna will auto-crit in case she is faster than the enemy by any amount (tested at 0.02 speed faster). If 2 monsters start at 0 speed in the same tick and Rigna outspeeds but does not auto-crit, the 2 monsters have exactly the same speed.
Brita
Arena/RTA (towers only): +730 ATK, +884 DEF, +129 SPD. Siege/Guild War (towers + guild flags): ~+583 ATK, ~+737 DEF, +129 SPD.
Cordelia
Gets 3.5x combat speed added to her attack.
Mirinae
Skill 3 works as negative damage resistance. It stacks additively with -DMG% artifacts, so -25% damage from X against a Mirinae skill results in 0.
Pholus Needs Testing
Needs testing.
Chow Needs Testing
Needs testing.
Deva Needs Testing
Needs testing.
Notes
Practical model scope and validation status.