Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 3.77 KB

networking.md

File metadata and controls

61 lines (41 loc) · 3.77 KB

Networking

ShatterKit Pro focuses on replicated runtime destruction without sending full mesh data for every hit.

Replication Model

The intended multiplayer flow is:

  1. The gameplay event happens on the server.
  2. The server records a compact destruction event.
  3. Clients receive the hit event data.
  4. Each client applies the same runtime operation locally.

This keeps bandwidth low because the network payload is the hit/tool event, not a full replacement mesh.

What Replicates

Typical replicated event data includes:

  • Event id.
  • Impact location and direction.
  • Impact speed.
  • Tool transform.
  • Tool mesh id or tool settings.
  • Boolean operation.
  • Seed or deterministic operation data when needed.
  • A shared simulation start frame for client-local detached pieces.
  • Source instance/collision identity for converted ISM/HISM targets.
  • Stable island identity and the tool transform relative to that island for hits on detached persistent pieces.
  • Material or group filters when used.

Why This Matters

Runtime mesh results can be expensive to transmit. Replicating compact events lets the game keep destruction synchronized while avoiding large per-hit mesh payloads.

Detached cosmetic pieces do not add per-frame transform replication. Each client simulates them locally from the shared event input. The v0.3.2 fix adds only per-event timing and source identity; it does not introduce a debris movement RPC or tick stream.

Instanced Targets

In v0.3.2 the server can authorize exact-instance conversion for supported ISM/HISM and ShatterKit instanced dynamic mesh sources. The event identifies the source instance, clients hide the same instance, and the converted Dynamic Mesh baseline is reconstructed before the Boolean event is applied.

Version 0.3.3 registers that reconstructed runtime target with the client target subsystem and manager. Later replicated destruction events can therefore resolve and modify the same target instead of stopping after the first accepted hit.

Scaled source instances are rebuilt from the same baked scale on every peer. Detached local pieces ignore the converted source and surviving parent during their cosmetic trace simulation, avoiding different collision-cook timing from changing their trajectories.

Detached Island Lifecycle

Version 0.3.4 routes persistent detached-island hits through the replicated root target while retaining the island id and target-local tool transform. A root-owned lifecycle registry tracks spawned islands as Pending, Live, or Retired, so nested islands remain addressable even after an intermediate parent is destroyed. An ordered event for a deterministically retired island is consumed as a no-op instead of blocking every later event.

This does not add tick synchronization, per-frame fragment transforms, or a movement RPC. Cosmetic motion remains client-local; only accepted destruction events and the compact attachment data are replicated.

Practical Guidance

  • Keep tool meshes stable and whitelisted when using replicated tools.
  • Add custom ToolStaticMesh assets to cooked content and to the target/network tool mesh whitelist.
  • Prefer deterministic destruction settings for multiplayer.
  • Avoid client-only target state changes that are not driven by the replicated event stream.
  • Treat small debris as client-local visual feedback where possible.
  • Test join-in-progress behavior for gameplay modes that require persistent destruction history.
  • Keep gameplay-critical rigid-body state server-authoritative; deterministic cosmetic debris is not a replacement for authoritative Chaos replication.
  • Profile event bandwidth at the project's real destruction rate and player count. The compact event model avoids per-tick debris traffic, but total server outgoing traffic still scales with accepted events and connections.