Access Control

In Netcode, observation is access control as well as bandwidth saving. The Any Server never sends a Client data the Client may not hold.

Pieces #

PiecePurpose
AspectA named share of a NetRecord’s fields, declared in the Schema. Clients are granted or denied aspects.
RoleA label that connections can be bound to, per record.
ProviderComputes what a connection may hold. Providers include Tagged, Occlusion, distance and group.
ConditionA test against facts you set from game code.
RuleTies roles, providers and conditions to aspects.
Observation levelHow much of a record a Client holds.

These live in an Access Profile, a .netaccess file edited on the Access page of the Netcode tool, which tells you at every change whether it still fits the Schema (“The profile fits the Schema.”).

The Netcode Access page for the Arena profile, showing the status line The profile fits the Schema, with its roles, poses and a Team provider.
The Access page.

From script #

NetcodeAccessRequestBus provides LoadAccessProfile, Bind and Unbind, EnableProvider, SetFact, TestCondition, GrantAspects and RevokeAspects, and metrics for the session, connections and types.

A worked example #

The Arena sample uses an Occlusion provider and a Tagged provider with the aspects Observed and Radar, so a Client is never sent a player a wall hides. See Samples. Box colliders used by an Occlusion provider need real dimensions, because non uniform entity scale is ignored by the physics shape at run time.

Two Arena client windows. The blue player stands behind a block from the red player's view, so the red client never receives the blue Pawn.
What each Client holds depends on what it may see.

Rate This Article!