Learning Udon Networking

VRChat official documentation should be good enough to learn Udon Networking.

Go here: https://docs.vrchat.com/docs/udon-networking

My takeaway on Udon Networking as a Garry's Mod creator

<aside> ⚠️ I am not satisfied with this entry, and I’d like to rewrite most of it. I will leave it online for now.

</aside>

In Garry's Mod, there is a client and a server. The server has authority on all of the game state. When a client sends a command to the server, the server responds lightning fast in the order of 10s of milliseconds.

In VRChat, there is no such thing as a Client and a Server, but it can be thought of something close.

Some objects in the world are networked, most likely UdonBehaviours (but not only).

Each object has an Owner. By default the Owner is the oldest person in the instance (= first person who joins, or oldest person who has joined).

The Owner is like the Server: they have the authority on that object's synchronized variables.

Non-owners cannot change the synced variables. They can still call Custom Networked Events on an object that they don't own, and everyone will receive it.

The response times are in the order of 100s of milliseconds.

If a non-owner wants to change the synced variables of an object, then they must become the owner of that object. In effect they become the Server of that object. This is called an Ownership transfer and this has a significantly slower response time in the order of 300s to several seconds.

In the light of this, real time interactions and games are a challenge in VRChat, as the response times means games have to be designed to continue feeling responsive with the significant lag as a given.