Post

After much ado, undo and redo are working with collaborative editing.

0 reposts2 likes

It's tricky to get undo/redo to work with multiplayer. I started with a command-based history/syncing system, ran into some problems, then decided to move to diff-based system.

The problems I ran into with command-based history/syncing: 1. It's slower: each client has to execute each command, this is bad if the command involves a lengthy calculation.

2. It's less deterministic: if the clients are out of sync in some way then a command might have different effects on different clients.

3. Tricky architecture implications: each command needs to be 100% reversable, so when the command changes the state, each change needs to be tracked.