Skip to content

Tick based snapshot replication with baseline delta compression #49

Description

@Segfaultd

Summary

Add a tick based snapshot replication layer: tick stamped world snapshots, ack driven baseline delta compression, and client side interpolation helpers.

Motivation

ReplicaManager3 replicates per object with per variable deltas, which fits lobby style and coarse grained state well. Fast paced action games instead want the server to publish an atomic snapshot of relevant state every tick, delta compressed against the last snapshot the client acknowledged, with the client interpolating between received ticks. That model is currently left entirely to the application.

Proposal

A new plugin layered on top of the existing connection and interest management machinery:

  • Server side tick buffer holding the last N encoded snapshots per connection scope
  • Baseline selection from acks: encode each outgoing snapshot as a delta against the newest snapshot the receiving client has confirmed, falling back to a keyframe when no baseline is available
  • Per client relevance reusing the VirtualWorld visibility scoping so each client's snapshot only contains entities visible to it
  • Client side ring buffer plus interpolation/extrapolation helpers (fixed interpolation delay, tick to render time mapping)
  • Serialization through BitStream with quantization helpers for common game types (positions, quaternions)

Non goals

  • Client prediction and reconciliation of player controlled entities (application concern, but the tick metadata must carry what an application needs to build it)

Acceptance criteria

  • Unit tests for delta encode/decode round trips and baseline fallback logic as pure logic tests
  • Integration test: server publishes snapshots at a fixed tick rate over lossy loopback and the client converges to a consistent, in order view
  • A sample under Samples/ demonstrating a moving entities scene

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions