Object Packets

After sending the RegionHandshakeResponse packet, ObjectUpdate, ObjectUpdateCompressed, ObjectUpdateCached and ImprovedTerseObjectUpdate packets will start streaming in from the server, representing a few different methods of spawning objects in the scene, or updating their state.

Object Update packets are used for almost everything when it comes to building the scene. They are used to inform the viewer of an avatar's presence, their attachments, and the scene's spawned objects.

Object Update

This is one of the first object updating packets the viewer will receive. Before the agent is a root agent, ObjectUpdate packets will be sent, containing avatar data, and avatar attachment data.

Though the parsing of most of the packet is relatively simple, lots of relevant information is hidden in non-obvious places throughout the packet.

extra_params

contains information about sculpts, flex data, materials, and more. Each type has a different decoding structure. Extra params of type sculpt can contain mesh data, and store the asset_ID for retrieving a full mesh from the ViewerAsset endpoint.

name_value

A string representation of certain object relevant information. For objects of type Avatar, this contains the avatar's name. For objects of type Prim, this can include a string representation of the object's attachment data.

Evil Benthic

Parsing Object Update

Though the majority of the ObjectUpdate struct is straightforward, the MotionData portion of it can be difficult to parse correctly.
The type of update is determined by the length of the data field.

ObjectUpdateCached

ObjectUpdateCached packets begin coming in after the RegionHandshakeResponse packet is sent. This is a very simple packet that contains only a list of the scene-local IDs, and a CRC for visible objects in the scene, to inform the viewer to check its cache for the objects specified.

If those objects aren't present, the viewer is expected to sen a RequestMultipleObjects packet, and expect to receive ObjectUpdateCompressed packets in return.

ObjectUpdateCompressed

ObjectUpdateCompressed packets begin coming in after the RegionHandshakeResponse packet is sent. It is also sent in response to a RequestMultipleObjects packet, giving full object information for the requested objects. This is similar to an ObjectUpdate packet, having many similar fields in its data block. This includes its special handling of the extra_params block, and the name_value block. However, this contains several objects instead of a single one, many of its fields are optional, and are out of order when compared to an ObjectUpdate, packet.

ImprovedTerseObjectUpdate

ImprovedTerseObjectUpdate These packets are received mainly when something in the scene has changed position, velocity, or some other movement property. These are short packets which give mostly the fields found in the MotionData field in the ObjectUpdate, packet.