SpaceDwarves Wiki
Documents game v0.16.0

Combat & Defense Overview

Not every encounter in the deep is friendly. Combat in SpaceDwarves is a round-based, auto-resolving system shared by two situations: alien raids on your colony and exploration encounters during expeditions. Both use the same underlying resolution engine and the same enemy roster, so the gear, dwarves and tactics you invest in pay off everywhere.

This page explains how a fight is decided. For the raid lifecycle see /combat/raids; for the gear that swings the numbers see /combat/equipment.

The Combat Contexts

Context Where Who fights What triggers it
Alien Raid Your colony (an asteroid’s buildings) Garrison dwarves + installed turrets Automatic — driven by colony wealth, sector traits and galaxy rules
Sector Raid (v0.16.0) A sector station you hold beyond Alpha Parked capitals & drones + turrets + garrison Automatic while online — see Sector Raids
Exploration Encounter A live expedition stage The expedition squad A combat outcome branch rolled at a stage, or a sector hazard trait
Rift Dive A dimensional rift (10-level dungeon) Your fleet — drones + dwarf-crewed capital ships You deploy into a rift discovered by an expedition

Raids and encounters never add a sixth stage to an expedition and never end your control of an asteroid. They are a setback system, not an empire-ender. See /world/expeditions for the 5-stage run structure that encounters plug into.

Unlike raids and exploration encounters — which the engine auto-resolves and hands you as a digest — a rift dive is a manual, turn-based battle you control directly. It fields its own units (expendable drones as cannon fodder and capital ships as the main combatants), with its own difficulty curve and rewards, including the ship-part materials dropped by each level’s mini-boss. See Rifts & Fleet for the full system.

No Permadeath

The colony-wide no-permadeath rule (see /dwarves/status-needs) applies fully to combat. A dwarf reduced to 0 health is Downed, never killed:

Downed  →  Rescued (on combat end)  →  Injured  →  Hospital / Medbay recovery

The only punishment from combat is lost time (benched, injured crew) and, in raids, resource and structure damage. Dwarves always come home.

How a Fight Resolves

Combat is round-based with simultaneous declaration and sequential resolution by initiative. The whole encounter is resolved instantly and presented to you as a combat digest (a summary of what happened), the same way expedition comms events are. A typical encounter runs 3–6 rounds, with a hard safety cap of 12 rounds (10 for a raid wave).

Each round, every living combatant — dwarves, turrets and enemies alike — is sorted by initiative and acts in order:

[Combat begins]
  └── Sort all combatants by initiative (highest acts first)
        └── Each round:
              ├── Each combatant attacks (or uses a special action)
              ├── Roll to hit; on a hit, deal (damage − target mitigation)
              ├── Apply status effects (burning, stasis, suppressed, ...)
              ├── Check for Downed combatants (HP ≤ 0)
              └── Check end conditions (all enemies down, all squad down, or retreat)

Initiative — who acts first

initiative = baseInitiative
           + weapon.initiative
           − armour.initiativePenalty
           + roll(0, 3)        // small variance, prevents fixed turn order

Turrets roll a modest baseline initiative (2–6). Ties are broken in the dwarves’ favour: dwarf > turret > enemy. Light, fast gear (high weapon initiative, low armour penalty) lets a dwarf strike before the enemy can.

Hit chance

hitChance = BASE_HIT_CHANCE (65%)
          + weapon accuracy bonus
          − target evasion        // scouts +10 to evade, heavies −10
          + state modifiers        // e.g. stasis: +20 vs the target

Hit chance is clamped to a 5%–100% range. A hit-roll of 95 or higher is a critical hit, dealing 150% damage. With the default settings that is roughly a 6% crit chance.

Damage vs mitigation

actualDamage = max(1, (weaponDamage + bonuses) − targetMitigation)

Mitigation can never fully absorb a hit — a successful hit always deals at least 1 damage. Some weapons add bonus damage or bypass mitigation entirely (for example the Void Axe deals +8 to armoured enemies; a charged Runic Cannon shot ignores all mitigation). For structures, shield and plating absorption is applied before the building loses HP.

Core resolution constants

These values live in the authoritative combat config (data/combat/combatConfig.json):

Constant Value Meaning
BASE_HIT_CHANCE 65% Baseline hit chance before modifiers
CRITICAL_HIT_THRESHOLD 95 Roll ≥ 95 is a critical hit (~6% base)
CRITICAL_HIT_MULTIPLIER 1.5× Critical hits deal 150% damage
MIN_DAMAGE 1 A successful hit always deals at least 1
INITIATIVE_VARIANCE roll(0, 3) Per-round initiative randomness
STASIS_ACCURACY_BONUS +20 Accuracy bonus when attacking a stasised target
GUARDIAN_DAMAGE_REDUCTION 15% Squad damage cut by the Guardian ability
COURAGE_ALE_COMBAT_REDUCTION 25% Combat damage cut by active Courage Ale
BURNING_DAMAGE_PER_ROUND 3 Damage-over-time per burning tick
BURNING_DURATION_ROUNDS 2 Rounds a burn lasts
SUPPRESS_ACCURACY_PENALTY −10 Accuracy penalty on a suppressed target
SCOUT_EVASION_BONUS +10 Scout-type enemies are harder to hit
HEAVY_EVASION_PENALTY −10 Heavy-type enemies are easier to hit

What a Combatant Contributes

A dwarf’s effective fighting power layers three things: their underlying capability, the gear they carry, and any signature ability:

combatPower = capability("combat")           // accommodation stat × class fit × traits × health × fatigue
            × weapon damage bonus
            × armour mitigation bonus
            + signature ability effects        // qualitative

Dwarf capability

Combat capability uses the same capability formula as every other domain (see /dwarves/overview), trained through the Garrison’s defense stat. What differs is class fit — how naturally each dwarf class fights:

Class Combat class fit Notes
Foreman 1.0 Primary combat fit — Foremen lead squads
Pilot 0.9 Adapts well to a fight
Miner 0.7 Tough but untrained
Engineer 0.7 Resourceful; leans on equipment
Scientist 0.5 Reluctant combatant
Trader 0.5 Avoids fights

Health and fatigue feed in directly: a hurt or exhausted dwarf hits softer. Equip them, rest them and train the Garrison’s defense stat to raise the floor.

Equipment

Each dwarf has three loadout slots — weapon, armour, and an optional utility sidearm. Weapons add damage, accuracy and initiative; armour adds flat mitigation and a bonus HP pool (at the cost of initiative on heavy suits). Equipment is durable (never consumed by use), though ranged and energy weapons draw on ammunition / power-cell components. Full catalog and rules at /combat/equipment.

Structures (defense buildings)

Colony defense is built, not improvised. Five defense buildings work together:

Building Role
Armory Crafts every weapon, armour, turret and plating; charges energy weapons
Turret Platform Holds turrets that fire automatically during raids
Garrison / Bunker Houses defense dwarves; boosts turret damage per occupant
Shield Generator Station Projects an asteroid-wide damage-absorbing field
Sensor Array Early-warning radar; previews incoming raids

Turrets fight as independent combatants with their own initiative and attack rate — they can hold off a Tier 1 raid with no dwarf involvement. Plating and shields reduce or absorb damage to the buildings themselves. See /combat/raids for how these stack into a defense rating.

Signature Abilities in Combat

Certain legendary/rare dwarf abilities (see /dwarves/overview) change the rules of a fight:

Ability Combat effect
guardian Reduces all squad combat damage by 15%; can save one dwarf from being Downed once per encounter
lastStand If the whole squad would be wiped, it survives at 1 HP with banked loot intact
ironWill The dwarf’s health term never drops below 0.5; absorbs 20 extra damage before Downed
pathfinder Unlocks a post-combat exploration branch after a win, for extra loot
silverTongue Opens a “Negotiate” (non-combat) option against some void-pirate enemies

Active Courage Ale (see /dwarves/ale-potions) further cuts combat damage by 25% for the whole expedition.

Downed Outcomes

When a combatant hits 0 HP:

  • Enemy Downed — removed from combat; its loot is added to the rewards pool.
  • Dwarf Downed — enters the Downed → Rescued → Injured → Hospital pipeline.

Injury severity scales with where the dwarf fell:

Situation Injury severity
Exploration Stage 1–2 combat Minor (~4 h)
Exploration Stage 3 combat Moderate (~12 h)
Exploration Stage 4–5 combat Severe (~24 h)
Downed in a raid Moderate (raid waves are treated as Stage-3 severity)
Wearing Void Carapace Severity reduced by one tier

Retreat

In an exploration encounter you may order a retreat at the start of any round, before attacks resolve:

  • Combat ends immediately; banked expedition loot is preserved.
  • Damage already taken in resolved rounds is kept.
  • The outcome option that triggered the encounter yields no loot.
  • Doctrines can auto-retreat if squad health drops below your set threshold.

In a raid, retreat is not available — the Garrison fights until the wave is repelled or every defender is Downed.

Implementation Status

The shared combat resolution model, the raid scheduler and exploration encounters are all implemented and live in 0.10.0 (client/js/systems/combat.js and raids.js). All numeric values — weapon/armour/enemy stats, hit chance, raid odds and intervals — are flagged first-pass / balance TBD in the source and are expected to be tuned before launch. A number of advanced weapon special effects are fully defined in the data catalog and surfaced in the UI, while the resolver implements the core set first; treat exotic per-weapon effects as design-intended rather than finally balanced.

See Also

Documents SpaceDwarves v0.10.0 · Changelog