Damage Calculation - Night-Sky-Studio/interknot-calculator GitHub Wiki

Disclaimer

Before we start, I need to set some things straight. I NEVER claimed, nor am I going to claim that this calculator is 100% accurate. It is not and never will be; it's not a simulator. You can create a simulator that will be based on this, but keep in mind the GPL-3.0 license.

Formulas

At the base of this entire project lays this document. It contains the damage and daze formula and how they are being calculated. These formulas are implemented as GetStandardDamage(), GetStandardDaze() and GetAnomalyDamage() functions in the Calculator class.

Stats

All stats are divided into Conditional and Unconditional stats.

  • Conditional stats are stats that require something more complex than adding two numbers together. These include various passives, team buffs, enemy debuffs (resistance shreds), etc. Require thorough character skill-kit research. These cannot be shown on Character Cards in both Enka and Inter-Knot as neither have access to any data about those stats.
  • Unconditional stats are stats that can be calculated on the fly. These include things like base stats, weapon main and secondary stats, drive disc stats, drive discs 2pc set, etc. These are the stats that both Enka and Inter-Knot can calculate and display.

Preparing the calculation

Calculator receives the following information when requested a calculation:

  • characterId - The ID of the character
  • weaponId - The ID of the weapon
  • driveDiscs - An array of currently equipped drive discs
  • team - An array of team members IDs
  • stunBonus - Enemy Stun Bonus Multiplier
  • rotation - A string list of actions that character takes

Characters

What is taken into account:

  • Currently Equipped Drive Discs

What is NOT TAKEN into account:

  • Character level
  • Mindscape level
  • Equipped Weapon
  • Core Skill level
  • Talents levels

All characters are assumed to be at Lv. 60 with Core Skill at Lv. 7 and Talents at Lv. 12 (in other words - max levels for all respective values). All S-rank characters are assumed to be at Mindscape Level 0 (M0), A-rank characters are assumed to be at Mindscape Level 6 (M6), unless stated otherwise.

Mindscape levels other than M0 are not currently supported for S-rank characters AT ALL!

Weapons

All S-rank weapons are assumed to be at Upgrade Level 1 (P1), A-rank weapons are assumed to be at Upgrade Level 5 (P5) with no exceptions.

Order or calculation

  1. Agent with base stats initialized

  2. All unconditional stats are collected:

    • Weapon main and secondary stats
    • Drive disc stats
    • Drive disc 2pc set stats

    These stats are the stats shown in the Leaderboard table and Character Cards.

  3. All conditional stats are collected:

    • Weapon passive
    • Drive Disc 4pc set passive
    • Character passive
    • Team members' external buffs
      • Team members' passives
      • Team members' weapon passive
      • Team members' drive disc sets 4pc passive
    • Team member fraction (or element) passive

    These stats are the stats shown in the Final Calculated Stats section of Leaderboard table.

  4. Each action in the rotation is calculated.

    All agent actions have specific tags assigned to them. Some conditional stats only apply to specific action types. (ex. Zhu Yuan's signature weapon ("Riot Suppressor Mark VI") passive ("Security Patrol") gives 35% DMG Bonus to Special and ExSpecial attacks only). If action has any unconditional bonuses (ex. Miyabi's BasicAtk "Shimotsuki" provides 60% DMG Bonus and 30% Ice RES PEN), they are included as well.

    Rotation actions have NO EFFECT on each other. This means that all passives that rely on previous actions or anomaly triggers are either ignored completely or apply only partially (ex. Ellen's signature weapon ("Deep Sea Visitor") passive ("Lord of Seas") gives additional 10% CRIT Rate for 15s only after an enemy has been attacked with a Dash attack - this part of the passive is ignored). More about those you can find in each implemented character and weapon individually.

Example stats collection

This shows how calculator collects its final stats using Miyabi with signature weapon (Hailstorm Shrine) and drive discs of user LilyStilson (1500438496).

Unconditional stats

Base stats

Character Lv. 60, Mindscape Lv. 0, Core Skill Lv. 7, Talents Lv. 12

  • Hp: 7673
  • Def: 606
  • Atk: 880
  • CritRate: 5%
  • CritDamage: 50%
  • Impact: 86
  • AnomalyMastery: 116
  • AnomalyProficiency: 238
  • EnergyRegen: 1.2

Weapon stats

Hailstorm Shrine (P1) Lv. 60

  • Atk: 743
  • CritRate: 24%

Drive discs stats

Woodpecker Electro: 2pc. Branch&Blade Song: 4pc

  • HpRatio: 15%
  • Hp: 2200 + 448
  • AtkRatio: 30% + 9%
  • Atk: 316 + 95
  • DefRatio: 14.4%
  • Def: 184 + 30
  • CritRate: 8% + 36%
  • CritDamage: 16% + 48% + 48%
  • Pen: 9
  • AnomalyProficiency: 27
  • Ice DMG Bonus: 30%

Combined unconditional stats

  • Hp: 7673 * (1 + 0.15) + (2200 + 448) = 11471.95
  • Def: 606 * (1 + 0.144) + (184 + 30) = 907.264
  • Atk: (880 + 743) * (1 + 0.3 + 0.09) + (316 + 95) = 2666.97
  • CritRate: 5% + 24% + 8% + 36% = 73%
  • CritDamage: 50% + 16% + 48% + 48% = 162%
  • Impact: 86
  • AnomalyMastery: 116
  • AnomalyProficiency: 238 + 27 = 265
  • EnergyRegen: 1.2
  • Pen: 9
  • Ice DMG Bonus: 30%

Conditional stats

Weapon passive

  • CritDamage: 50%
  • Ice DMG Bonus: 40%

Drive disc 4pc set passive

  • CritDamage: 30%
  • CritRate: 12%

Character passive

  • Ice DMG Bonus: 30%

Combined (final) stats

  • Hp: 11471.95
  • Def: 907.264
  • Atk: 2666.97
  • CritRate: 73% + 12% = 85%
  • CritDamage: 162% + 50% + 30% = 242%
  • Impact: 86
  • AnomalyMastery: 116
  • AnomalyProficiency: 265
  • EnergyRegen: 1.2
  • Pen: 9
  • Ice DMG Bonus: 30% + 40% + 30% = 100%

These stats are then used to calculate the damage (daze for stun agents) values.

Example calculation

Let's calculate the damage dealt by the Miyabi's action - shimotsuki 3 using the stats from the above.

Skill data

  • Damage scale: 4282.8%
  • Daze scale: 567%
  • Affixes:
    • DMG Bonus: 60%
    • Ice RES PEN: 30%
  • Tag DMG Bonus: none
  • Ability Passive: none

Calculating the damage

  • Base DMG Attacker

    Formula:

    BaseDmgAttacker = SkillDmgScale * Atk
    
    • SkillDmgScale = 4282.8%

    Result: 42.828 * 2666.97 = 114220.99116

  • Base DMG Target

    Formula:

    BaseDmgTarget = 1 + AgentElementalDmgBonus + AgentDmgBonus + TagElementalDmgBonus + TagDmgBonus + SkillElementalDmgBonus + SkillDmgBonus
    
    • AgentElementalDmgBonus = Ice DMG Bonus = 100%
    • SkillDmgBonus = DMG Bonus = 60%

    Result: 1 + 1 + 0 + 0 + 0 + 0 + 0.6 = 2.6

  • Crit Multiplier Formula:

    CritMultiplier = 1 + (CritRate + TagCritRateBonus) * (CritDamage + TagCritDamageBonus)
    
    • CritRate = 85%
    • CritDamage = 242%

    Result: 1 + 0.85 * (2.42) = 3.057

  • Enemy Defense Multiplier

    Enemy: Notorious Dullahan Lv. 70

    Formula:

    EnemyDefMultiplier = LevelFactor / (Max(EnemyDef * (1 - PenRatio) - Pen, 0) + LevelFactor)
    
    • LevelFactor = 953
    • EnemyDef = 794
    • Pen = 9

    Result: 794 / (Max(794 * (1 - 0) - 9) + 953) = 0.45684695051783658

  • RES Multiplier Formula:

    ResMultiplier = 1 + ElementalResPen + ResPen + TagElementalResPen + TagResPen + SkillElementalResPen + SkillResPen
    
    • SkillElementalResPen = Ice RES PEN = 30%

    Result: 1 + 0 + 0 + 0 + 0 + 0.3 = 1.3

  • Final Damage Formula:

    FinalDmg = BaseDmgAttacker * BaseDmgTarget * CritMultiplier * EnemyDefMultiplier * ResMultiplier * DamageTakenMultiplier * StunMultiplier
    
    • DamageTakenMultiplier = 1
    • StunMultiplier = 1.5 (burst rotation on stunned enemy)

    Result: 114220.99116 * 2.6 * 3.057 * 0.45684695051783658 * 1.3 * 1 * 1.5 = 808760.72487024

Which corresponds with the number from the calculator: Example Damage Calculation

What if the calculator is wrong?

Open an issue on GitHub and provide exactly how, where it's incorrect and how it needs to be corrected. The formula is here, you now know now it works. I am not a theory-crafter, never was, never gonna be, so if I missed something, please let me know and I will try to fix it as soon as possible.