Lors du spawn après avoir chargé une sauvegarde existante il faut que tu sponnes au niveau du Motherhip #227

Closed
opened 2026-09-11 19:23:19 +00:00 by metaheavens · 1 comment
Owner
No description provided.
Author
Owner

Done in 62acb00.

Worse than described, as it turned out. A loaded save fell through to the brand-new-game branch in PlanetAtmosphereController._ready(), which spawns STARTING_SHIP_COUNT interceptors at the world origin. So resuming stranded the player in empty space with the wrong ships, while their base sat wherever they had left it — thousands of units away on a charted map.

fleet_position was in the save all along, but nothing ever read it: only Fleet writes it, as a mirror for payment-range checks.

A resumed run now spawns at get_mothership_position(). That is already the canonical home — BuildController._check_fleet_wipe() rebuilds a wiped fleet there — so this reuses the existing answer to "where does the fleet belong" rather than inventing one. It falls back to the position the save was written at, and only then to the origin, because a run can have no mothership standing. The crew comes from the saved fleet_vessel_types. New games are untouched.

resumed_from_save is a one-shot handoff like has_return_position, and is deliberately not saved: it describes this launch, not the run.

Verified by reverting the branch: resumed at (0.0, -48.0), but the mothership is at (7400.0, -3100.0).

One note for whoever writes the next fleet test: asserting a three-ship crew proves nothing without capacity. Since #219 the fleet holds BASE_FLEET_SIZE (1) plus one berth per supplied fleet office, so spawn_ships clamps to 1 and the assertion passes against the wrong number. test_resume_spawn.gd gives the save two offices and checks max_fleet_size() first.

177/177.

Done in 62acb00. Worse than described, as it turned out. A loaded save fell through to the **brand-new-game** branch in `PlanetAtmosphereController._ready()`, which spawns `STARTING_SHIP_COUNT` interceptors at the world origin. So resuming stranded the player in empty space *with the wrong ships*, while their base sat wherever they had left it — thousands of units away on a charted map. `fleet_position` was in the save all along, but nothing ever read it: only `Fleet` writes it, as a mirror for payment-range checks. A resumed run now spawns at `get_mothership_position()`. That is already the canonical home — `BuildController._check_fleet_wipe()` rebuilds a wiped fleet there — so this reuses the existing answer to "where does the fleet belong" rather than inventing one. It falls back to the position the save was written at, and only then to the origin, because a run can have no mothership standing. The crew comes from the saved `fleet_vessel_types`. New games are untouched. `resumed_from_save` is a one-shot handoff like `has_return_position`, and is deliberately **not** saved: it describes this launch, not the run. Verified by reverting the branch: `resumed at (0.0, -48.0), but the mothership is at (7400.0, -3100.0)`. One note for whoever writes the next fleet test: asserting a three-ship crew proves nothing without capacity. Since #219 the fleet holds `BASE_FLEET_SIZE` (1) plus one berth per supplied fleet office, so `spawn_ships` clamps to 1 and the assertion passes against the wrong number. `test_resume_spawn.gd` gives the save two offices and checks `max_fleet_size()` first. 177/177.
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#227
No description provided.