spaceship/ui
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Claude fb3587173d #225: save the run, and offer to resume it
JSON at user://savegame.json rather than a binary resource: a save that can
be opened in a text editor is diagnosable from a bug report, and
ResourceSaver would tie the file's shape to GDScript class layout, which is
the thing that keeps changing.

The run is not plain data, which is the actual work here. A tagged codec
carries Vector2, Vector2i, PackedStringArray and the Inventory objects
nested inside `buildings`. explored_chunks is keyed by Vector2i and JSON has
no such key, so every key carries its own type prefix ("v2i:3,-4") - without
that a planet id could come back as a chunk coordinate.

WHAT is saved is an explicit list of 30 fields, not a dump of GameState's
58 vars. A dump would carry transient junk - which pointer last touched the
screen, whether a dialog holds the camera - and would break silently on
every rename. The cost is that new progression must be added to the list;
the benefit is that forgetting is a missing feature, not a corrupt save.

Versioning, as the ticket asked. MIGRATIONS walks a save up one version at a
time; MIN_SUPPORTED_VERSION is how a break too messy to migrate gets
DECLARED rather than bodged. A save that cannot be walked forward is refused
with a player-readable reason, because a save that loads subtly WRONG is
worse than one that refuses and says so. Adding a field needs no bump: it
arrives missing from old saves and keeps its new-game value (case F).

The menu offers Continue only when there is something to offer. A save this
build CANNOT open is still shown, disabled, with the reason underneath -
silently hiding someone's run reads as lost rather than incompatible.

Autosave every 30s, plus on close and on Android's app-pause, since the
phone kills backgrounded apps with no warning. Skipped during the prologue.

That autosave writes to the same user:// path every test that loads
Main.tscn shares, so it could make Continue appear and shift the menu stack
under test_main_menu depending on what ran first. That test clears the save
before building the menu.

Verified by breaking it: neutering the key decoder fails with "chunk keys
came back as [v2i:-11,0, v2i:3,-4]".

Still absent, deliberately: no save-on-demand button, and no route back to
the menu from in-game, so a resume currently needs a relaunch.

175/175.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
2026-09-09 21:32:23 +02:00
..
menus Stop redrawing what only needs moving 2026-09-08 11:35:45 +02:00
AbilityButtonLayout.gd Arrange fleet abilities around fire stick 2026-09-03 23:00:52 +02:00
AbilityButtonLayout.gd.uid Buy fleet berths with Fleet Offices 2026-09-05 17:09:27 +02:00
BreachOverlay.gd #125: slow the prologue down, and give the breach a real black hole 2026-08-24 13:25:10 +02:00
BreachOverlay.gd.uid Add the .uid files for the newest tests 2026-08-24 20:50:51 +02:00
DevMenuButton.gd Add a free-costs sandbox tool 2026-09-04 22:34:36 +02:00
DevMenuButton.gd.uid Turn dev mode into sandbox menu 2026-09-03 20:05:33 +02:00
FormationEditor.gd #118/#121: the speed fader and the formation editor under a mouse 2026-08-23 21:59:24 +02:00
FormationEditor.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
GarrisonPanel.gd #102/#103 (#97d/#97e): the outpost, and the garrison you compose for it 2026-08-23 14:02:20 +02:00
GarrisonPanel.gd.uid Add the .uid files Godot generated for the new scripts 2026-08-23 19:23:50 +02:00
IconButton.gd Let a dialog opened over another dialog be closed 2026-09-08 22:31:56 +02:00
IconButton.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
LoadingScreen.gd Resolve pending gameplay tickets 2026-09-02 13:43:56 +02:00
LoadingScreen.gd.uid #166-#173: plainer words, a point to shoot at, and a catalog that says when it is broken 2026-08-30 14:04:46 +02:00
MainMenu.gd #225: save the run, and offer to resume it 2026-09-09 21:32:23 +02:00
MainMenu.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
MainMenu.tscn #225: save the run, and offer to resume it 2026-09-09 21:32:23 +02:00
NarrationBanner.gd Polish dialog and intro transitions 2026-09-02 20:18:44 +02:00
NarrationBanner.gd.uid Add the .uid files Godot generated for the newest scripts 2026-08-24 12:10:41 +02:00
NeonNumber.gd #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
NeonNumber.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
NeonPanel.gd Draw the neon components in the editor, not just at runtime 2026-09-08 14:13:51 +02:00
NeonPanel.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
PaletteEntryButton.gd Take planets by killing what defends them 2026-09-05 13:31:25 +02:00
PaletteEntryButton.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
PlanningPanel.gd #106/#107 (#98a/#98b): the Planning Center 2026-08-23 14:21:52 +02:00
PlanningPanel.gd.uid Add the .uid files Godot generated for the new scripts 2026-08-23 19:23:50 +02:00
PriceTag.gd Resolve pending gameplay tickets 2026-09-02 13:43:56 +02:00
PriceTag.gd.uid #136, #137, #134: one build grid that cannot stack, one way to show a price 2026-08-28 15:05:20 +02:00
QuestPanel.gd #166-#173: plainer words, a point to shoot at, and a catalog that says when it is broken 2026-08-30 14:04:46 +02:00
QuestPanel.gd.uid #140: the objective moves behind a button next to the map's 2026-08-28 15:37:13 +02:00
ResourceBar.gd Implement #160, #161, #162, #163, #164 and #165 2026-08-30 02:27:44 +02:00
ResourceBar.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
ResourceReadout.gd #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
ResourceReadout.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
ResourceTransferList.gd #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
ResourceTransferList.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
ScannerGuidance.gd Stop redrawing what only needs moving 2026-09-08 11:35:45 +02:00
ScannerGuidance.gd.uid Buy fleet berths with Fleet Offices 2026-09-05 17:09:27 +02:00
ScannerGuidance.tscn Sharpen upgrades, mark the convoy's destination, and give the world sound 2026-09-05 12:16:17 +02:00
SkillTreeView.gd Implement #160, #161, #162, #163, #164 and #165 2026-08-30 02:27:44 +02:00
SkillTreeView.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
SpeedFader.gd #118/#121: the speed fader and the formation editor under a mouse 2026-08-23 21:59:24 +02:00
SpeedFader.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
TouchJoystick.gd Draw the neon components in the editor, not just at runtime 2026-09-08 14:13:51 +02:00
TouchJoystick.gd.uid #84: move 215 root files into a folder hierarchy 2026-08-21 19:44:14 +02:00
WaveAlert.gd #100 (#97b): waves replace the roaming enemy spawner 2026-08-23 13:37:42 +02:00
WaveAlert.gd.uid Add the .uid files Godot generated for the new scripts 2026-08-23 19:23:50 +02:00