resource transport system #12

Closed
opened 2026-08-11 12:50:55 +00:00 by metaheavens · 2 comments
Owner

resources needs to be brought to the mothership to be in the list of available resources. when the fleet gets resources, they are only local to the fleet, once touching le mothership it is transferred. find a nice way to show what's on the fleet vs in the global resources. this also means that anything produced needs resources to be transported. the ship creation in the ship craft can only happen if resources are available. if no resources are available, the ship crafting is queued. add a new "Transport Hub" building that will host transport ships. 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. there's a limit in the number of a available transporters, more hub needs to be created, or a research in the mothership let each hub have more resources. transporters needs to be built in the ship crafter, they are then automatically moving to the nearest transport hub, waiting for order. 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

resources needs to be brought to the mothership to be in the list of available resources. when the fleet gets resources, they are only local to the fleet, once touching le mothership it is transferred. find a nice way to show what's on the fleet vs in the global resources. this also means that anything produced needs resources to be transported. the ship creation in the ship craft can only happen if resources are available. if no resources are available, the ship crafting is queued. add a new "Transport Hub" building that will host transport ships. 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. there's a limit in the number of a available transporters, more hub needs to be created, or a research in the mothership let each hub have more resources. transporters needs to be built in the ship crafter, they are then automatically moving to the nearest transport hub, waiting for order. 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
Author
Owner

Split into seven tickets so each piece can land verified instead of arriving as one enormous change. Keeping this open as the umbrella.

Dependency order:

  1. #14 - Fleet carries mined resources until it delivers them to the mothership
  2. #15 - Show what the fleet is carrying separately from banked resources
  3. #16 - Buildings hold their own resource stock, and orders queue until supplied
  4. #17 - Fleet can pick up resources from the mothership and supply a building by hand
  5. #18 - Transport Hub building
  6. #19 - Transporter vessels: built at the crafter, stationed at a hub, supply buildings automatically
  7. #20 - Transporter capacity per hub, and research to raise it

Two notes on the ordering.

#17 (manual fleet supply) comes before the transporters, not after. Once #16 lets an order queue waiting for resources, something has to be able to fulfil it. If transporters are the only route, there is a window where a player with a queued order and no Transport Hub is stuck. #12 already calls this out - "this will prevent issue with resources transportation if no transporter is yet available" - so it is a prerequisite for the queue being safe, not a convenience added afterwards.

The split follows the seams already in the code, which is why it comes apart this cleanly: ore enters the game at exactly one place (Rock.gd:83, GameState.rocks += 1), sits in exactly one pool (GameState.rocks), and leaves through exactly one API (can_afford / spend). #14 changes the entry point, #16 changes the exit, and nothing in between has to move at once.

Starting on #14.

Split into seven tickets so each piece can land verified instead of arriving as one enormous change. Keeping this open as the umbrella. Dependency order: 1. #14 - Fleet carries mined resources until it delivers them to the mothership 2. #15 - Show what the fleet is carrying separately from banked resources 3. #16 - Buildings hold their own resource stock, and orders queue until supplied 4. #17 - Fleet can pick up resources from the mothership and supply a building by hand 5. #18 - Transport Hub building 6. #19 - Transporter vessels: built at the crafter, stationed at a hub, supply buildings automatically 7. #20 - Transporter capacity per hub, and research to raise it Two notes on the ordering. **#17 (manual fleet supply) comes before the transporters, not after.** Once #16 lets an order queue waiting for resources, something has to be able to fulfil it. If transporters are the only route, there is a window where a player with a queued order and no Transport Hub is stuck. #12 already calls this out - "this will prevent issue with resources transportation if no transporter is yet available" - so it is a prerequisite for the queue being safe, not a convenience added afterwards. **The split follows the seams already in the code**, which is why it comes apart this cleanly: ore enters the game at exactly one place (`Rock.gd:83`, `GameState.rocks += 1`), sits in exactly one pool (`GameState.rocks`), and leaves through exactly one API (`can_afford` / `spend`). #14 changes the entry point, #16 changes the exit, and nothing in between has to move at once. Starting on #14.
Author
Owner

All seven parts are done and closed.

#14 Fleet carries mined ore until it delivers it to the mothership
#15 Carried ore shown separately from banked ore
#16 Buildings hold their own stock; orders queue until supplied
#17 Supply a building by hand: withdraw at the mothership, store on arrival
#18 Transport Hub building
#19 Transporter vessels running hub -> mothership -> building automatically
#20 Transporter capacity per hub, and research to raise it

The loop now runs end to end: mine ore, fly it home to bank it, order a vessel at a crafter that cannot pay for it, and either carry the ore over yourself or let a transporter do it while you are elsewhere.

Three things worth recording from the build:

#17 landing before the transporters mattered. Once #16 lets an order queue waiting for ore, something has to be able to fulfil it. Had the transporters been the only route, there was a window where a queued order and no Transport Hub meant a stuck save.

Conservation was the assertion that earned its keep. Ore in flight is the easy thing to lose - a leg that loads without debiting, or delivers without crediting, shows up nowhere else. Checking it every tick, and separately accounting for what production legitimately consumes, caught more than any end-state check would have.

Two bugs came out of play-testing rather than the suite, and both were the same shape: something that looked like it worked and silently did nothing. A craft button refused by a fleet cap it never mentioned, and a menu label positioned off the bottom of shorter screens. Neither is visible to a headless test - the suite has no GPU and no viewport - which is why the renders are part of the workflow rather than a nicety.

Suite went from 38 tests to 47, all passing.

All seven parts are done and closed. | | | |---|---| | #14 | Fleet carries mined ore until it delivers it to the mothership | | #15 | Carried ore shown separately from banked ore | | #16 | Buildings hold their own stock; orders queue until supplied | | #17 | Supply a building by hand: withdraw at the mothership, store on arrival | | #18 | Transport Hub building | | #19 | Transporter vessels running hub -> mothership -> building automatically | | #20 | Transporter capacity per hub, and research to raise it | The loop now runs end to end: mine ore, fly it home to bank it, order a vessel at a crafter that cannot pay for it, and either carry the ore over yourself or let a transporter do it while you are elsewhere. Three things worth recording from the build: **#17 landing before the transporters mattered.** Once #16 lets an order queue waiting for ore, something has to be able to fulfil it. Had the transporters been the only route, there was a window where a queued order and no Transport Hub meant a stuck save. **Conservation was the assertion that earned its keep.** Ore in flight is the easy thing to lose - a leg that loads without debiting, or delivers without crediting, shows up nowhere else. Checking it every tick, and separately accounting for what production legitimately consumes, caught more than any end-state check would have. **Two bugs came out of play-testing rather than the suite**, and both were the same shape: something that looked like it worked and silently did nothing. A craft button refused by a fleet cap it never mentioned, and a menu label positioned off the bottom of shorter screens. Neither is visible to a headless test - the suite has no GPU and no viewport - which is why the renders are part of the workflow rather than a nicety. Suite went from 38 tests to **47**, all passing.
metaheavens referenced this issue from a commit 2026-08-11 18:31:47 +00:00
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#12
No description provided.