Skip to content

[Feature] Incremental State SyncΒ #229

@mirageisland-ai

Description

@mirageisland-ai

Hi everyone! I saw the experimental partysync module and was wondering if it could support an incremental state sync protocol.

I'm imagining something similar to https://github.com/colyseus/schema. It's a library that basically automatically syncs JS classes to client listeners. It's very optimized, serializing and emitting only compressed binary deltas of any changes of state.

For example you can have a class like the following server side, which would sync the player object to all clients whenever a property changes:

export class Player extends Schema {
  @type("string") name: string;
  @type("number") x: number;
  @type("number") y: number;
}

const player = new Player()

This makes the developer experience of making realtime multiplayer games really seamless, as all your state can be replicated on both the server and client with minimal overhead.

There are some great docs going into more detail here: https://docs.colyseus.io/state.

However, Colyseus schema doesn't have an integration with Durable Objects yet. So having sync functionality like this built into partykit/partysync with a tight integration to Durable Objects would be great to enable apps like realtime multiplayer video games!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions