Skip to main content

Module save

Module save 

Source
Expand description

§Save / Load System

Provides serialization, world snapshots, file-level save formats, save slot management, and checkpoint-based respawn for the Proof Engine game loop.

§Modules

ModulePurpose
serializerSerializedValue enum (JSON-like), Serialize/Deserialize traits, built-in impls
snapshotWorldSnapshot, EntitySnapshot, SnapshotDiff
formatSaveFile, SaveHeader, SaveManager, slot management
checkpointCheckpoint, CheckpointManager, RespawnSystem

§Quick save example

use proof_engine::save::{
    snapshot::WorldSnapshot,
    format::{SaveFile, SaveManager},
};

let mut snapshot = WorldSnapshot::new();
let mut save_manager = SaveManager::new("saves/");
save_manager.save_to_slot(0, snapshot, Default::default()).unwrap();
let file = save_manager.load_slot(0).unwrap();

Re-exports§

pub use serializer::DeserializeError;
pub use serializer::Deserialize as SaveDeserialize;
pub use serializer::Serialize as SaveSerialize;
pub use serializer::SerializedValue;
pub use snapshot::EntitySnapshot;
pub use snapshot::ResourceSnapshot;
pub use snapshot::SnapshotDiff;
pub use snapshot::WorldSnapshot;
pub use format::SaveError;
pub use format::SaveFile;
pub use format::SaveHeader;
pub use format::SaveManager;
pub use format::SaveSlot;
pub use checkpoint::Checkpoint;
pub use checkpoint::CheckpointManager;
pub use checkpoint::RespawnSystem;

Modules§

checkpoint
Checkpoint system — spatial save points and respawn management.
cloud
Cloud save synchronisation: upload/download queuing, conflict resolution, offline buffering, encryption, and rotating local backups.
compression
Compression algorithms for save data: RLE, LZ4-style, Huffman, and delta encoding.
format
Save file format, slot management, and the SaveManager.
migrations
Schema migration system for save data.
profile
User profiles, play statistics, local leaderboards, unlockables, and the prestige system.
serializer
Custom serialization layer for the save system.
snapshot
World snapshots — serializable representations of the entire game state.