-
Notifications
You must be signed in to change notification settings - Fork 5
Views, Updates and Keyframes
A View
is a collection of namespaces networked variables from the server.
A Controller
is much the same but present on the client that owns that entity, and allows that client to send commands to the server about it.
The state in views are variables reffed to as ShadowFields
, these are replicated down from the server to the client in Keyframe
or Update
messages.
A view can have up to 128
, ShadowFields
, the range -1
to -128
are reserved to unset nullable fields.
So if a update comes in for ShadowField 20
then that field should be set to that value.
But if an update comes in for ShadowField -20
then the ShadowField 20
should be nulled and unset.
There are 2 ways to update a views state.
A keyframe update is a heavy weight way to update alot of a views state at once. This message has an array of bits that denote what nullable fields are included in the message or not. This bit field is at the start of the message. The bits are in order of the nullable fields, this is separate to the shadow field number.
Keyframes for a controller sent to the client will be prefixed with a ulong of the account id.
TODO: Example
An update message is a more light weight way to update view state if only a few values need to be changed.
In this message each field is prefixed with a byte id, this is the ShadowField
index.
- Keyframes per entity can be rate limited to 1 every 3 seconds