Combat System

Fully deterministic combat with no RNG. Initiative, damage formulas, counter tags, and battle reports.

Inputs

  • Fleet A — list of ship stacks with their blueprint loaded
  • Fleet B — list of ship stacks with their blueprint loaded

Initiative

fleet_speed = weighted_average(ship_speed across all ships)

The fleet with higher speed attacks first each round.


Round Loop

while both fleets have ships alive:
    attacker selects targets
    damage applied
    defender retaliates
    repeat

Damage Formula

Per attacking ship:

effective_damage =
  base_damage ×
  targeting_modifier ×
  counter_modifier

Damage is applied in order:

1. shield_absorb  → reduces incoming by shield value
2. armor_absorb   → reduces remaining by armor value
3. hull_damage    → remainder applied to hull

A ship is destroyed when hull ≤ 0.


Counter Tags

Weapon modules carry counter tags that interact with defense module tags:

Weapon TagBonus AgainstModifier
armor_piercingArmored targets1.25×
shield_breakerShield-heavy targets1.25×
anti_missileMissile weaponsIntercept

Defense modules can carry resistance tags:

Defense TagResists
piercing_resistancearmor_piercing weapons
breaker_resistanceshield_breaker weapons

When a weapon tag matches a defense weakness:

counter_modifier = 1.25

Otherwise:

counter_modifier = 1.0

Combat Log

Every event in every round is stored:

CombatEvent {
  attacker_blueprint
  defender_blueprint
  damage_done
  ships_destroyed
}

A human-readable battle report is generated from the log after combat completes.


Determinism Verification

hash = sha256(fleetA_state + fleetB_state + engine_version)

This hash can be used to verify that combat results were not tampered with. The same inputs always produce the same hash and the same outcome.