2 ms·
In a nutshell I am using the Pub/Sub model, both players subscribe to a Topic, with a set of unique identifiers that direct where message need to be delivered t
by ScReeChHB 3y ago
In a nutshell I am using the Pub/Sub model, both players subscribe to a Topic, with a set of unique identifiers that direct where message need to be delivered to. I built a message broker from scratch using Erlang. I also have 3 message brokers running in Ihio, Belgium and Sydney. They are all connected to one another in a mesh.
You will connect to your closest node and I will connect to my closest node and then the NoLag message brokers will pass the messages on for us. I use Google Cloud geo routing for that.
As it is now for the MVP, NoLag only supports WebSockets, I know this is not the most efficient for games but the browser does not support UDP/TCP. The idea was to do TCP and UDP if there was a need for it from clients. Thinking of it now I need TCP for MQTT, sot that will be next.
With the BTTF game example each browser is sending the players location and movement as it happens, or more accurately when ever the Babylon game engine completes a cycle. If you were to mimic a UDP connection, you could send timestamps in the player payload, and if the timings is more than 100ms then "hide" the player.
Unfortunately now latency metrics, another one on the TODO list(there is a few things :-) ).
But I do have a very rudimentary metric for you, I am in Melbourne and the closest NoLag node to me is Sydney, the round trip latency is about 20ms.
If you have the time and want to have more of a play, you could check out the developer docs https://developer.nolag.app https://developer.nolag.app
Unfortunately I only have TypeScript SDK for you to check out, I might build a Python SDK next...