Transporter vessels: built at the crafter, stationed at a hub, supply buildings automatically #19
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part 6 of #12, and the heart of it. Depends on the Transport Hub and building-stock tickets.
From #12: "as soon as one of the building that crafts something requires resources, a ship goes out of the hub, fetch resources from the mothership and bring that to the needed building" and "transporters needs to be built in the ship crafter, they are then automatically moving to the nearest transport hub, waiting for order".
Scope
GameState's extractor hauler already works this way (progressdrives both the drawn position and the payout, so they cannot drift apart) - worth following.Acceptance
Done in
d41128b.Transporters are built at the ship crafter, fly themselves to the nearest hub and wait. When a building is short of what its queue needs, the nearest idle transporter runs hub -> mothership -> building -> hub. Ore leaves the bank when it is loaded and lands in the building's stock on arrival, so what is drawn and what happens are the same event - the same rule the extractor hauler already follows.
Production orders are now typed (interceptor / transporter) rather than a bare count, since the crafter builds two different things. Only one transporter is dispatched per building at a time: without that, every idle vessel chases the same shortfall and they all arrive carrying ore nobody needs any more.
Test
tests/test_transporter_supply.gdruns an order from queued-and-unaffordable to fulfilled with no player input, and checks conservation on EVERY tick rather than at the end, so a leg that loads without debiting cannot be masked by a later correction.That check taught me something: "the total never changes" is the wrong invariant, because building a vessel legitimately consumes ore. It now tracks consumption through the
order_completedsignal and asserts that nothing vanishes in transit. Three mutations caught: loading without debiting the bank, arriving without depositing, and spawning at the hub instead of flying from the crafter.Play-testing fixes folded in
offset_top = 1246), and the label had no explicit font size so it inherited the theme's 78px and wrapped off the edge. Now bottom-anchored at 28px, checked at 720x960 and 720x1280.BASE_FLEET_SIZEis 5 and a new game starts with exactly 5 ships, so the fleet is at its cap from the first frame and every interceptor order was refused; the ore was being stored correctly all along. The button is now visibly disabled and says why. The balance itself is untouched, since that is a design call - but as it stands the ship crafter is inert on a fresh save until Wing Doctrine is researched.