Skip to main content

Networking Specs & Tricks

Networking in Udon can be challenging! Try to keep things simple until you're more experienced.

Specs

Bandwidth limits

note

Note: All specs subject to change. You can see some specific information about the data used per-object in Debug Menu 6.

  • Udon scripts can send out about 11 kilobytes per second.
  • Udon scripts with manual sync are limited to roughly 280,496 bytes per serialization.
  • Udon scripts with continuous sync are limited to roughly 200 bytes per serialization.

If a world exceeds limits, its networking will become clogged (see IsClogged). This has a different effect depending on the sync type of the UdonBehaviour:

  • Continuous behaviours will fail to raise the network event and write errors in the logs.
  • Manual behaviours will cache the event and try again. In both cases, the logic of the UdonBehaviour will continue to work, but the data will not be sent nor received.

Try designing your scripts in ways that reduce the amount of networking required. For example: If an object will move on a fixed or predictable path, then its position may not need to be synchronized. Instead, its initial location, velocity, and time of departure may be sufficient.

Continuous synchronization

Continuous synchronization is intended for data that changes frequently and where intermediary values don't matter, like the position of an erratically moving transform. VRChat will perform intermediary value approximation to recover lost data, and will attempt to optimize network data for continuous synchronization.

Continuous sync is limited to roughly 200 bytes per serialization.

Manual synchronization

Manual synchronization is good for variables that are updated frequently, but quickly. It is intended for data that changes infrequently and where intermediary values matter; like the positions of pieces on a chess board.

Each manually-synced object is rate limited as a factor of the data size. The more it sends, the more its send rate is limited. Scripts can call RequestSerialization as often as they want, but Udon will wait until enough time has passed before calling OnPreSerialization, sending the data, and calling OnPostSerialization with the result.

Manual sync is limited to 280,496 bytes per serialization.

Synced Variables

These variables are available for syncing across the network.

note

In the lists below, 'size' refers to the approximate size in memory. When networked, the data is serialized, which may lead to more data being transmitted. For example, syncing a bool will send at least 1 byte of data (instead of 1 bit) in addition to any networking overhead. To find out how many bytes of serialized data were, use byteCount in the OnPostSerialization event.

Boolean types

TypeSize
bool1 byte

Integral numeric types

TypeRangeSize
sbyte-128 to 1271 byte
byte0 to 2551 byte
short-32,768 to 32,7672 bytes
ushort0 to 65,5352 bytes
int-2,147,483,648 to 2,147,483,6474 bytes
uint0 to 4,294,967,2954 bytes
long-9,223,372,036,854,775,808 to 9,223,372,036,854,775,8078 bytes
ulong0 to 18,446,744,073,709,551,6158 bytes

Floating-point numeric types

TypeApproximate rangePrecisionSize
float±1.5 x 10^(−45) to ±3.4 x 10^(38)~6-9 digits4 bytes
double±5.0 × 10^(−324) to ±1.7 × 10^(308)~15-17 digits8 bytes

Vector mathematics types and structures (Unity)

TypeRangeSize
Vector2same as float8 bytes
Vector3same as float12 bytes
Vector4same as float16 bytes
Quaternionsame as float16 bytes

Color structures

TypeRange / PrecisionSize
Colorsame as float16 bytes
Color32same as byte4 bytes

Text types and structures

TypeRangeSize
charU+0000 to U+FFFF2 bytes
stringsame as char2 bytes / char

Other structures

TypeRangeSize
VRCUrlU+0000 to U+FFFF2 bytes / char

If you have multiple UdonBehaviours on an object, the sync method will default to the most restrictive settings - a Manual UdonBehaviour and a Continuous one on the same object will both act as manual.

Prioritization of visible objects

Udon's networking prioritizes synchronized game objects that are currently visible to the local user.

Udon periodically checks the visibility of all mesh renderer children of synchronized objects. This is used in the quality of service behaviour of Udon's network load balancing.