Nebula

API reference

Every public type in the Nebula runtime, generated from the source.

generated from the sources

This section is generated from the XML documentation comments in Packages/com.1by3.nebula by website/tools/ApiGen (run npm run gen:api in website/). It covers the runtime assembly, the Editor tooling and the SpacetimeDB control-plane module. Hand-written explanations of how the pieces fit together live in the guides.

Core

Gameplay API: identities, behaviours, variables, RPCs, prediction, the sync components and project configuration.

TypeSummary
AuthorityModeEnum. Who is the source of truth for a synced component (NGO's AuthorityModes).
AuthorityRpcAttributeClass. Runs on whichever worker has authority over the entity, no matter which worker calls it.
ClientRpcAttributeClass. Runs on every client that knows the entity (or only its owner when sent with OwnerRpc).
CommandLineStatic class. Tiny "-key value" / "-flag" parser over Environment.GetCommandLineArgs.
INetworkInputInterface. Marker for the per-tick input struct a predicted entity consumes.
IRpcSinkInterface. Where RPCs and state changes go once a behaviour has produced them.
NebulaConfigClass. Project-wide Nebula settings.
NebulaGameModeAbstract class. Server-side game hooks, the equivalent of subclassing Mirror's NetworkManager.
NebulaLogStatic class. Thin logging wrapper so every Nebula line is greppable by prefix in headless logs.
NebulaRuntimeStatic class. Process-wide role context.
NetworkAnimatorClass. Replicates an Animator the way NGO's NetworkAnimator does.
NetworkBehaviourAbstract class. Base class for meshed gameplay code.
NetworkIdentityClass. Marks a GameObject as a meshed entity.
NetworkPrefabsStatic class. Prefab id table shared by every process.
NetworkRigidbodyClass. Puts a Unity Rigidbody under the mesh's authority model.
NetworkSyncBehaviourAbstract class. Base for components that replicate through the per-tick sync channel and support NGO's server/owner authority choice: NetworkTransform and NetworkAnimator.
NetworkTimeStatic class. Tick model.
NetworkTransformClass. Replicates a Transform the way NGO's NetworkTransform does: per-axis position/rotation/scale selection, change thresholds, local or world space, server or owner authority, buffered tick interpolation or smooth damping on the receiving si...
NetworkVariable<T>Class. Replicated field, NGO-style: declare it on a NetworkBehaviour and Nebula discovers it.
NetworkVariableBaseAbstract class.
PredictedBehaviour<TInput>Abstract class. A server-authoritative, client-predicted behaviour (the player controller, typically).
PredictedBehaviourBaseAbstract class. Non-generic surface Nebula's worker and client drive; game code derives from PredictedBehaviour<TInput>.
RemoteInterpolatorClass. Tick-indexed transform buffer for copies of an entity this process does not simulate: ghosts on a worker and remote entities on a client.
ServerRpcAttributeClass. Sent by the owning client, runs on whichever worker currently has authority over the entity.
SyncStateCodecStatic class. Envelope shared by the per-tick sync stream (EntityState/GhostSyncState messages) and the spawn snapshot: [count]{[behaviourIndex][flags][len:ushort][chunk]}.

Containers

The designer-authored authority volumes and their registry.

TypeSummary
ContainerClass. A designer-authored unit of authority: a box volume with its own local coordinate space.
ContainerRegistryStatic class. The container graph of the loaded level: every Container, indexed deterministically so all processes agree on indices, plus adjacency.

World partition

Cell grid, additive streaming and the floating origin (usable without Nebula), plus the baked container manifest and per-role cell streaming.

TypeSummary
IWorldAnchorInterface. Something the streamer keeps cells loaded around.
NebulaWorldStatic class. Nebula's side of a partitioned world (WorldDefinition + WorldContainerManifest): instantiates the manifest's container tree for the registry, owns the WorldStreamer, keeps the virtual containers and every entity's cached positions in ste...
NebulaWorldStreamingClass. Decides, per role, which cells this process keeps loaded and where the floating origin sits: worker: the cells of every container it leases plus NebulaConfig.WorkerLoadRingCells rings around them (seam physics and ghosts need the neighbo...
WorldAnchorClass. Anchor component: keeps the cells around this transform loaded.
WorldCellClass. Marks the root of a cell scene with its grid coordinate.
WorldContainerManifestClass. The baked container tree of a partitioned world: one container per cell plus every hand-authored Container found inside the cell scenes, with cell-local poses.
WorldDefinitionClass. A world partitioned into a 3D grid of cells, each authored as its own additive scene.
WorldGridStatic class. Grid arithmetic shared by the streamer, the editor tooling and Nebula's container integration.
WorldOriginStatic class. The floating origin: which cell currently sits at Unity's (0,0,0).
WorldStreamerClass. Loads and unloads cell scenes additively and keeps them placed relative to the floating origin.

Worker

The simulation process: spawning, ghosting, handover, the per-tick loop.

TypeSummary
NebulaWorkerClass. The sim worker: a headless Unity process leased authority over a set of containers.

Client

The game client: gateway connection, prediction driver, title screen.

TypeSummary
NebulaClientClass. The game client.
NebulaTitleScreenClass. The human client's front door: a small IMGUI panel to type the gateway address and a display name before connecting, and a way back when the connection drops.

Gateway

The one address clients connect to; routes inputs and re-emits replication.

TypeSummary
NebulaGatewayClass. The one address clients connect to.

Orchestrator

Worker lifecycle, container assignment, the dashboard and worker hosts.

TypeSummary
CloudHostSettingsClass. Settings a cloud host needs to create a worker machine.
HetznerWorkerHostClass. One Hetzner Cloud VM per worker, created through the Hetzner Cloud API (https://docs.hetzner.cloud).
IWorkerHandleInterface. One launched worker as seen by its host.
IWorkerHostInterface. Where worker instances live.
JsonWriterClass. Just enough JSON writing for the dashboard state document; avoids a JSON library dependency in the runtime.
NebulaOrchestratorClass. Spins worker processes up and down and authoritatively assigns containers to them through the control plane.
OrchestratorEventStruct. One line of the orchestrator's recent history, shown on the dashboard.
OrchestratorHttpServerClass. The orchestrator's tiny web server: serves the dashboard page and a JSON state document, and forwards commands (POST) to the main thread.
ProcessWorkerHostClass. Runs every worker as a child process of the orchestrator, from the same executable.
WorkerHandleStateEnum.
WorkerLaunchSpecClass. What the orchestrator asks a host to run.

Control plane

The IControlPlane abstraction and its SpacetimeDB and in-process implementations.

TypeSummary
ControlPlaneExtensionsStatic class.
GatewayInfoClass.
IControlPlaneInterface. Everything the mesh needs from the control plane: a node registry and container leases with epochs.
LeaseInfoClass.
LeaseStateStatic class.
LocalControlPlaneClass. In-process control plane with the exact semantics of the SpacetimeDB module (see Module~/Lib.cs), for single-process runs and tests.
SpacetimeControlPlaneClass. IControlPlane over the SpacetimeDB module in Assets/Nebula/SpacetimeDB/Module~.
WorkerInfoClass.
WorkerStatsStruct. What a worker reports about itself on every heartbeat.
WorkerStatusStatic class.

Bootstrap

Process entry point and role selection.

TypeSummary
NebulaBootstrapClass. Entry point for every Nebula process.
NebulaRolesEnum.

Serialization

NetworkWriter, NetworkReader and type-driven serialization.

TypeSummary
INetworkSerializableInterface. Implement on structs/classes you want to put in a NetworkVariable<T> or an RPC argument.
NetworkReaderClass. Counterpart of NetworkWriter.
NetworkSerializationStatic class. Type-driven (de)serialisation used by NetworkVariables and RPC arguments.
NetworkWriterClass. Growable little-endian byte writer used for every Nebula message.

Transport

The ITransport seam and the LiteNetLib implementation.

TypeSummary
DeliveryEnum. Delivery classes every Nebula link needs.
ITransportInterface. The seam between Nebula and whatever moves bytes.
LiteNetTransportClass. ITransport over LiteNetLib.
TransportEventStruct.

Protocol

Wire messages exchanged between workers, gateway and clients.

TypeSummary
AuthorityTransferMsgStruct. The authority event.
ClientInputMsgStruct. A short run of recent inputs (redundant against loss).
ContainerOwnershipEntryStruct.
ContainerOwnershipMsgStatic class.
DespawnPlayerMsgStruct.
EntityDespawnMsgStruct.
EntityFlagsEnum.
EntityRpcMsgStruct.
EntitySpawnMsgStruct. Full description of an entity.
EntityStateEntryStruct. One entity's pose inside a WorldState/GhostState batch.
EntitySyncMsgStruct. One entity's sync chunks for one tick (see SyncStateCodec).
EntityVarsMsgStruct.
HelloFlagsEnum.
HelloMsgStruct.
MsgIdEnum. Wire message ids.
OwnerStateMsgStruct. Authoritative post-simulation state of a predicted entity, for its owner's reconciliation.
PeerRoleEnum.
PingMsgStruct.
PongMsgStruct.
SpawnPlayerMsgStruct.
WelcomeMsgStruct.
WorldStateMsgStatic class. Batched transforms for one tick from one worker.

Debug

The in-game status overlay.

TypeSummary
NebulaDebugOverlayClass. IMGUI status overlay for every role.
NebulaProfilerStatic class. Where a worker's tick goes.
ProfileSectionClass. A named stretch of code whose cost is accumulated by NebulaProfiler.

Editor

Unity Editor tooling: builds, local mesh, control-plane helpers, the World window.

TypeSummary
NebulaBuildStatic class. Builds the executables every Nebula role runs from.
NebulaMeshStatic class. Developer loop: start SpacetimeDB, publish the control-plane module, launch a local mesh (orchestrator + gateway + N workers, all from the last build), then press Play in the Editor as a client.
WorldAssetsStatic class. Finds world definitions and manifests in the project and maps scenes back to cells.
WorldAuthoringStatic class. Create, open, close, delete and populate cell scenes.
WorldBakerStatic class. Builds the WorldContainerManifest: one container per cell plus every Container authored inside the cell scenes, with cell-local poses, in wire order.
WorldEditorPlacementStatic class. Keeps cell scenes usable in the editor even though they are authored cell-local.
WorldEditorWindowClass. The World window (Nebula > World): a map of the cell grid, one vertical layer at a time.

SpacetimeDB module

Tables and reducers of the control-plane module.

TypeSummary
ModuleStatic class.

On this page