Purpose: AI-readable reference for Structs combat. Consolidates formulas, requirements, outcomes, and edge cases.
| Action | Message | Description |
|---|---|---|
| Attack | struct-attack |
Direct struct-to-struct combat |
| Defend | struct-defense-set |
Set struct to defense mode (blocking) |
| Raid | planet-raid-complete |
Planet assault; steals unrefined ore |
Combat in Structs revolves around four ambits. Each struct operates in one ambit, and each weapon can only target specific ambits. This creates a strategic mesh where fleet composition and positioning determine what you can hit and what can hit you.
| Ambit | Bit Value |
|---|---|
| Water | 2 |
| Land | 4 |
| Air | 8 |
| Space | 16 |
Which ambits each struct’s primary weapon can hit:
| Struct | Lives In | Targets (Primary) | Targets (Secondary) |
|---|---|---|---|
| Command Ship | Any (movable) | Local only (flag 32 = current ambit) | — |
| Battleship | Space | Space, Land, Water | — |
| Starfighter | Space | Space | Space |
| Frigate | Space | Space, Air | — |
| Pursuit Fighter | Air | Air | — |
| Stealth Bomber | Air | Land, Water | — |
| High Altitude Interceptor | Air | Space, Air | — |
| Mobile Artillery | Land | Land, Water | — |
| Tank | Land | Land | — |
| SAM Launcher | Land | Space, Air | — |
| Cruiser | Water | Land, Water | Air |
| Destroyer | Water | Air, Water | — |
| Submersible | Water | Space, Water | — |
Which structs can attack into each ambit:
| Target Ambit | Threatened By |
|---|---|
| Space | Battleship, Starfighter, Frigate, High Altitude Interceptor, SAM Launcher, Submersible |
| Air | Frigate, Pursuit Fighter, High Altitude Interceptor, SAM Launcher, Cruiser (secondary), Destroyer |
| Land | Battleship, Stealth Bomber, Mobile Artillery, Tank, Cruiser |
| Water | Battleship, Stealth Bomber, Mobile Artillery, Cruiser, Destroyer, Submersible |
The Command Ship can attack into any ambit but must first move there (see below).
The Command Ship is the only struct that can change ambits. All other structs are fixed in their operating ambit.
structsd tx structs struct-move [cmd-ship-id] [new-ambit] [new-slot] [new-location] --from [key] --gas auto --gas-adjustment 1.5 -yEach struct has a Max HP that determines how much damage it can absorb before destruction.
| Struct | Max HP |
|---|---|
| Command Ship | 6 |
| All other structs | 3 |
damage = sum(successful_shots) - damageReduction
if damage >= health then health = 0
else health = health - damage
| Variable | Description |
|---|---|
| weaponShots | Number of shots per attack |
| weaponShotSuccessRate | Per-shot success (Numerator/Denominator) |
| weaponDamage | Damage per successful shot |
| damageReduction | Defense reduction |
| health | Target current health |
Algorithm: For each shot, IsSuccessful(weaponShotSuccessRate); if true, add weaponDamage. Apply damageReduction to total. Minimum damage after reduction is 1. Cap at target health.
Attack results: Attack events include health results (remaining health after attack) in addition to damage amounts.
if weaponControl == guided then successRate = guidedDefensiveSuccessRate
else successRate = unguidedDefensiveSuccessRate
canEvade = IsSuccessful(successRate) if successRate.Numerator != 0
The interaction between a weapon’s control type (guided/unguided) and the target’s defense type is the core of combat tactics. This matrix determines whether shots can be evaded:
| Target Defense | vs Guided | vs Unguided |
|---|---|---|
| Signal Jamming (Battleship, Pursuit Fighter, Cruiser) | 66% miss | Full hit |
| Defensive Maneuver (High Alt Interceptor) | Full hit | 66% miss |
| Armour (Tank) | Full hit, -1 damage | Full hit, -1 damage |
| Stealth Mode (Stealth Bomber, Submersible) | Same-ambit only | Same-ambit only |
| Indirect Combat Module (Mobile Artillery) | Full hit | Full hit |
| None | Full hit | Full hit |
Tactical takeaways: Use unguided weapons against Signal Jamming targets (Battleship, Pursuit Fighter, Cruiser). Use guided weapons against Defensive Maneuver targets (High Alt Interceptor). Armour always reduces damage by 1 regardless of weapon control.
Stealthed structs (Stealth Bomber, Submersible) are not invisible – they can still be targeted by structs in the same ambit. Stealth blocks cross-ambit targeting only. A stealthed Submersible (water) can be attacked by other water structs, but air/land/space structs cannot target it.
struct-stealth-activate [struct-id] (1 charge). Deactivation: struct-stealth-deactivate [struct-id].Attacker takes damage after firing: health = health - weaponRecoilDamage. Recoil only applies if the attacker survives the entire shot sequence (including counter-attacks).
If health == 0 and postDestructionDamage > 0, damage applies to surrounding structs.
if !evaded and defender exists and defender.operatingAmbit == target.operatingAmbit then
if weapon.blockable and defender.ReadinessCheck() then
canBlock = IsSuccessful(defender.blockingSuccessRate)
Requirements (all must be true):
GetWeaponBlockable returns true)A struct cannot block for a friendly in a different ambit. Blocking is strictly same-ambit defense. Unlike counter-attacks, block is attempted on every shot (not limited to once per attack).
Each struct can counter-attack at most once per struct-attack invocation. Counter-spent state is tracked per struct per attack command (not per target, not per shot). For a 3-shot Attack Run: the defender counters on the first shot only, but can attempt to block all 3 shots. The target counters once after all shots resolve.
Counter-attacks are ambit-independent from the defended target. A space-based defender can counter-attack a space-based attacker even while defending a land-based struct.
| Scenario | Damage |
|---|---|
| Same ambit as attacker | counterAttackDamage (full) |
| Different ambit from attacker | counterAttackDamage / 2 |
Requirements (all must be true):
GetWeaponCounterable returns true)CanCounterTargetAmbit)Two types of counter-attack:
struct-attack invocation. Fires even on evaded shots.struct-attack invocation. Destroyed targets cannot counter.Both the defender and the target can counter-attack – an attacker may take damage from two sources per target.
damage = planetaryShieldBase + sum(defenseCannon.damage for each cannon on planet)
When struct-attack is executed, the following steps occur in order per target:
ResolveDefenders) – For each projectile:
struct-attack invocation) – fires regardless of evasion. Only on the first shot where the defender hasn’t already countered.struct-attack invocation) – fires after all shots resolve. Destroyed targets cannot counter.After all targets are resolved:
Each projectile gets its own EventAttackShotDetail row. For a 3-shot Attack Run, the attack event contains 3 separate shot detail entries with per-projectile hit/miss breakdowns. targetPlayerId is on EventAttackShotDetail (not EventAttackDetail).
Key implications:
struct-attack invocation, regardless of how many shots or targets| Requirement | Attack | Raid |
|---|---|---|
| Player online | ✓ | ✓ |
| Sufficient power | ✓ | ✓ |
| Sufficient charge | ✓ | ✓ |
| Fleet away | — | ✓ |
| Command Ship online | — | ✓ |
| Proof-of-work | — | ✓ |
| Outcome | Description |
|---|---|
| victory | Attacker/raider wins |
| defeat | Defender wins |
| attackerRetreated | Attacker withdrew |
Raid status: Raid status includes seizedOre – the amount of ore stolen during the raid. This is tracked on the planet_raid record and simplifies victory handling. See schemas/entities/planet.md for the planet_raid table schema.
storedOre) can be stolen – not unmined ore on the planet (remainingOre). Alpha Matter is secure. A successful raid seizes all of the target player’s storedOre, not a partial amount. One raid = total loss.IsSuccessful uses hash(blockHash, playerNonce) % Denominator < Numeratorstruct-attack invocation. For multi-shot weapons (Attack Run with 3 projectiles), the defender counters on the first shot only but can attempt to block all 3 shots. The target counters once after all shots.When a struct reaches 0 HP, it is destroyed and removed from the game. The destroyed instance is gone forever and cannot be repaired. However, you can build a new struct of the same type as a replacement — full build PoW required.
| Consequence | Detail |
|---|---|
| Destroyed struct | Instance gone forever; build a replacement (full PoW) |
| Lost defenders | Each destroyed defender must be individually rebuilt |
| Rebuild cost | Full PoW + power draw, same as original build |
YES. A destroyed Command Ship cannot be repaired, but you can build a brand new Command Ship (type 1) to replace it. The new Command Ship gets a new struct ID and requires full build PoW (~17 min at D=3). You choose the starting ambit at build time.
Until the replacement is online, the fleet cannot move, raid, or build in space. This downtime is the real cost of losing a Command Ship. Always assign defenders to protect it via struct-defense-set before engaging in offensive operations.
schemas/formulas.md — Verified formula definitionsreference/action-quick-reference.md — Combat action endpointsprotocols/action-protocol.md — Transaction flow