Landed together: a board of standing orders nothing acts on is a notepad, and a planner with nowhere to read the plan from has nothing to do. The targets are GLOBAL, not per building. There is one plan for the whole game, and a second planning centre is another place to read and edit it rather than a competing one - per-building targets would let two centres hold contradictory orders and tell the crafters to satisfy both. The census is the harder half. Every vessel is counted exactly once wherever it happens to be: flying in the fleet, parked in the hangar, stationed at an outpost, or in the air between any two of those. Miss the in-flight ones and the planner queues a replacement for a vessel that is merely en route. The fleet is the one place GameState cannot see, so Fleet pushes its composition on every change, alongside the cargo capacity and distorder count that already went that way. Three rules keep the planner from fighting the player. It tops up and never rewrites, so an order placed by hand stays exactly where it is. Everything counts, including what is already queued, or it re-queues the same shortfall every tick and buries the player in hulls. And nothing happens without a planning centre - though the plan is remembered when one is destroyed, so rebuilding picks up where it left off. Vessels on order are counted separately from the census on purpose: they do not exist yet, so the readout can say "4 of 6, 2 building" rather than claiming six. The per-row note says where the vessels actually are, because a plan can look unmet while everything it asked for is sitting at an outpost. The build menu goes to three columns past eight entries. #54 already tightened its rows to 223px to fit a fourth, explicitly to avoid a scrollable menu, and a ninth structure needs a fifth row that will not fit at any spacing a button, a label and a cost can share. Three columns take nine into three rows - fewer than it uses today, not more. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
24 lines
1.2 KiB
GDScript
24 lines
1.2 KiB
GDScript
class_name BuildingDefinitions
|
|
extends RefCounted
|
|
|
|
const ORDER: PackedStringArray = ["mothership", "ship_crafter", "command_center", "outpost", "planning_center", "extractor", "transport_hub", "ship_lab", "gas_burner"]
|
|
const DEFINITIONS: Dictionary = {
|
|
"mothership": preload("res://buildings/MothershipBuildingDefinition.tres"),
|
|
"ship_crafter": preload("res://buildings/CrafterBuildingDefinition.tres"),
|
|
"command_center": preload("res://buildings/CommandBuildingDefinition.tres"),
|
|
"outpost": preload("res://buildings/OutpostBuildingDefinition.tres"),
|
|
"planning_center": preload("res://buildings/PlanningBuildingDefinition.tres"),
|
|
"extractor": preload("res://buildings/ExtractorBuildingDefinition.tres"),
|
|
"transport_hub": preload("res://buildings/TransportHubBuildingDefinition.tres"),
|
|
"ship_lab": preload("res://buildings/ShipLabBuildingDefinition.tres"),
|
|
"gas_burner": preload("res://buildings/GasBurnerBuildingDefinition.tres"),
|
|
}
|
|
|
|
static func get_definition(definition_id: String) -> Resource:
|
|
return DEFINITIONS.get(definition_id)
|
|
|
|
static func all() -> Array:
|
|
var result: Array = []
|
|
for definition_id in ORDER:
|
|
result.append(DEFINITIONS[definition_id])
|
|
return result
|