Appearance
Data Visibility Model โ
This page is part of the Concepts trail. PlayerState separates who can read data, whether it persists, and how widely it replicates. Use what follows to pick the right bucket before you structure your DefaultData or config.
Mental model โ
| Kind | Scope | Saved | Replicated to clients |
|---|---|---|---|
| Normal player data (top-level fields and nested paths) | Per player | Yes | Yes โ only to that playerโs client |
session (and other RuntimeNonPersistentRoots) | Per player | No | Yes โ only to that playerโs client |
SharedSession | Current server | No | Yes โ every client in this server |
Server root (and other ServerOnlyRoots) | Per player | Yes | Never โ server APIs only |
- Normal data โ Default replicated profile fields. Existing games keep using top-level keys as today; you do not need a
Public/Privatesplit for compatibility. sessionโ Temporary per-player state that resets each join and never touches the DataStore. See Session Data.SharedSessionโ Temporary server-wide state for this running server only (round phase, votes, timers all clients should see). Not universe-wide or cross-server. See Shared Session.Serverโ Persistent per-player fields stripped out before the player Replica is built, so no client receives themโeven the owner. See Server-only data.
Choosing SharedSession vs Server โ
Common confusion
Server is per-player saved data, not โwhole server state.โSharedSession is current-server shared state visible to all clients, not saved.
- Use
SharedSessionwhen every client in this server needs the same read-only (on the client) UI or gameplay snapshot: match phase, round timer end timestamp, vote counts, etc. - Use
Serverunder a player profile when something must persist but must never replicate to any client: internal versioning, anti-tamper caches, moderation flags, etc.
Do not put secrets in normal replicated fields if the owning client must never see themโmove those roots under Server or add them to ServerOnlyRoots.
Implementation notes (accuracy) โ
Internally:
- Shared session uses a dedicated SharedSession Replica token and syncs to all clients in the current server.
- Player data Replicas are built from a filtered clone of profile data with
ServerOnlyRootsremoved. profile.Dataremains the server-side source of truth. Normal writes update bothprofile.Dataand the client-visible Replica. Server-only writes update onlyprofile.Data.
Migration โ
Existing projects do not need to reorganize into new top-level wrappers. Normal top-level data behaves as before.
To hide saved internal fields from clients, move them under a Server root (or another root you list in ServerOnlyRoots) instead of leaving them in replicated paths.
See also: Legacy Data Migration for importing old DataStores (separate topic).