Fleet System

Fleet model, movement, missions, and the ship production queue.

Fleet Object

Fleet {
  id
  owner_id
  status              // Docked | Moving
  location_planet_id  // Current planet (when Docked or departing)
  ships[] {
    blueprint_id
    count
  }
}

Ships within a fleet are grouped by blueprint. A fleet containing 5 Frigates with blueprint A and 3 Destroyers with blueprint B has two ship stacks.


Fleet Status

StatusMeaning
DockedFleet is at a planet and can be ordered
MovingFleet is in transit to a destination

Movement

Dispatching a fleet creates a mission:

travel_time = distance(origin, destination) / fleet_speed
fleet_speed = min(speed of all ships in fleet)

Fleet speed is determined by the slowest ship, so adding slow ships to a fast fleet reduces the whole fleet's speed.

Each economic tick advances in-transit fleets. When arrival_time is reached, the fleet status changes to Docked at the destination planet.


Mission Types

MissionEffect
AttackTriggers combat on arrival if enemy fleet/planet present
TransportCarries resources to destination
ColonizeEstablishes colony on empty planet
PatrolRemains at location on guard

Production Queue

Ships are built on planets through production orders.

Queue an Order

  • Select a blueprint and quantity
  • Resources are deducted upfront (frame cost + all module costs × quantity)
  • Order enters Active state immediately

Tick Advancement

Each economic tick:

ticks_remaining -= 1
if ticks_remaining == 0:
    completed_count += 1
    add ship to docked fleet at planet
    if completed_count >= quantity:
        status = Completed
    else:
        ticks_remaining = ticks_per_ship

Cancel an Order

Cancelling an Active order refunds resources for unfinished ships. Already-built ships are not refunded.


Docked Fleet Assignment

When a ship completes production:

  1. Look for an existing Docked fleet owned by the planet's owner at that planet
  2. If found: add to the matching blueprint stack (or create a new stack)
  3. If not found: create a new Docked fleet at that planet