Table of Contents

Class ProfileBuilder

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Declares a named set of observers — "player", "god", "spectator" — that a session is bound to as a whole.

public sealed class ProfileBuilder
Inheritance
ProfileBuilder
Inherited Members

Remarks

A profile exists so interest is a policy an application states once rather than a sequence of requests every connection has to get right. Switching a session's profile replaces its whole interest atomically and resets its view, which is the only honest way to do it: a half-switched session would be told about entities under one rule and forgotten about them under another.

Methods

Aggregate(double, double)

Per-cell counts per archetype, for a view too wide to send entities for: a strategic map, a far tier, a heat map.

public ObserverBuilder Aggregate(double tileM, double rateHz)

Parameters

tileM double

The tile's edge, in metres.

rateHz double

How often the counts are refreshed, in hertz.

Returns

ObserverBuilder

The observer's builder.

Remarks

Declared now, built in Phase 2.

ClientRegion(double)

A convex ground footprint the client sends through the built-in ClientRegion command — a camera's view, clipped at the horizon.

public ObserverBuilder ClientRegion(double maxEdgeM)

Parameters

maxEdgeM double

The longest edge the server accepts, in metres. A client asking for more is clamped, not refused.

Returns

ObserverBuilder

The observer's builder.

Remarks

Declared now, built in Phase 2.

MaxObservers(int)

Raises how many observers this profile may declare, for an application that admits sessions with a matching MaxObservers.

public ProfileBuilder MaxObservers(int count)

Parameters

count int

The profile's own ceiling, at least 1. Defaults to DefaultMaxObservers.

Returns

ProfileBuilder

This builder.

Remarks

This ceiling is the declaration's, never a session's. A profile is declared once, at Start, and bound by whichever sessions ask for it; the admission hook is what decides whether a given session may hold that many observers, and its number is the one that binds at run time. Capping the declaration at the default limit instead — which is what this replaced — made a session admitted with a higher limit unable to ever bind a profile that used it, because the profile could not be written in the first place.

Sphere(double, double)

A radius around a point, an entity, or the session's controlled entity.

public ObserverBuilder Sphere(double radius, double leave = 0)

Parameters

radius double

The enter radius, in metres.

leave double

The leave radius, in metres — larger than radius. Zero leaves the hysteresis band to the engine.

Returns

ObserverBuilder

The observer's builder.

Remarks

The two radii are not a refinement: an entity hovering on one boundary would enter and leave every tick, and every re-entry costs a full enter record. Hysteresis is what makes the cost of jitter zero instead of unbounded. Declared now, built in Phase 2.

World()

Everything, of the archetypes named with Of<TArchetype>(). For a tool, a viewer bot, or a world small enough that the whole of it is the interesting part; sessions holding only this and fully synced are byte-identical, so the engine encodes one frame for all of them.

public ObserverBuilder World()

Returns

ObserverBuilder

The observer's builder.