Best Practices

Limitations and Best practices

  • Each Schema structure can hold up to 64 serialized fields. If you need more fields, use nested Schema structures.
  • NaN and Infinity are encoded as 0 (integer encoding only)
  • null strings are encoded as "" (both “string” and “cstring” encoding)
  • Multi-dimensional arrays are not supported. See how to use 1D arrays as multi-dimensional
  • @colyseus/schema encoding order is based on field definition order.
    • Both encoder (server) and decoder (client) must have same schema definition.
    • The order of the fields must be the same.
Last updated on