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 | Agricultural | OceanWorld
                     // Industrial | Forge | Research | HiveWorld | Naval
                     // Frozen | Toxic | Barren | DeathWorld

  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 shapes its economy through production multipliers and traits. Specializations are assigned procedurally at galaxy generation based on a planet's orbit index and the star type of its system.

Full Specialization Reference

TypeHabitableProduction ModifiersTraits
NoneAll ×1.0 (balanced)
MetalMetal ×1.8, Food ×0.6
CrystalCrystal ×1.8Pop Growth ×0.8
GasGas ×1.8Housing Cap ×0.7
RareRare ×2.0Stability floor 20
AgriculturalFood ×2.0, Metal ×0.5
OceanWorldFood ×1.5, Gas ×1.3, Metal ×0.3
IndustrialMetal/Crystal/Gas/Rare ×1.25, Food ×0.0
ForgeAll ×1.0Stability floor 15, +1 build slot
ResearchFood ×0.7Pop Growth ×0.9
HiveWorldAll ×1.0Housing Cap ×2.0, Pop Growth ×1.3, Stability floor 10
NavalMetal ×0.6Fleet bonuses (planned)
FrozenCrystal ×1.4, Rare ×1.2Pop Growth ×0.6
ToxicGas ×1.6, Rare ×1.3Pop Growth ×0.5, Housing Cap ×0.6
BarrenAll ×0.7Cannot be a homeworld
DeathWorldMetal ×1.6, Rare ×1.5Pop Growth ×0.4, Stability floor 30

Trait Descriptions

  • Habitable — Only habitable planets can be claimed as a homeworld via the Homeworld assignment system.
  • Pop Growth modifier — Multiplies the base population growth rate (2%/tick) after food calculations. Values < 1.0 slow growth; > 1.0 accelerate it.
  • Housing Cap modifier — Multiplies the total housing capacity of the planet. Affects the housing_ratio that drives the efficiency modifier.
  • Stability floor — Stability cannot fall below this value regardless of negative events. Higher floors protect harsh planets from total economic collapse.
  • Build slots bonus — Adds extra construction slots beyond what planet size provides.

Specialization by Location

Orbit position, star type, and sector sun proximity together determine which specializations can appear.

Orbit zones (base)

Orbit ZoneTypical Specializations
Inner orbits (1–2)Barren, DeathWorld, Metal
Near-inner (3–4)Metal, Rare, Toxic, Industrial
Habitable zoneNone, Agricultural, OceanWorld, HiveWorld, Research, Naval, Forge
Outer mid (10–12)Crystal, Frozen, Gas
Deep outer (13+)Frozen, Gas, Rare

Star type — habitable zone orbits

Star TypeHabitable Zone
Yellow DwarfOrbits 5–8
Red GiantOrbits 7–11
Blue GiantOrbits 3–6
Neutron StarNone

Sector suns and temperature shift

Each sector has 1 or 2 suns (30% chance of a binary pair). All systems within a sector are positioned at varying distances from these suns. The closer a system is to the nearest sector sun, the warmer its planets tend to be; the further away, the colder.

A temperature shift is computed per system and applied as an offset to the habitable zone boundaries:

Distance to nearest sector sunTemperature shiftEffect
< 80 units−2Warmer — habitable zone shifts 2 orbits inward
80–179 units0Nominal — no shift
180–279 units+2Cooler — habitable zone shifts 2 orbits outward
≥ 280 units+4Frigid — habitable zone collapses entirely

A shift of +4 means no habitable-zone specializations can appear in that system regardless of star type — every planet that would otherwise be habitable is instead drawn from cold or toxic pools.

Binary sectors (two suns) tend to produce more uniformly warm planets because systems are rarely far from both stars simultaneously. Single-sun sectors are more extreme: systems huddled near the sun are very warm while those on the fringe may be completely frozen.


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)