Damage Calculation
The complete damage formula reverse-engineered from the IL2CPP runtime. Covers NumberUnit math, BasicShipStatus, BasicSkillData, DamageInfo structs, and the full 28+ modifier category chain.
NumberUnit Math
All large numbers in Darkstar use the NumberUnit encoding to handle values that exceed standard floating-point precision. A NumberUnit stores two components:
value = quotient * 10^exponent
For example, a ship with fPowerQuotient = 3.45 and iPowerExponent = 12
has a base ATK of 3.45 × 1012 (3.45 trillion).
All arithmetic in the damage pipeline operates on NumberUnit values.
NumberUnit arithmetic normalizes after each operation: the quotient is kept in [1.0, 10.0) and the exponent is adjusted accordingly. This prevents precision loss during the multi-step damage calculation.
Core Structs
3 structsBasicShipStatus
The runtime stats struct for a ship during battle. Defined at TypeDefIndex: 273
in the IL2CPP dump.
| Field | Type | Offset | Notes |
|---|---|---|---|
eBattleSide | BattleSide | 0x0 | Which side this ship is on |
eShipType | ShipMainType | 0x4 | Ship type (Player, Enemy, ArenaShip, etc.) |
eDamageType | AttackDamageType | 0x14 | Weapon type (MachineGun, Missile, Laser, Lightning) |
MaxShield | NumberUnit | 0x40 | Maximum shield value |
MaxHP | NumberUnit | 0x50 | Maximum hit points |
Power | NumberUnit | 0x80 | Attack power (ATK) |
AutoRepair | NumberUnit | 0x88 | HP regeneration rate |
ChargingShield | NumberUnit | 0x90 | Shield recharge rate |
fAttackSpeed | float | 0xA4 | Attacks per second |
fPercentRate | float | 0xB4 | Percentage rate modifier |
iAdmiralID | int | 0xC8 | Equipped admiral proto ID |
BasicShipStatus has no defense stat fields. There is no DEF,
no MDEF, and no "magic defense" anywhere in the struct. Defense is handled
entirely through percentage-based DamageReduction float fields on
ShipController (see Defense Reduction below).
BasicSkillData
The resolved skill parameters for the current attack action. Defined at
TypeDefIndex: 274.
| Field | Type | Offset | Notes |
|---|---|---|---|
eType | SkillType | 0xC | Normal attack, active skill, passive, etc. |
eTargetType | SkillTargetType | 0x10 | Target selection method |
iTargetCount | int | 0x1C | Number of targets hit (-1 = all) |
fPower | float | 0x40 | Skill power coefficient |
fCriticalDamageBonus | float | 0x48 | Skill-specific crit damage bonus |
eDamageType | AttackDamageType | 0x4C | Weapon type for this skill (MachineGun, Missile, Laser, Lightning) |
DamageInfo
The output structure produced by the damage calculation pipeline. Defined at
TypeDefIndex: 276. Contains 24 fields; key ones shown below.
| Field | Type | Offset | Notes |
|---|---|---|---|
eTargetSide | BattleSide | 0x0 | Target's battle side |
eShipType | ShipMainType | 0x4 | Attacker's ship type |
eTargetShipType | ShipMainType | 0x8 | Target's ship type |
eHitEvent | HitEventType | 0xC | Hit type (normal, crit, etc.) |
Damage | NumberUnit | 0x28 | Final damage after all modifiers |
eDamageType | AttackDamageType | 0x60 | Weapon type (MachineGun, Missile, Laser, Lightning) |
bIsDoubleShot | bool | 0xA8 | Whether this is a double-shot hit |
fDoubleShotDamage | float | 0xAC | Double-shot damage multiplier |
Damage Calculation Chain
The damage formula is a multi-step pipeline executed by BattleManager. Each step
applies a category of modifiers. The chain proceeds in this order:
Step 1: Base Damage
BaseDamage = Power * fPower
The attacker's Power (NumberUnit at offset 0x80 in BasicShipStatus) is multiplied
by the skill's fPower coefficient (float at offset 0x40 in BasicSkillData).
Step 2: Damage Reduction
PostReduction = BaseDamage * (1.0 - DamageReduction)
Defense is a flat percentage reduction stored in ShipController float fields.
There is no diminishing-returns curve, no scaling constant, and no separate physical/magical
defense split. The reduction fields are:
| Field | Offset | PropertyType | Applies To |
|---|---|---|---|
mfDamageReductionBonus | 0x78 | 29 | All damage (universal) |
mfNormalDamageReductionBonus | 0x7C | 38 | Normal attacks only |
mfSkillDamageReductionBonus | 0x80 | 39 | Skill attacks only |
mfBossDamageReductionBonus | 0x84 | 40 | Boss damage only |
mfArenaReductionBonus | 0xA0 | 62 | Arena PvP only |
The appropriate reduction is selected based on attack context (normal vs skill vs boss, Arena vs PvE). All reduction applies identically regardless of weapon type (MachineGun, Missile, Laser, Lightning).
Step 3: Critical Hit
if (random() < CritChance):
PostCrit = PostDefense * CritDamage
else:
PostCrit = PostDefense
Crit chance is checked per hit. If the skill has a non-zero SkillCritChance,
it overrides the ship's base crit rate. Same for SkillCritDamage.
Step 4: Modifier Categories (28+)
After the base/defense/crit calculation, the engine applies 28+ categories of multiplicative and additive modifiers. These come from equipment, admirals, memory cards, gemstones, buildings, buffs, debuffs, and mode-specific effects.
| # | Category | Source | Type |
|---|---|---|---|
| 1 | Weapon ATK% | Equipped weapon | Multiplicative |
| 2 | Armor HP% | Equipped armor | Multiplicative |
| 3 | Accessory Bonus | Equipped accessory | Multiplicative |
| 4 | Admiral Equip Effects | Equipped admiral (up to 35 slots) | Additive within, multiplicative across |
| 5 | Admiral Owned Effects | All owned admirals | Additive |
| 6 | Ship Owned Effects | All owned ships | Additive |
| 7 | Memory Card Equip | Equipped memory cards | Additive within category |
| 8 | Memory Card Hold | All owned memory cards | Additive |
| 9 | Gemstone Effects | Socketed gemstones | Additive |
| 10 | Gemstone Set Bonus | Gemstone collection completion | Multiplicative |
| 11 | Building Bonuses | Base buildings | Additive |
| 12 | Artifact Passive | Equipped artifacts | Varies |
| 13 | Skill Damage% | Skill-specific damage bonus | Multiplicative |
| 14 | Weakness Damage% | WeaknessDamageUp_Bonus (PropertyType 37) | Multiplicative |
| 15 | Target Type Bonus | Bonus vs. specific eMainType | Multiplicative |
| 16 | Boss Damage% | Extra damage to boss targets | Multiplicative |
| 17 | Normal Damage% | Extra damage to non-boss targets | Multiplicative |
| 18 | Weapon Type Damage% | Per-weapon bonuses (MachineGun/Missile/Laser/Lightning, PropertyTypes 651–658) | Multiplicative |
| 19 | Drone Type Damage% | Per-drone bonuses (Scout/Frigate/Helicopter/Striker/Destroyer/Cruiser, PropertyTypes 659–664) | Multiplicative |
| 20 | Active Skill Damage% | Bonus to active (non-basic) skills | Multiplicative |
| 21 | Basic Attack Damage% | Bonus to basic attacks only | Multiplicative |
| 22 | Crit Damage% Bonus | Additive to crit multiplier | Additive to CritDamage |
| 23 | All Damage% | Universal damage multiplier | Multiplicative |
| 24 | Damage Reduction (target) | Target's damage reduction stat | Multiplicative (inverse) |
| 25 | Buff: ATK Up | Temporary combat buff | Multiplicative |
| 26 | Debuff: Damage Reduction Down | Target debuff reducing damage reduction | Multiplicative |
| 27 | Mode-Specific Multiplier | Chronos bonus, Raid multiplier, etc. | Multiplicative |
| 28 | Awakening Bonus | Ship/equipment awakening tier bonus | Multiplicative |
The exact order of modifier application affects the final result due to multiplicative vs. additive stacking. Categories that are additive within themselves but multiplicative with other categories must be summed first, then multiplied. The engine processes them in the order shown above.
Simplified Formula
FinalDamage =
Power
* fPower (skill coefficient)
* (1.0 - DamageReduction)
* CritMultiplier
* ProductOf(All Multiplicative Modifiers)
* (1 + SumOf(All Additive Modifiers))
In practice, the formula is more nuanced because some modifier categories stack additively
within their group before being multiplied with other groups. The exact behavior for each
PropertyType is defined in BattleManager's damage calculation logic
(the exact method name has not been confirmed in the IL2CPP dump).
DPS Estimation
EffectiveDPS =
FinalDamage
* AttackSpeed
* (1 + CritChance * (CritDamage - 1))
* TargetCount
This gives the expected damage per second accounting for crit probability.
For AoE skills with iMaxTargetCount = -1, multiply by the average
number of targets present.
- Are there damage floors or ceilings?
LimitedMaxDamage(PropertyType 701) exists but its behavior is unknown. - How do damage-over-time (DoT) effects interact with the modifier chain?
- Is there a separate formula for healing, or does it reuse the damage pipeline with inverted sign?
- How do weapon-type damage bonuses (PropertyTypes 651–658) interact with the type-specific reduction fields?
- What is the exact stacking behavior when multiple reduction fields apply simultaneously?
- How does
DamageReflection_Function(PropertyType 1003) work?