Fleet can pick up resources from the mothership and supply a building by hand #17

Closed
opened 2026-08-11 13:36:42 +00:00 by metaheavens · 1 comment
Owner

Part 4 of #12. Depends on the building-stock ticket.

From #12: "there should be a way for our fleet to pick resources from the mothership. if the fleet has resources on it and opens a building that needs thoses resources, they are picked by the building. this will prevent issue with resources transportation if no transporter is yet available".

This is what keeps the game unblockable, so it should land BEFORE transporters exist rather than after - otherwise there is a window where a queued order can never be fulfilled.

Scope

  • Withdraw banked resources into fleet cargo at the mothership.
  • Opening a building that needs resources transfers what the fleet is carrying into that building's stock.

Acceptance

  • A queued order can be completed start to finish using only the fleet, with no Transport Hub built.
  • Withdrawing never creates or destroys resources (bank + cargo + building stock is conserved).
Part 4 of #12. Depends on the building-stock ticket. From #12: "there should be a way for our fleet to pick resources from the mothership. if the fleet has resources on it and opens a building that needs thoses resources, they are picked by the building. this will prevent issue with resources transportation if no transporter is yet available". This is what keeps the game unblockable, so it should land BEFORE transporters exist rather than after - otherwise there is a window where a queued order can never be fulfilled. **Scope** - Withdraw banked resources into fleet cargo at the mothership. - Opening a building that needs resources transfers what the fleet is carrying into that building's stock. **Acceptance** - A queued order can be completed start to finish using only the fleet, with no Transport Hub built. - Withdrawing never creates or destroys resources (bank + cargo + building stock is conserved).
Author
Owner

Done in ff162fa.

A "Load ore" button at the mothership moves a batch from the bank into the fleet's hold, and opening a building hands it whatever the fleet is carrying. That completes the loop #16 opened: a queued order can now always be fulfilled by flying the ore over yourself, with no Transport Hub in existence.

Delivery at the mothership is now EDGE triggered on arrival, rather than running every frame the fleet is parked there. This fell out of building the withdraw: with continuous delivery, ore loaded into the hold at the mothership was banked again on the very next frame, so the button would have looked completely broken. Arrival is the event that means something, not presence.

A batch rather than the whole bank, because the hold is the part that can be lost, and emptying the bank in one tap would also strand research - which still spends from the bank.

Test

tests/test_manual_supply_route.gd runs the whole route end to end and checks ore is conserved across it (bank + hold + every building stock). Three mutations caught: reverting delivery to continuous, letting the withdraw overdraw the bank, and unloading into a building without emptying the hold (which duplicates ore).

An intermittent failure worth recording

This test passed alone and failed once in a full suite run. The cause was not parallelism: AsteroidField.set_process(false) only stops NEW chunks spawning, and rocks already in the world keep drifting - one destroyed a parked ship, changing the fleet size the test asserts on. Both new logistics tests now clear existing asteroids and enemies. Three consecutive full runs clean afterwards.

Worth flagging because it is a trap for any future test that parks the fleet somewhere and waits: disabling the spawner is not the same as clearing the field.

Full suite: 44/44, three runs in a row.

Done in ff162fa. A "Load ore" button at the mothership moves a batch from the bank into the fleet's hold, and opening a building hands it whatever the fleet is carrying. That completes the loop #16 opened: a queued order can now always be fulfilled by flying the ore over yourself, with no Transport Hub in existence. **Delivery at the mothership is now EDGE triggered on arrival**, rather than running every frame the fleet is parked there. This fell out of building the withdraw: with continuous delivery, ore loaded into the hold at the mothership was banked again on the very next frame, so the button would have looked completely broken. Arrival is the event that means something, not presence. A batch rather than the whole bank, because the hold is the part that can be lost, and emptying the bank in one tap would also strand research - which still spends from the bank. ## Test `tests/test_manual_supply_route.gd` runs the whole route end to end and checks ore is conserved across it (bank + hold + every building stock). Three mutations caught: reverting delivery to continuous, letting the withdraw overdraw the bank, and unloading into a building without emptying the hold (which duplicates ore). ## An intermittent failure worth recording This test passed alone and failed once in a full suite run. The cause was not parallelism: `AsteroidField.set_process(false)` only stops NEW chunks spawning, and rocks already in the world keep drifting - one destroyed a parked ship, changing the fleet size the test asserts on. Both new logistics tests now clear existing asteroids and enemies. Three consecutive full runs clean afterwards. Worth flagging because it is a trap for any future test that parks the fleet somewhere and waits: disabling the spawner is not the same as clearing the field. Full suite: **44/44**, three runs in a row.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
metaheavens/spaceship#17
No description provided.