ChatImproVR / chatimprovr

A Virtual World Platform for the future
https://chatimprovr.github.io/
Other
10 stars 1 forks source link

Networking overhaul (QUIC) #26

Open Exiled1 opened 1 year ago

Exiled1 commented 1 year ago

We should eventually use the QUIC protocol to send our network connections.

Masterchef365 commented 1 year ago

Additionally, we should split network communications into reliable/unreliable, so that plugin devs can choose the best option for their use-case. For example, moving a whole building once might be a reliable operation (since you want to make sure everyone has the same state and we don't care about latency. Another example would be avatar motion, where unreliable communication would be preferable due to low latency.

enum Reliability {
    /// Reliable, with potentially high latency (as in TCP)
    Reliable,
    /// Unreliable, with low latency (as in UDP)
    Fast,
}

This could be exposed in Messages by modifying the Locality enum to include this information:

enum Locality {
    Local,
    Remote(Reliability),
}

The Synchronized component would also expose this:

struct Synchronized(Reliability)

Note that this is exposed as an extension to QUIC https://www.rfc-editor.org/rfc/rfc9221.html