Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Type mapping

In tier 2 (and generated code), protobuf types convert to and from Godot Variant types as follows.

Proto typeGodot type
double, floatfloat
int32, sint32, sfixed32int
int64, sint64, sfixed64int
uint32, fixed32int
uint64, fixed64int
boolbool
stringString
bytesPackedByteArray
enumint (the enum value)
messageGrpcMessage
repeated TArray
map<K, V>Dictionary

Notes

  • 64-bit unsigned integers: values above 2^63 - 1 do not fit in Godot’s signed 64-bit int and will wrap. Use string fields for very large numbers if exact representation matters.
  • Nested messages are GrpcMessage instances. When setting a message field you may pass either a GrpcMessage or a plain Dictionary.
  • GrpcMessage.to_dict() converts a whole message (recursively) to a Dictionary; get_field / set_field work field-by-field.
  • Unset fields read back as their protobuf defaults (0, "", empty array, etc.).