Planet System

Planet size, population, food mechanics, housing efficiency, stability, and the energy system.

Planet Object

Planet {
  id
  owner_id
  name
  coordinates (x, y)
  galaxy_id / sector_id / system_id

  size                // Small | Medium | Large
  population
  housing_capacity    // cached from last tick; authoritative value computed from buildings
  stability           // 0–100

  specialization_type // None | Metal | Crystal | Gas | Rare | Food | Industrial | Agricultural

  resources {
    metal
    crystal
    gas
    rare
    food              // stored stockpile; production comes from Hydroponic Farm buildings
  }

  last_tick_at        // timestamp of last economic tick (null if never ticked)
}

Resource production is not stored on the planet. It is computed each tick from the buildings currently constructed on the planet. See Buildings.


Planet Size

Planet size determines the number of construction slots and base housing capacity.

SizeConstruction SlotsBase Housing Capacity
Small3500
Medium51 000
Large72 000

Total housing capacity = base housing + housing contributed by Housing Block buildings.


Population System

Population is a single scalar representing the total number of citizens.

Colonization

  • New planet starts at population = 0
  • Requires a colony fleet to colonize
  • Player chooses how much population to transfer
  • Origin planet immediately loses that population
  • Transport requires cargo capacity in the fleet

Food Mechanics

Constants

ConstantValue
food_per_pop1.0 (food units consumed per citizen per tick)
starvation_multiplier0.5 (population lost per unit of food deficit)
base_growth_rate0.02 (2% population growth per tick when food surplus)

Each economic tick

food_production  = sum of all Hydroponic Farm outputs (see Buildings)
food_consumption = population × 1.0
net_food         = food_production − food_consumption

Growth (net_food > 0)

population += population × base_growth_rate   // +2% per tick

Stable (net_food = 0)

Population does not change.

Starvation (net_food < 0)

population_loss = |net_food| × 0.5
population     -= population_loss
stability      -= 2.0   // per tick (clamped to 0)

Production Formula

All resource production comes from buildings. Each building's output per tick is:

building_output =
  base_output[level] ×
  efficiency_modifier ×
  stability_modifier ×
  specialization_modifier ×
  energy_ratio

Outputs are summed across all completed buildings on the planet and applied to the planet's resource stockpiles each tick.


Housing Efficiency (Efficiency Modifier)

housing_ratio     = population / housing_capacity
efficiency_modifier = f(housing_ratio)

The modifier is computed by linear interpolation across five zones:

Housing RatioZoneEfficiency
0No population0.10 (floor)
0 → 0.50Underpopulated0.10 → 0.50 (linear)
0.50 → 0.75Growing0.50 → 1.00 (linear)
0.75 → 0.90Optimal1.00
0.90 → 1.00Crowding1.00 → 0.80 (linear)
≥ 1.00Overcrowded0.80 (cap)

The efficiency floor of 0.10 ensures buildings always produce something even with zero population.


Stability

Range: 0 – 100. Stability is both an input and output of each economic tick.

Modifiers

stability_modifier = clamp(stability / 100, 0.0, 1.0)

This multiplier is applied to all building outputs (with the food-production floor described above).

Delta per tick

ConditionStability Change
No negative events+1.0 / tick (recovery)
Starvation (net_food < 0)−2.0 / tick
Overcrowding (housing_ratio > 1.0)−1.0 / tick
Starvation + Overcrowding−3.0 / tick

Recovery only applies when no negative condition is active. Stability is clamped to 0, 100 after each delta.


Specialization Modifiers

Each planet has a specialization type that boosts its primary resource output:

Planet TypeResource BoostedMultiplier
MetalMetal1.5×
CrystalCrystal1.5×
GasGas1.5×
RareRare1.5×
FoodFood1.5×
AgriculturalFood2.0×
IndustrialAll non-food resources1.25×
None1.0×

Energy System

Buildings that produce resources consume energy. Energy is generated by Solar Arrays and Nuclear Reactors.

energy_ratio = clamp(energy_produced / energy_demand, 0.5, 1.0)

This ratio multiplies all resource-producing building outputs. Even with zero power plants, buildings operate at 50% efficiency (the floor ensures planets are never completely unproductive).

When energy_demand = 0 (no extraction buildings), energy_ratio = 1.0.

See Buildings for per-building energy values.


Economic Ticks

The economy advances in discrete ticks. The tick interval is configured server-side (default: 5 minutes).

Lazy tick system

Planets are not ticked on a global schedule. Instead, each planet records last_tick_at. When a player views a planet, the server computes how many ticks have elapsed since the last tick and applies them all at once (catch-up).

ticks_overdue = floor((now − last_tick_at) / tick_interval)

This means planets that are not visited still advance correctly — they just apply all overdue ticks in a burst when next accessed.

Global events (fleet movement, trade routes, espionage) are advanced on the same lazy schedule using a shared last_global_tick_at timestamp.


Resources

ResourcePrimary Use
MetalShip frames, building construction
CrystalElectronic modules, sensors
GasFuel, engine modules, some refineries
RareAdvanced modules, high-tier buildings
FoodPopulation sustenance (consumed each tick)