casey / casey/pxl

Add save/load system

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
32
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Allow programs to save and load their state. Saves will be managed by the user outside of the program.

Saves may have an optional parent, which indicates that the save is in some way derived from the parent save, for example the parent save may be a prior game state, or a previous document state.

I'm not sure what the UI should be, but program designers shouldn't have to worry about managing saves, they should only worry about loading game state when presented with a save, and creating a save from the current game state when asked to.

This isn't set in stone, but my thinking is to use [msgpack](https://msgpack.org) as the save format, and games can use serde to save and load to msgpack values, which will then be serialized to disk by the runtime.

Games should be saved in a location appropriate to the system, for exmaple `~/Library/Application Support/pxl/saves/NAME/TIME-PARENT.msgpack` on on macOS.

Also, we should use the crate name the key for a game's saves, so that we are guaranteed to avoid collisions as long as the game is published to crates.io.

Contributor guide

Open the contributing guide

Research direction

No source files, tests, or entry points are identified in the issue. Start by locating the runtime and existing platform-specific storage abstractions, then resolve the save UI and API design around serde/msgpack, optional parents, crate-name keys, and system-appropriate paths; done means games can create and load saves reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.