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.).
- 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`.
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, branding, and passives/skill effects.
- 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).
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.
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
- 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.
Final Reduction
Late-stage damage decreases from artifacts/passives applied after additional bucket.
- Artifact-Dmg%
- Incoming damage reduction lines from artifacts.
- passive
- Passive-based final damage decrease effects.
Ignore Defense
Term 8 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 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.
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 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 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.
Notes
Practical model scope and validation status.