resource transport system #12
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?
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
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:
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.
All seven parts are done and closed.
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.