Version: 1.0.0 Category: gameplay Type: decision-tree Description: Decision tree for scouting, assessing, preparing, and executing combat operations
flowchart TD
combatType{"Determine combat type"}
combatType -->|attack| scoutTarget["Step 1: Chart target planet\nto assess defenses"]
scoutTarget --> assessRisk["Step 2: Assess enemy strength\nand required forces"]
assessRisk --> riskCheck{"Risk <= acceptable?"}
riskCheck -->|Yes| prepare["Step 3: Ensure sufficient power,\nforces ready, player online"]
prepare --> executeAttack["Step 4: Execute attack on target"]
riskCheck -->|No| abortAttack["Abort: Risk too high"]
flowchart TD
raidStart["Raid"] --> fleetCheck{"Fleet is away?"}
fleetCheck -->|Yes| playerCheck{"Raider player online?"}
fleetCheck -->|No| errFleet["Error: Fleet must be away\nto raid - move fleet first"]
playerCheck -->|Yes| shieldCheck{"Defender shields vulnerable?\n(fleet off-station, or CMD\noffline/destroyed)"}
playerCheck -->|No| errPlayer["Error: Player must\nbe online to raid"]
shieldCheck -->|Yes| executeRaid["Execute raid\n(requires proof-of-work)"]
shieldCheck -->|No| createVuln{"Ore worth a siege?\n(target holds ore, CMD ship\nreachable, home exposure OK)"}
createVuln -->|Yes| siege["Siege: strip same-ambit blockers,\ndestroy defender CMD ship to open\nthe window, then execute raid"]
createVuln -->|No| errShield["Abort/watch: shields up\n(no active raid window) -\ncompute would be wasted work"]
siege --> executeRaid
Vulnerability is a state you can create: if the defender is shielded (Command Ship online, fleet on station), you either wait for them to slip (opportunistic) or destroy their Command Ship to force the window open (siege). “Shields up” is a decision point, not a dead end.
flowchart TD
defendStart["Defend"] --> autoFire["Step 1: Defensive structures\nfire automatically"]
autoFire --> monitor["Step 2: Monitor\nbattle resolution"]
monitor --> outcome{"Battle outcome\n= victory?"}
outcome -->|Yes| secure["Secure position,\nrebuild if needed"]
outcome -->|No| recover["Rebuild forces,\nstrengthen defenses"]
flowchart TD
shot["Each projectile"] --> evasion{"Evasion check"}
evasion -->|Evaded| defCounter["Defender counter-attack\n(once per struct-attack,\nbefore block, even on evaded)"]
evasion -->|Not evaded| defCounter2["Defender counter-attack\n(once per struct-attack,\nbefore block)"]
defCounter --> nextShot["Next projectile\n(no block on evaded)"]
defCounter2 --> block{"Block check"}
block -->|Blocked| nextShot2["Next projectile"]
block -->|Not blocked| damage["Apply damage"]
damage --> nextShot3["Next projectile"]
nextShot --> allDone{"All shots done?"}
nextShot2 --> allDone
nextShot3 --> allDone
allDone -->|No| shot
allDone -->|Yes| targetCounter["Target counter-attack\n(once per struct-attack,\nafter all shots)"]
| Condition | True Path | False Path | Notes |
|---|---|---|---|
| combatType == attack | Scout, assess, prepare, execute | Check other combat types | First branch of combat type evaluation |
| risk <= acceptable | Prepare forces and execute | Abort attack | Assessed after scouting target |
| fleetAway == true | Check raider player status | Error: move fleet first | Required for raid initiation |
| playerOnline == true | Check defender shields | Error: player must be online | Raider’s player must be online |
| defenderShieldsVulnerable == true | Execute raid with PoW | Siege decision (create vulnerability) or abort | Vulnerable = defender’s fleet off-station, or CMD offline/destroyed. If not vulnerable, evaluate destroying the CMD ship to force the window rather than treating it as a hard stop. |
| battleOutcome == victory | Secure position | Rebuild and recover | Evaluated after defense resolution |
The attack sequence follows a linear chain of scout, assess, prepare, and execute:
If risk is deemed too high during assessment, the attack is aborted to preserve resources.
Raids have strict prerequisites that must all be satisfied in sequence:
shields_active (and planet-raid-compute refuses with “no active raid window” while blockStartRaid == 0). If the defender is shielded, you can create vulnerability: with your fleet present at the target, strip same-ambit blockers and destroy the defender’s Command Ship to open the window (the siege path). Note an idle/dormant owner is not automatically vulnerable — a powered Command Ship keeps defending.Failure at any step produces a specific error and halts the raid attempt (or, for a shielded defender, points you at the siege path rather than a dead end).
Defense operates differently from offensive actions:
Combat Resolution Order (per struct-attack invocation):
| Combat Type | Requirements |
|---|---|
| Attack | structOnline, ownerOnline, sufficientCharge, targetBuilt (validTarget) |
| Raid | playerOnline, fleetAway, defenderShieldsVulnerable, proofOfWork |
| Defend | defensiveStructuresActive |