Build the logistics crews, and let them burn energy

#216: transport hubs and spacial workshops no longer conjure their crews.
Transporters and repair drones are ordered at a ship crafter, assigned per
building through a new Station menu, flown out from the mothership hangar,
and spent by the work they do - 20 runs, 12 repairs, counted where the run
ENDS so nothing retires with cargo in the air or a building half repaired.
A spent vessel is gone, so the structure is short again and the player has
to build another. The menu shows what each one has left, worst first.

Craftability needed its own flag: "the crafter can make it" and "it can take
a berth in the fleet" stopped being the same question.

#217: transporters crawl at 120 rather than 150, and a Burn Drive lets them
carry energy and spend it to travel far faster. Fetching it is a leg of its
own, to the nearest store that has any - so a refuelling transporter cannot
be dispatched mid-errand - and the leg flown to COLLECT fuel is not charged
for it. Unresearched, nothing detours and nothing changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
This commit is contained in:
Loïc Wisniewski 2026-09-05 19:09:35 +02:00
commit 265e121cb0
31 changed files with 1180 additions and 141 deletions

View file

@ -1,5 +1,14 @@
extends SceneTree
# Logistics travels at a readable pace rather than teleporting: the ceiling
# below is the rule, and each leg has to actually advance at the speed its own
# stat claims.
#
# The expected progress is DERIVED from that stat rather than written out,
# because the numbers are tuned: #217 slowed transporters from 150 to 120 and
# a hardcoded window failed for a change it was not about. What must not drift
# is the ceiling, and the agreement between the stat and the movement.
func _initialize() -> void:
var state: Node = root.get_node("GameState")
@ -16,16 +25,20 @@ func _initialize() -> void:
"to": Vector2(900, 0), "progress": 0.0})
state._advance_vessel_deliveries(1.0)
var delivery_progress: float = state.vessel_deliveries[0].progress
if delivery_progress < 0.18 or delivery_progress > 0.22:
return _fail("900-unit delivery advanced %.3f in one second" % delivery_progress)
var delivery_expected: float = delivery_speed / 900.0
if absf(delivery_progress - delivery_expected) > 0.01:
return _fail("900-unit delivery advanced %.3f in one second at %.0f u/s, expected %.3f" \
% [delivery_progress, delivery_speed, delivery_expected])
state.transporters.append({"hub_id": 0, "state": state.TRANSPORTER_RETURNING,
"target_id": 0, "carrying": 0, "progress": 0.0,
"from": Vector2.ZERO, "to": Vector2(600, 0)})
state._advance_transporters(1.0)
var transport_progress: float = state.transporters[0].progress
if transport_progress < 0.23 or transport_progress > 0.27:
return _fail("600-unit transport leg advanced %.3f in one second" % transport_progress)
var transport_expected: float = transport_speed / 600.0
if absf(transport_progress - transport_expected) > 0.01:
return _fail("600-unit transport leg advanced %.3f in one second at %.0f u/s, expected %.3f" \
% [transport_progress, transport_speed, transport_expected])
print("delivery %.0f u/s, transporter %.0f u/s" % [delivery_speed, transport_speed])
print("TEST_LOGISTICS_TRAVEL_SPEED: PASS")