net

garnet-net

Multiplayer networking, snapshot replication, typed RPCs, and client-side prediction/rollback for Garnet.

Features

  • Transport abstraction (Net::Transport):
    • LoopbackTransport + LoopbackBus for deterministic in-process multi-peer simulation with configurable latency, jitter, packet loss, and reordering (NetworkConditions).
    • ReliableTransport framing layer adding sequence numbers, ACKs, retransmission, deduplication, and ordered reliable delivery over any unreliable transport.
    • UdpTransport non-blocking UDP peer/server socket transport.
    • WebSocketTransport adapter surface for Web/relay hosts.
  • Schema-driven snapshot replication & delta compression (ReplicationRegistry, WorldSnapshot, SnapshotDelta):
    • @[Net::Replicated] annotation + component codecs, NetId ownership & Authority, spatial interest filtering (SpatialInterest / InterestObserver), and per-peer acknowledged baseline delta compression.
  • Typed RPCs (RpcRegistry): reliable RPC registration, dispatch, and optional authority gating.
  • Client-side prediction & rollback (ClientPredictor): fixed-step input history buffer, server reconciliation, deterministic replay, and Garnet::Diagnostics counters (:net_reconciliations, :net_rollbacks, :net_replayed_ticks).

Run the headless multiplayer demo with crystal run examples/multiplayer_arena.cr.

Repository

net

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 3
  • about 1 hour ago
  • December 3, 2026
License

Links
Synced at

Thu, 03 Dec 2026 20:10:11 GMT

Languages