> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentleague.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Fleet Management

> Module specs, weight penalties, and energy systems

### 1.6 Reference Sheets & Formulas

#### 1.6.1 Module Specifications

The 7x7 build grid allows placing various modules. Orientation determines the nozzle/facing of burners, weapons, cameras, and shields. Note that occupied tiles are relative to the anchor coordinate `(x, y)`:

* **Core** (`core`): vital 2x2 system. Base weight = 10, max energy = 100, energy regen = +10/tick. Occupies: `(x,y)`, `(x+1,y)`, `(x,y+1)`, `(x+1,y+1)`.
* **Burner** (`burner`): moves ship. Weight = 1. Active move cost = 2 energy flat/tick. Occupies a 1x3 strip. Relative facing determines movement direction (south = forward, north = backward, west = strafeRight, east = strafeLeft) and exhaust line (which shoots out the back, extending to the grid boundary). Exhaust path must remain completely clear of other modules.
* **Camera** (`camera`): sensor. Weight = 1. Range = 15 tiles depth. Occupies a 2x1 strip.
* **Radar** (`radar`): omnidirectional sensor. Weight = 4. Range = 5 tiles depth. Occupies 2x2.
* **Standard Gun** (`gun`): weapon. Weight = 2. Damage = 10, cooldown = 3 ticks, speed = 4 tiles/tick, range = 10 tiles, fire cost = 5 energy. Occupies T-shape (barrel points in `facing` direction, base extends behind it).
* **Railgun** (`railgun`): high-power weapon. Weight = 3. Damage = 30, cooldown = 8 ticks, speed = 7 tiles/tick, range = 10 tiles, fire cost = 5 energy. Occupies a 2x3 grid.
* **Burstgun** (`burstgun`): rapid-fire weapon. Weight = 3. Damage = 4, cooldown = 1 tick, speed = 5 tiles/tick, range = 10 tiles, fire cost = 5 energy. Occupies 2x3 grid with hole (shape of letter 'n').
* **Shield** (`shield`): defense. Weight = 2, max HP = 100. Absorbs 40% damage. Drains 2 energy/tick while active (HP > 0). If energy hits 0, all shields drop to 0 HP instantly. Occupies 2x2.
* **Armor** (`armor`): structure. Weight = 3. Bonus HP = +30 Hull HP. Occupies 2x1.
* **Minedropper** (`minedropper`): tactical. Weight = 3, cooldown = 15 ticks, cost = 5 energy. Occupies 2x2. Drops mine at ship's current tile.
* **EMP** (`emp`): electronic warfare. Weight = 2, cooldown = 20 ticks, range = 6 tiles, cost = 5 energy. Disables hit enemy ship for 10 ticks. Occupies 1x3.
* **Battery** (`battery`): storage. Weight = 1. Increases ship max energy capacity by +50. Occupies 1x1.
* **Basic Generator** (`generator`): power source. Weight = 2. Generates +5 energy/tick. Occupies a 2x1 grid.
* **Standard Drill** (`drill`): resource harvesting. Weight = 2. Mining rate = 1 ore/tick. Occupies a 2x1 grid. Extracts ores from adjacent nodes.
* **Improved Mining Drill** (`improved_drill`): resource harvesting. Weight = 3. Mining rate = 2 ore/tick. Occupies a 2x1 grid. Extracts ores at double rate.
* **Standard Cargo Hold** (`cargo_bay`): resource storage. Weight = 1. Cargo capacity = 10. Occupies 1x1. Stores mined ores on ship.
* **Improved Cargo Hold** (`improved_cargo_bay`): resource storage. Weight = 2. Cargo capacity = 25. Occupies 1x1. Large-scale ship storage.
* **Active Armor Plating** (`active_armor`): tactical defense. Weight = 2. Negates the first projectile shot from its facing side. Occupies a 2x1 grid.

#### 1.6.2 Speed & Weight Penalty Formula

Ship movement speed is derived from active burners and total weight:

* **Base Speed** ($baseSpeed$):
  * 1 active burner facing that direction = 1 cell/tick
  * 2 or 3 burners = 2 cells/tick
  * 4 or more burners = 3 cells/tick
* **Weight Penalty**:
  * Let $ship.weight$ be the sum of all module weights + base core weight (10).
  * Let $baseWeight$ be core base weight (10).
  * Let $divisor$ be the epoch's weight penalty divisor (default 10).
  * Let $factor$ be the epoch's weight penalty factor (default 0.5).
  * $weightPenalty = \max(0, \frac{ship.weight - baseWeight}{divisor})$.
* **Actual Speed**:
  * $speedMultiplier$ = 2 if Speed Boost consumable is active, else 1.
  * $speed = \frac{baseSpeed \times speedMultiplier}{1 + weightPenalty \times factor}$. If the final calculated actual speed is less than `0.55`, the ship is too heavily loaded or underpowered to move and the speed is set to `0`.
  * Fractional movement accumulates across ticks. A raycaster moves the ship 1 cell at a time.

#### 1.6.3 Energy System Rules

* **Max Energy Capacity**: 100 base + 50 per active Battery module.
* **Energy Regeneration**: +10 energy per tick. Regen is disabled if the ship is EMP-disabled.
* **Shield Energy Cost**: If any shield module has HP > 0, the ship consumes 2 energy/tick. If ship energy drops to 0, all shields are depleted to 0 HP.
* **Passive Energy Cost**: Most modules consume passive energy every tick (e.g., shields: 2, burners: 2, cameras: 1, guns: 1).
* **Action Energy Costs**:
  * Movement action: 2 energy flat/tick.
  * Gun firing action: 5 energy per gun fired.
  * Mine drop action: 5 energy per minedropper.
  * EMP blast action: 5 energy per EMP module.
* **Module States & Toggling**: Modules can be toggled on/off via the `enableModules` and `disableModules` action arrays (referencing the module index). Toggling a module takes exactly 1 tick to complete the transition.
* **Auto-Shutdown Protocol**: If a ship's energy reaches `0` and its energy balance is negative, the ship will automatically shut down active modules to save power in a specific priority order:
  1. Propulsions (`burner`, `burner_mk2`, `hyper_burner`)
  2. Defenses (`shield`, `advanced_shield`)
  3. Weapons (`gun`, `gun_mk2`, `railgun`, `burstgun`)
     The shutdown halts when the energy balance is no longer negative.

#### 1.6.4 Map Hazards & Fixtures

* **Nebula**: Blocks Line of Sight (LOS) and deals 2 damage/tick to any ship sitting inside. Also interrupts the Hull Repair item cycle.
* **Gravity Well**: Pulls ship 1 cell closer to the center `(width/2, height/2)` if the destination cell is free.
* **Blast Door**: Destructible obstacle. Default HP = 150. Projectiles deal damage to blast doors; they are removed from the map when HP reaches 0.
* **Mine**: Fixture dropped by minedropper. Triggers when any opposing ship enters a cell within Chebyshev distance of 1 tile (adjacent/diagonal). Deals 40 damage. The dropping ship is immune.
