Energy - Rogue-Frontier/Rogue-Frontier GitHub Wiki

A ship is powered by its reactors. Main reactors provide most of the power output and require refueling. Battery reactors provide extra power output and automatically refuel by consuming power from the main reactors. Without fuel, a ship cannot run devices, fire weapons, raise shields, etc.

Usage

When calculating power usage, we iterate through powered devices in the order in which they are installed.

  • Disabled devices consume no power
  • Main reactors provide output first in the order they are installed.
  • If consumption exceeds Main output, then Batteries provide output.
  • If the consumption of one device exceeds the total remaining output, then the system is overloaded and the device is disabled.
  • If the consumption is lower than Main output, any remaining Main output is consumed by Battery reactors in the order they are installed.

Solar

A Solar device generates power based on the intensity of the background light from a star.

Reactor

A Reactor stores a finite amount of energy. It has max output, capacity, and efficiency stats. Regular reactors are replenished by adding fuel - these are known as Burners.

Battery

A Battery is a Reactor variant that can be replenished using extra output from other power sources. A battery may or may not take fuel. When drawing output, the battery incurs a small delay before it can be replenished.

Consumption

Each active device consumes energy. When updating energy usage, we draw output from energy sources in this order.

  1. Solar devices
  2. Burner reactors
  3. Battery reactors

If at any point, a device's powerUse exceeds the remaining available output, that device gets deactivated.

If there is any unused output from Solar devices or Burner reactors AND there are Battery reactors not at full capacity, unused output automatically goes towards replenishing Battery reactors.

⚠️ **GitHub.com Fallback** ⚠️