InterestSettings
The interest settings, resolved from NebulaConfig and already clamped into a set of values that work together (see Validate).
Nebula · Packages/com.1by3.nebula/Runtime/Interest/InterestSettings.cspublic struct InterestSettingsThe interest settings, resolved from NebulaConfig and already clamped into a set of values that work together (see Validate). Everything downstream — grid, per-client evaluation, subscription margins, worker publishing — reads this and nothing else, so the standalone gateway and the Unity worker cannot drift apart over what "near" means.
Fields
Radius
public float Radius;Meters a client hears about an entity at, unless the entity's prefab overrides it.
ExitMargin
public float ExitMargin;Extra meters an entity must travel past Radius before it leaves the set (hysteresis).
LingerSeconds
public float LingerSeconds;Seconds an entity must stay outside Radius + ExitMargin before it is despawned.
CellSize
public float CellSize;Region edge in meters, before it is aligned with the world grid.
Planar
public bool Planar;Regions are columns: Y does not enter a region key. True for surface worlds.
EvalHz
public float EvalHz;How often a client's interest set is re-evaluated, in hertz.
SubscribeMargin
public float SubscribeMargin;Extra meters of regions subscribed beyond the exit radius, so a moving client is never late.
RegionLingerSeconds
public float RegionLingerSeconds;Seconds a region stays subscribed after it stops being needed (anti-thrash along an edge).
LinkLingerSeconds
public float LinkLingerSeconds;Seconds a worker link is kept after the last reason to hold it has gone.
ResyncSeconds
public float ResyncSeconds;How often a gateway re-sends a Full subscription snapshot as an audit.
MaxRadius
public float MaxRadius;Ceiling on a prefab's RelevanceRadius; also how far a wide entity may reach.
MaxFoci
public int MaxFoci;Most foci one client may have (RTS camera plus owned units, spectators).
HintMaxDistance
public float HintMaxDistance;Meters a client's focus hint may sit from its pawn before it is clamped.
HintMaxHz
public float HintMaxHz;Most focus hints accepted from one client per second; the rest are dropped.
MaxExplicitPerClient
public int MaxExplicitPerClient;Most explicit per-entity subscriptions one client's policy may ask for.
FarMaxEntities
public int FarMaxEntities;Most entities one client holds in the far relevance tier (FarRelevance), nearest first. 0 turns the tier off on the gateway.
MaxFocusSpeed
public float MaxFocusSpeed;The fastest a focus is expected to move, in meters per second. Only used to validate SubscribeMargin.
MaxTravelPerUpdate
public float MaxTravelPerUpdate;The most meters an entity may travel between two updates a client receives: the gateway sends a fast entity more often than its distance tier says (RelevanceTiers.CapForSpeed). 0 turns it off.
FocusLeadSeconds
public float FocusLeadSeconds;Seconds of travel ahead of a moving pawn at which the gateway adds a second focus (LeadOffset), so entities ahead of a fast pawn are in its set before it reaches them. 0 turns it off.
NearRadius
public float NearRadius;Rate tier inside the set: entities within this radius get every tick.
FarRadius
public float FarRadius;Rate tier inside the set: entities beyond this radius get every FarDivisor-th tick.
MidDivisor
public int MidDivisor;FarDivisor
public int FarDivisor;HighTiers
public RelevanceTierBands HighTiers;RelevancePriority.High's own distance tiers; without an override it gets the global tiers shifted one better (see TiersFor).
LowTiers
public RelevanceTierBands LowTiers;RelevancePriority.Low's own distance tiers; without an override, the global tiers one worse.
BackgroundTiers
public RelevanceTierBands BackgroundTiers;RelevancePriority.Background's own distance tiers; without an override, the middle band's rate near and none beyond.
ClientLoadRadiusCells
public int ClientLoadRadiusCells;Cells of content a client keeps loaded; raised to cover the interest radius.
PartitionWarnEntities
public int PartitionWarnEntities;Entities in one container above which the worker warns that the world wants partitioning.
PartitionWarnFilterMs
public float PartitionWarnFilterMs;Milliseconds of per-gateway filtering per tick above which the worker warns the same way.
MinChunkLoadLeadSeconds
public const float MinChunkLoadLeadSeconds = 4f;Seconds of lead a chunk load needs at the least: the allocator's 4 Hz tick, the lease round trip, registration and building the chunk's content.
Properties
Default
public static InterestSettings Default { get; }The shipped defaults. A game that sets nothing gets these.
ExitRadius
public float ExitRadius { get; }Meters an entity must be outside before the linger clock even starts.
SubscribeRadius
public float SubscribeRadius { get; }Meters of regions a gateway subscribes around a focus: the exit radius plus the pre-subscription margin.
EvalInterval
public float EvalInterval { get; }Seconds between two evaluations of one client.
Methods
TiersFor
public RelevanceTierBands TiersFor(RelevancePriority priority);The distance tiers an entity of priority is sent by: its own when the config overrides them (HighTiers, LowTiers, BackgroundTiers), otherwise the global ones (NearRadius, FarRadius, MidDivisor, FarDivisor) shifted as RelevancePriority describes. RelevancePriority.Normal is always the global tiers.
LeadOffset
public Double3 LeadOffset(Double3 velocity);Where a lead focus goes for a pawn moving at velocity, relative to the pawn: FocusLeadSeconds of travel ahead. Zero (no lead focus) when that is no further than ExitMargin, which the pawn's own focus already covers, or when the lead is off.
NearCells
public int NearCells(float cellSize);The cells of content that must exist before interest needs them. Content streaming, the runtime allocator ring and the container window a client is told about all derive from this, so a client can never be spawned an entity standing on geometry it does not have.
ChunkRing
public int ChunkRing(float cellSize, int margin);The Chebyshev ring of chunks a worker keeps leased around every pawn: NearCells plus margin extra cells (never fewer than NearCells, which is the least that has every chunk interest can reach). NebulaConfig.ChunkedWorldServerRingMargin is the margin; 1 builds content one whole chunk before interest needs it.
ChunkLoadLeadSeconds
public float ChunkLoadLeadSeconds(float cellSize, int margin);Seconds between a pawn at MaxFocusSpeed walking into a chunk and the first chunk its new ring adds being needed by interest: the ring reaches ring × cell metres from the chunk edge it just crossed, and interest reaches the exit radius plus the overshoot. Zero margin leaves only the slack NearCells rounds up by (up to one cell, none when the radius is a whole number of cells); each further margin cell adds a cell of travel. Infinity when nothing moves or there is no cell size.
MaxContainerRows
public int MaxContainerRows(float cellSize);Most container rows one client may be told about in one evaluation: the ceiling on the NearCells windows the gateway opens around a client's foci. Derived rather than configured, because every part of it is already a setting: a window is 2 × NearCells + 1 cells on a side, a planar world stacks nothing above it, and a client may hold MaxFoci foci. It is a safety net and not a budget to aim at — the rows entities in the set stand in are collected before it applies, so reaching it can only ever withhold empty terrain a camera is looking at.
Clamped to [64, 4096] so a tiny world still gets a usable window and an enormous InterestRadius cannot turn one evaluation into a lease-table broadcast.
Validate
public InterestSettings Validate(List<ConfigIssue> issues, float worldCellSize = 0f, float ghostBandMargin = 0f);Check the setting relationships and return the values that will actually be used. Anything that can be repaired is repaired and reported as a ConfigSeverity.Warning; only a non-positive size is an ConfigSeverity.Error, because no clamp of it would be what the game asked for. worldCellSize is the world definition's cell size (0 = none) and ghostBandMargin the meshing band, both of which constrain the region size.