Implement Save State Serialization to Binary Format

Open
#38 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
cli, databases

Research direction

Start by locating the persistence module and the existing save() and load() entry points, then inspect Cargo.toml and the CLI argument handling. Compare bincode and postcard before implementing the binary format, migration, versioning, export flag, and PersistenceError behavior. Done means the listed roundtrip, JSON migration, version mismatch, corruption, and export tests pass.

Written by the indexing model from the issue text.

Description

Description

Upgrade the persistence module from JSON serialization to a compact binary format using bincode or postcard. As the game state grows to include inventory, streaks, replay events, and versioned puzzle references, JSON becomes verbose and slow to parse. Binary serialization dramatically reduces file size and deserialization time, which matters especially for players with large session histories. The module should maintain a migration path so existing JSON saves can be converted on first load.

Acceptance Criteria

  • bincode or postcard is added as a dependency in Cargo.toml
  • save() writes game state in binary format to a configurable file path
  • load() deserializes binary saves and returns a validated GameState
  • On load, if a JSON save file is detected, it is automatically migrated to binary and the old file is archived
  • A SaveVersion field is embedded in every save to enable future migration handling
  • Corrupted binary files return a descriptive PersistenceError variant rather than a panic
  • A CLI flag --export-save dumps the current binary save as human-readable JSON for debugging
  • Unit tests cover binary save/load roundtrip, JSON migration, version mismatch, and corruption handling
Dominant language
Rust
Stars
0
Forks
23
Avg merge
1d 11m
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MindFlowInteractive/quest-rust

All issues in MindFlowInteractive/quest-rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.