#106/#107 (#98a/#98b): the Planning Center

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>
This commit is contained in:
Loïc Wisniewski 2026-08-23 14:21:52 +02:00
commit 0c595d775d
12 changed files with 883 additions and 16 deletions

View file

@ -53,6 +53,8 @@ enum Icon {
# #102: appended, like everything above - inserting anywhere earlier
# renumbers every icon int already stored in every scene.
OUTPOST,
# #106: appended, same rule.
PLANNING_CENTER,
}
# Size the glyphs were originally drawn against. Every glyph dimension is
@ -296,6 +298,8 @@ func _draw() -> void:
_draw_distorder_vessel(center, pulse, s)
Icon.OUTPOST:
_draw_outpost_icon(center, pulse, s)
Icon.PLANNING_CENTER:
_draw_planning_icon(center, pulse, s)
func _draw_close(center: Vector2, pulse: float, s: float) -> void:
@ -664,6 +668,26 @@ func _draw_ship_lab_icon(center: Vector2, pulse: float, s: float) -> void:
_active_color(), pulse, 0.35 * s, core_color)
func _draw_planning_icon(center: Vector2, pulse: float, s: float) -> void:
# A tally board: a frame with three bars of different lengths inside it.
# Nothing else in the set is rectilinear and horizontal, and the meaning
# wanted is "how many of each", not "a place that builds things" - the
# crafter's cradle already owns that.
var w: float = 12.0 * s
var h: float = 11.0 * s
NeonDraw.draw_glowing_polygon(self, PackedVector2Array([
center + Vector2(-w, -h), center + Vector2(w, -h),
center + Vector2(w, h), center + Vector2(-w, h),
]), _active_color(), pulse, core_color)
var lengths: Array = [0.82, 0.5, 0.66]
for i in range(lengths.size()):
var y: float = center.y + (float(i) - 1.0) * 6.0 * s
var left: float = center.x - w + 3.0 * s
NeonDraw.draw_glowing_line(self, Vector2(left, y),
Vector2(left + (2.0 * w - 6.0 * s) * float(lengths[i]), y),
_active_color(), pulse, 0.4 * s, core_color)
func _draw_outpost_icon(center: Vector2, pulse: float, s: float) -> void:
# A watchtower with two vessels holding station off it. The hub's
# octagon already means "things are stationed here and go out from