Skip to main content

Type catalog

Every top-level and nested value is written as 1 type-tag byte plus a payload. Sizes below are payload sizes unless noted; add +1 for the tag on the wire.

Inference chooses the smallest fitting representation.

Numbers

TagWhen inferredPayload
U8 / I8integer in unsigned/signed 8-bit range1
U16 / I16integer in 16-bit range2
U24 / I24integer in 24-bit range3
U32 / I32integer in 32-bit range4
U40 / I40integer in 40-bit range5
U48 / I48integer in 48-bit range6
F32non-integer within F32 magnitude4
F64other numbers (including oversized integers)8

Signed ranges use two’s-complement style bounds (for example I8 from -128). Unsigned ranges are non-negative up to 2^n - 1.

Booleans, nil, empty table

TagPayload
Bool1 (0 or 1)
Nil0
Void0 (empty table {})

Strings

TagLength prefixMax length
Str8u8255
Stru1665,535
Str24u2416,777,215

Lengths are bytes, not UTF-8 characters. Payload is the raw string bytes.

Buffers

TagLength prefixMax length
Buf8u8255
Bufu1665,535
Buf24u2416,777,215

Payload is a raw byte copy of the buffer.

Arrays and maps

Tables with a non-zero array length (#t ~= 0) & no hash elements serialize as arrays. Otherwise non-empty tables serialize as maps (when map-length compute is enabled, length picks Map8 / Map / Map24).

TagCount prefixMax entries
Array8 / Map8u8255
Array / Mapu1665,535
Array24 / Map24u2416,777,215

Each array element is a full tagged value. Each map entry is a tagged key followed by a tagged value.

Vectors and Color3

TagPayload
Vec (Vector3)3 × f32 (12)
Vec2 (Vector2)2 × f32 (8)
Color (Color3)RGB as 3 × u8 (3)

CFrame

Controlled by Dynamo.SetConstant("UseQuaternion", …) (default true):

TagPayload
QCframeposition + quaternion, 7 × f32 (28)
Cframeposition + 3×3 matrix, 12 × f32 (48)

UDim / UDim2

TagPayload
Udimquantized scale u16 + offset i16 (4)
Udim2two UDim payloads (8)

Scale is quantized into [QuantizedScaleMin, QuantizedScaleMax] (default 01) across 065535. Change the range with SetConstant("QuantizedScaleMin" | "QuantizedScaleMax", …).

Enums

TagPayload
EnumType (Enum)u16 enum id
EnumItemu16 parent enum id + u16 item value

Enum ids are assigned from Enum:GetEnums() at module init.

Instances

TagPayload
RefInstanceu16 id (Normal) or u24 id (Extended)
SerInstanceschema id u8, then each property as a tagged value

Default instance path is reference serialization (InstRefInstance when SerInstanceSerialization is false). Switch with:

Dynamo.SetConstant("SerInstanceSerialization", true) -- value schemas
Dynamo.SetConstant("InstanceRefMode", "Extended") -- u24 refs

References use the _VSID attribute and in-memory maps:

  • Server assigns ids to descendants and can reuse ids when instances are removed.
  • Client mirrors replicated _VSID attributes into local maps.

DefineSerInstanceSchema registers value-style schemas for SerInstance (creates a new instance on deserialize).

Type tag constants

All public tags are on Dynamo.Types (U8, Str8, Array, Vec, QCframe, RefInstance, SerInstance, …). Tags are stable within a Dynamo version; do not hard-code numeric ids across major versions without checking the module.