## Combat Calculations

Formulas for calculating Damage, Attack Speed, and more in Project Ember.

# Guide Contents

This guide contains the following calculations/formulas.

# Weapon Triangle Bonuses

The weapon triangle has been buffed in Project Ember, and now gives ± 2 Atk/15 Hit to the winning/losing sides by default.

\(T_{atk} = \begin{cases} +2, & \text{if winning} \\ -2, & \text{if losing} \\ 0, & \text{otherwise} \end{cases}\)\(T_{hit} = \begin{cases} +15, & \text{if winning} \\ -15, & \text{if losing} \\ 0, & \text{otherwise} \end{cases}\)# Attack

Attack (Atk) represents the maximum amount of damage a unit can do, assuming an enemy has no Def or Res. It depends on the unit's Str/Mag and the weapon's might. Weapon effectiveness, weapon triangle, and support bonuses also factor in. The formula for Atk is the following.

\(Atk_{sp} = \text{Atk bonuses from supports}\)\(E = \begin{cases} 3, & \text{if using effective weapon} \\ 1, & \text{otherwise} \end{cases}\)\(Atk = (Str \parallel Mag) + E * (Mt_{wp} + T_{atk}) + Atk_{sp}\)# Defense and Resistance

Defense (Def) and Resistance (Res) represent how well a unit can withstand physical and magic attacks respectively. Physical weapons target Def, whereas tomes target Res. These values come from the unit's Def and Res stats, but can be increased by support bonuses and terrain. The Def and Res on the right side of the formula refer to the unit's stats. The formulas for Def and Res are the following.

\(Def_{ter} = \text{Def bonuses from terrain}\)\(Res_{ter} = \text{Res bonuses from terrain}\)\(Def_{sp} = \text{Def bonuses from supports}\)\(Res_{sp} = \text{Res bonuses from supports}\)\(Def = Def + Def_{sp} + Def_{ter}\)\(Res = Res + Res_{sp} + Res_{ter}\)# Damage

Damage (Dmg) is the total amount of damage inflicted per strike. A critical hit will multiple this value by 3. The formula for Dmg is the following.

\(Dmg = Atk_{attacker} - (Def_{target} \parallel Res_{target})\)# Attack Speed

Attack Speed (AS) represents how fast a unit can attack. If a unit has 4 or more AS than the unit they are attacking/countering, they will double hit. (quadruple hit for brave weapons). The base value for AS is the unit's speed stat. Weapon weight will decrease this value, but each point of Con will cancel out one point of weapon weight. The formula for AS is the following.

\(AS = Spd - (Wt_{wp} - Con)\)Note: Having extra leftover Con will not increase Attack Speed, if the unit has more Con than their weapon's weight then that part of the formula will be set to 0. Similarly, Attack Speed in general cannot go below 0.

# Hit

The hit rate (Hit) is calculated based on the weapon's hit, as well as the attacker's Skl and Lck. Weapon triangle and support bonuses also factor in. The formula for Hit is the following.

\(Hit_{sp} = \text{Hit bonuses from supports}\)\(Hit = Hit_{wp} + 2 * Skl + \frac{Lck}{2} + T_{hit} + Hit_{sp}\)# Avoid

Avoid (Avo) represents how well a unit can dodge an attack. It depends on Attack Speed and Lck. Support bonuses and terrain also factor in. The formula for Avo is the following.

\(Avo_{sp} = \text{Avo bonuses from supports}\)\(Avo_{ter} = \text{Avo bonuses from terrain}\)\(Avo = 2 * AS + Lck + Avo_{sp} + Avo_{ter}\)# Displayed Hit

Displayed hit is what the game tells you the hit rate is when a unit attacks a target. This value depends on the attacker's Hit and the defender's Avo. This is not a percentage chance. Project Ember uses true hit, meaning that it will roll 2 RNs to see whether or not an attack will hit. In general, this means that hit rates above 50 will hit more often than the number would suggest, and hit rates below 50 will hit less often.

\(Hit_{displayed} = Hit_{attacker} - Avo_{target}\)There are three staves that target enemies and inflict various status conditions: Berserk, Silence, and Sleep. The displayed hit of these staves is calculated through the following formula. Note that status staves use 1RN, so this is an actual percentage.

\(p = \text{Casting unit}\)\(e = \text{Target unit}\)\(D = \text{Tiles to target}\)\(Hit_{displayed} = 30 + 6 * (Mag_{p} - Res_{e}) + Skl_{p} - D\)# Crit

Crit represents how likely it is for a unit to land a critical hit, which does triple damage. The base crit formula has been changed in Project Ember to be simply 10 less than the unit's Skill stat (floored at 0).

\(Crit_{sp} = \text{Crit bonuses from supports}\)\(Crit = min(Skl - 10, 0) + Crit_{wp} + Crit_{sp}\)The above value is increased by 30 for Berserkers, Swordmasters, and Yoder.

# Crit Avoid

Crit Avoid (Crit Avo) represents how well a unit can avoid enemy critical hits. The initial value is equal to defending unit's Lck, but can be increased by supports.

\(CritAvo_{sp} = \text{Crit Avo bonuses from supports}\)\(CritAvo = Lck + CritAvo_{sp}\)# Displayed Crit

Similar to Displayed Hit, Displayed Crit is calculated by subtracting the attacker's Crit by the defender's Crit Avo. Unlike Displayed Hit, Displayed Crit is rolled with 1 RN. However, this is still not a percentage chance because Crit rolls after Hit. Hence the formulas for Displayed Crit and actual Crit percentage are the following.

\(Crit_{displayed} = Crit_{attacker} - CritAvo_{target}\)\(Crit\% = \frac{Hit_{true}}{100} * Crit_{displayed}\)