Recipe 1 — Port the ECS racing sample onto FirstByte
Unity’s ECS-Network-Racing-Sample is a DOTS / Netcode for Entities project. The transport swap is the fastest way to check that an end-to-end match runs over the FirstByte relay mesh.1
Add the package
Open the sample in Unity. Add the transport via Package Manager → Add
package from git URL:
2
Swap the transport on the NetworkManager
Find the prefab that holds the
NetworkManager. Remove UnityTransport.
Add ClutchCallTransport. Then point Netcode at it:3
Configure relay + token
Drive the inspector fields from a small bootstrap. Then the host and the
clients agree on the room:
4
Assign host vs client roles
Keep the sample’s own “Go in game” flow. The host opens the room’s
authority namespace. Each client announces a discovery namespace and joins
the room:
5
Build players (not the editor)
Editor batch mode does not drive Netcode for Entities. Build a player
for each role. Start the players. The
[Server] / [Client] connection
lifecycle completes. Netcode assigns NetworkId. The cars sync.- Car transforms / physics ticks use the unreliable lane (QUIC datagrams). This traffic is high frequency and latest-wins, with no head-of-line blocking.
- Spawns, despawns, and race-start / finish RPCs use the reliable lane (MoQT subgroup streams). Delivery is ordered and guaranteed.
If a client does not appear in the host roster, check that both built players
share the same
RoomId and a valid token. The discovery namespace
announcement drives roster membership. If the rooms do not match, the host
never sees the announce.Recipe 2 — Headless dedicated server with matchmaking
This is a common production shape. A dedicated server player runs the authority for a room. Clients get a room-scoped token from your control-plane API before they connect. The server has no display and starts on launch.Server bootstrap
Client matchmaking + join
The client asks the control-plane API for a room and a token. It configures the transport. Then it connects:Why this shape works
No self-hosted relay
No self-hosted relay
Both the dedicated server and the clients connect outbound to the
nearest relay POP. There is no inbound port to open and no relay
infrastructure to run. The mesh fans state and input between regions.
One QUIC connection per process
One QUIC connection per process
The server holds a single QUIC connection for the authority. Each client
holds one connection for its session. Reliable and unreliable lanes
multiplex over it. There is no second socket and no separate reliability
layer to tune.
Tokens are room-scoped and short-lived
Tokens are room-scoped and short-lived
The control-plane API mints a token bound to a room and a short TTL. Thus a
leaked client token cannot join arbitrary matches. The server mints its own
authority token the same way.
Recipe 3 — Lane discipline for a fast-paced shooter
When you control the gameplay code, route traffic onto the correct lane explicitly. The rule: send latest-wins, high-frequency traffic on the unreliable lane. Send anything that you cannot drop on the reliable lane.Related
Details
This page covers the wire model, the lanes, and the architecture.
Games modality
This is the pure-MoQT face of the same wire model, for non-Unity engines.