# Raid

WAR ยท ACTION ON A PLANET (2-) BY A FLEET (9-)

**A raid sends your fleet to another player's planet to take their stored ore. It is the only way ore changes hands by force, and the only thing a raid can take.** This page reads at five depths; stop at the one you need. ## Story Ore is the one thing in the galaxy that can still be taken. Refined Alpha belongs to whoever refined it, bound to them by the shared record; no fleet can pry it loose. But ore, freshly torn from a world and not yet refined, belongs to whoever holds it. So the raiders come in the hours between the mine and the refinery. A world defends itself through its Command Ship. While that ship is home and powered, a raider can work at the shields for as long as it likes and never break through. Let the ship fall, or send the fleet away, or let the power fail, and the shields become a clock, and the clock runs down. ## Rules > **Rule R.raid.loot:** A raid takes only the defender's stored (unrefined) ore. Its settlement never takes refined Alpha, the vault, the account, or generator fuel. Fighting during a raid can still destroy structs, and a generator that is destroyed for any reason (combat, trashing, or its planet's depletion) loses its fuel. > **Rule R.raid.gate:** A raid can complete only while the defender is vulnerable: no fleet, the fleet off station, or no Command Ship, a destroyed one, or an offline one. While the fleet is on station with an online Command Ship, raid completion is rejected however much work the raider does. The shield number sets the raid's proof-of-work difficulty (a timer), not whether it can complete. - **While a raider heads your raid queue, you cannot mine or refine.** The ore clocks pause and shift forward when the raid ends; computes that were running must be relaunched. - **Raiding drops your own shields.** Your fleet off station means your own Command Ship no longer protects your home planet. - **Destroying the raider's Command Ship ends the raid** (`attackerDefeated`); it is parked at your planet for the whole raid. - **Contests score raids.** In Sector Blitz, successful raids between players in different guilds earn coverage and claims ([contests](https://structs.ai/knowledge/mechanics/contests)). **Observed, not a chain rule:** across recorded raids the median time from `initiated` to `shieldsVulnerable` was about 2 minutes, and every defender who won returned fire within about 2 minutes. Plan on roughly four minutes to respond ([defense](https://structs.ai/knowledge/mechanics/defense#the-four-minute-clock)). > **Rule R.refine.parallel:** Launch the refine compute together with the mine compute. A refinery ages while it holds no ore; ore is checked when the refine completes, and a refine that lands with no stored ore is rejected. ## Moves | Move | Command | Tier | |---|---|---| | Move your fleet to the target | `structsd tx structs fleet-move --from [key] --gas auto --gas-adjustment 1.5 -- [fleet-id] [destination-planet-id]` | 1 (unscouted destination) | | Do the raid's proof-of-work and complete it | `structsd tx structs planet-raid-compute -D 3 --from [key] --gas auto --gas-adjustment 1.5 -y -- [fleet-id]` (background, after an Approval Block) | 1 | | Submit a proof you computed elsewhere | `structsd tx structs planet-raid-complete --from [key] --gas auto --gas-adjustment 1.5 -- [fleet-id] [proof] [nonce]` | 1 | | Defend: assign a defender to your Command Ship | `structsd tx structs struct-defense-set --from [key] --gas auto --gas-adjustment 1.5 -- [defender-struct-id] [command-ship-id]` | routine (needs `PermPlay` on the owner) | Before raiding, scout: `scripts/scout.sh [planet-id]` gives a go/no-go from the target's Command Ship and fleet status. A `GO` is a hypothesis; re-scout right before committing work. Under attack yourself: [under attack](https://structs.ai/playbooks/situations/under-attack). Full procedures: [structs-combat](https://structs.ai/skills/structs-combat/SKILL). ## Data - Is a raid live on a planet? `structsd query structs planet [planet-id]`: a non-empty `locationListStart` means a fleet heads its raid queue. - Raid events arrive as `raid_status` on structs.planet.{planet_id}.{owner_player_id}, with `detail.status` one of: initiated, ongoing, shieldsVulnerable, attackerDefeated, attackerRetreated, raidSuccessful, demilitarized. The raid clock starts with `block_raid_start`; shield changes arrive as `shield_change` ([event schemas](https://structs.ai/api/streaming/event-schemas)). - Watch your own planet: `node scripts/watch-defense.mjs 'structs.planet.[planet-id].*'`. - Raid history and stats live in the guild webapp's analytics ([api/webapp](https://structs.ai/api/webapp/analytics)). ## Machine A raid's settlement is one transaction, `MsgPlanetRaidComplete`. The chain checks the raider's proof against the planet's shield-derived difficulty and the defender's vulnerability at that block, then moves the defender's entire `storedOre` to the raider and sends the fleet home. There is no partial loot and no refund path: the amount is whatever stored ore holds at that block. The planet's shield value is the proof's difficulty range, so a higher shield means a longer raid, not an impossible one. The vulnerability check is `IsDefenderCommandStructVulnerable`; when it fails, completion is rejected with `shields_active`. Source: `x/structs/keeper/msg_server_planet_raid_complete.go`, `planet_cache.go`.