NSSTC / sim-ecs

Batteries included TypeScript ECS
https://nsstc.github.io/sim-ecs/
Mozilla Public License 2.0
81 stars 12 forks source link

Add snapshots #57

Open minecrawler opened 1 year ago

minecrawler commented 1 year ago

Description

Snapshots work like a time-machine. They record every change since a certain point and allow to do or undo them (rewind to the snapshot's creation time). Since they store deltas, they are more space-efficient than saving.

Use-Case

Snapshots should be save-able (world.save()) and can be used for simple game saves (e.g. load world from Prefab and apply snapshot)

Hints

Depends on #9

The implementation should be time-efficient as well, e.g. they should not care about the exact history. If a component was changed several times, the snapshot should only record the initial and most recent value.