Skip to content

Support all savegame files#8

Merged
redtoad merged 56 commits intomasterfrom
support-all-files
Feb 1, 2026
Merged

Support all savegame files#8
redtoad merged 56 commits intomasterfrom
support-all-files

Conversation

@redtoad
Copy link
Owner

@redtoad redtoad commented Jan 30, 2026

No description provided.

redtoad and others added 26 commits September 23, 2024 18:34
Replace the broken NullString.Unpack method (which consumed the entire
remaining buffer, breaking multi-field structs) with a String() method
that strips at the first null byte on access. Use NullString type for
Name fields in SaveinfoFile, SoldierData, and BaseData.

Also fix two pre-existing round-trip issues: rename the unnamed field
in SaveinfoFile so its value is preserved, and widen BaseData.Active
from int8 to int32 to cover the full 292-byte record.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix build errors in cmd/editor by aligning Savegame field names.

Rename FinancialData to Financials and unexported baseFile to exported
BasesData so cmd/editor/main.go can access them. Also fix nonexistent
Facility.Tile() call to use Facility.String().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update CLAUDE.md: only create new branches from main/master.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Fix stuct→struct typo in transfer_dat.go struct tags
- Fix craft slice truncation: keep all 50 entries for round-trip
- Add Cargo field to CraftData for full 104-byte round-trip
- Uncomment saveBases, saveTransfers, saveCrafts in Save()
- Add loadFinancials/saveFinancials to load/save chain
- Add Reload() method for discarding unsaved changes
- Add accessor methods: Crafts(), Transfer wrapper, Soldier stats,
  Base Index/Active/Engineers/Scientists/Inventory
- Add round-trip tests for CRAFT.DAT, TRANSFER.DAT, BASE.DAT

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- CLI takes savegame root folder, scans GAME_1 through GAME_10
- Full JSON API: games, soldiers, bases, craft, transfers, financials
- Write endpoints for soldiers, bases, financials
- Action endpoints: heal-all, complete-constructions, speedup-deliveries
- Explicit save/reload per game slot
- SPA fallback handler with go:embed for frontend dist
- Auto-opens browser on startup, graceful shutdown via SIGINT
- Update .gitignore for frontend node_modules and fix dist/ pattern

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Svelte 4 + Vite 5 + TypeScript SPA with dark theme. Includes sidebar
with game list, tabbed detail view (soldiers, bases, craft, transfers,
financials), edit forms for soldiers/bases/financials, and action
buttons (heal all, complete constructions, speed up deliveries).
Updates .goreleaser.yaml with savegame-editor build target and npm
build hooks. Includes pre-built dist for go:embed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Map NoArmor to "None" on read (instead of "NoArmor") to match the
frontend select options, and accept both "None" and "NoArmor" on
write for backwards compatibility. Use package-level maps for
consistent armor string conversion.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Decode update request bodies into typed structs with pointer fields
instead of map[string]interface{}, preventing panics on malformed
JSON input. Unexport Soldier.Data() to data() and add explicit
getter/setter methods for all fields the editor needs, avoiding
leaking internal geoscape types through the public savegame API.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
filepath.Base uses OS-specific separators (backslash on Windows),
which breaks SPA fallback routing for URL paths containing forward
slashes. Use path.Base from the standard path package which always
uses forward slashes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Wrap all API handlers with appropriate locking: RLock for read
endpoints, Lock for write/action/save/reload endpoints. Store
savegames in a gameEntry struct alongside their mutex to prevent
data races from overlapping requests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Default to 127.0.0.1 instead of 0.0.0.0 since the editor modifies
local savegame files and should not be exposed on all network
interfaces. Add -host flag to override when remote access is needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change Origin, Destination, HoursLeft, Type, and Quantity from
signed int8 to unsigned uint8 encoding. With int8, the sentinel
value 255 (used for purchased items with no origin base) was
deserialized as -1, causing incorrect display. The uint8 encoding
preserves the original unsigned byte values.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Initialize list handler result slices with make() instead of var
declaration so Go's json.Encode produces [] instead of null when
there are no elements. Svelte's {#each} blocks call .length on the
response array, which panics on null.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Show which base each craft is stationed at in the craft list, and
rename the tab from "Craft" to "Crafts".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Expose location data from LOC.DAT through a new Locations() method on
Savegame and a GET /api/games/{slot}/locations endpoint that returns
type, name, and GPS coordinates for all active map objects.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Render X-COM bases, crafts, UFOs, crash sites, and terror sites on a
semi-transparent globe using globe.gl. Points are color-coded by type
with hover labels showing name and type. Includes a legend below the
globe.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
three.js 0.182 (via three-globe and three-render-objects) imports from
three/webgpu which accesses GPUShaderStage at module load time. Add a
polyfill in index.html that defines the constant before any ES modules
execute so the import succeeds on browsers without WebGPU support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The unpkg URL for earth-night.jpg returns 404 and is blocked by CORS.
Copy the texture from three-globe into public/ so it is served as a
local static asset with no cross-origin issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Display dashed, animated arc lines from each in-flight craft to its
destination on the globe view. Stationary craft continue to show as
points only. This makes it easy to see which craft are moving and
where they are headed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use NextUFOWaypointLon/Lat as fallback destination for alien craft
when no LOC.DAT destination is set. Include mission type (e.g. Alien
Research, Alien Terror) in the UFO label on the globe.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@redtoad redtoad marked this pull request as ready for review February 1, 2026 10:08
@redtoad redtoad merged commit 153a700 into master Feb 1, 2026
1 check passed
@redtoad redtoad deleted the support-all-files branch February 1, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant