Subscriptions
Engine-owned replication. An application declares what each archetype exposes, who sees what, and which commands clients may send; the engine does change detection, quantized encoding, motion segments, per-session visibility, sessions, backpressure, inbound hardening and the wire โ in parallel on the worker pool, to native and browser clients.
๐ฌ Recommended: read in-depth-overview/15-subscriptions.md (Chapter 15) for the mechanism, and Guide ch.7 for an end-to-end walkthrough, before the pages below.
Status: ๐ง Partial โ the features below are built; the list of what is not yet is at the end ยท Category: Subscriptions
๐ฏ What it solves
A game server's state has to reach thousands of clients, each seeing only the part of the world around it, at tick rate โ without the application writing change detection, encoding or networking, and without the cost growing as clients ร entities. Subscriptions run replication as an engine track after the tick fence, encode each change once, give each session only what lies around it, and never let a slow client hold up the tick.
Public Features
| Feature | Summary | Status | Level |
|---|---|---|---|
| Push replication | Replicate after a write; the engine pushes spawns, destroys, moves and migrations itself, compares quantized bytes and encodes each change once |
โ Implemented | ๐ต Core |
| Projections & codecs | What of an archetype travels: position as motion segments, fields in change groups, enter-only and owner-only fields, Fraction, Heading, Static |
โ Implemented | ๐ต Core |
| Replication by attributes | [Replicated], [Motion], [Replicate], [Owner]โฆ on the data, compiled by a source generator; the builder overrides them |
โ Implemented | ๐ต Core |
| Profiles & observers | World, Sphere (leave band, run-time radius, distance bands), ClientRegion with a near budget, an Aggregate tier, cadence |
โ Implemented | ๐ต Core |
| Sessions & admission | Declared kinds, an admission hook with roles and limits, session events, staged requests: profile, control, budget, kick | โ Implemented | ๐ต Core |
Owner state (SELF) |
Fields only the controlling session receives, plus the last applied command sequence | โ Implemented | ๐ต Core |
| Commands & acknowledgements | Typed intents, rate/role/pre-check on the transport thread, TryResolve scoped to what the session holds, every refusal answered |
โ Implemented | ๐ต Core |
| Events | One-off facts routed near a point, to the sessions that hold an entity, to an owner, to one session, or to all; best effort with a loss count, or reliable (.Reliable(): once, in order, or the session is closed) |
โ Implemented | ๐ฃ Advanced |
| Backpressure & budgets | Skip never queue, catch-up from an 8-tick log, rate classes, per-session byte budgets, the inbound budget and the abuse close | โ Implemented | ๐ฃ Advanced |
| Transports & hosting | The engine's TCP listener and the ASP.NET Core WebSocket adapter; the catalog endpoint | โ Implemented | ๐ต Core |
| Client SDKs | TypeScript (browser) and .NET (bots, tools) clients: stores, motion extrapolation, commands, reconnection, code generation | โ Implemented | ๐ต Core |
| Wire protocol & catalog | typhon.3: the handshake, the canonical catalog, frames and blocks, close codes |
โ Implemented | ๐ฃ Advanced |
| Groups | Entities sharing a key, held whole โ the towns a Sphere meets, the keys a client asked for, a shared board โ positioned or not, filled under the enter budget and completed with GROUP_COMPLETE |
๐ง Partial | ๐ฃ Advanced |
| Sessions in realms | A session in one realm at a time, each realm served at its own scale, a switch as one RESET + REALM frame; kinds and profile variants; realm-scoped events |
๐ง Partial | ๐ฃ Advanced |
| Diagnostics | STATS metrics (built-in and your own), the DEBUG capability, the push validator, runtime counters |
โ Implemented | ๐ฃ Advanced |
โ ๏ธ Not built yet
Refused at Start or at the call โ never silently ignored:
- several entity observers in one profile, and per-session observers (
SessionRequest.Observe); - shared tile and
Staticsnapshot blobs; the WebTransport link.
๐ Related
- Concepts: Subscription ยท Projection ยท Replication profile ยท Replication session ยท Client command ยท Replication event ยท Replication catalog
- Related feature: Overload Management โ replication degrades sessions before the tick does
- Related feature: Spatial โ a replicated archetype is spatially indexed; views are found through the grid
- Correctness rules:
rules/subscriptions.md(SUB-01 โฆ SUB-35)