Performance of rUDP vs ENet?

I’ve seen some negative sentiment and remarks about rUDP over the years, which has surprised me since it seems to be a solid performant option with a nice Plan 9 implementation model / example. Have you tested it against ENet and, if so, what advantages / disadvantages have you seen or believe may exist?

@ylluminate The implementation of rUDP support we’ve built into a version of the game server is based on the netcode spec. Though for browser-based games we also have a version of the server which supports WebRTC and uses two data channels to handle reliable and unreliable tagged messages.

The actual implementation is not exactly like how the netcode spec suggests because that design was intended for fast-paced dedicated game server instances (with engines written in C or C++). With Nakama server we’ve implemented an authoritative multiplayer engine which can support many 1000s of multiplayer matches as individual goroutines (green threads) per server instance. To account for this design we adjusted the netcode spec to fit the multiplayer engine we’ve got.

All the packet structure and connection-orientated design around a UDP socket is structured as described in that spec.

As far as the discussion around rUDP and the negative opinions of it can you point me to some of that discussion? I’d like to understand the rationale for it.

1 Like

Sorry if this is kind of irrelevant to the topic, but this statement actually raised a question for me since I am developing a pvp fighting game in a p2p fashion and using Nakama as backend. Are there benchmarks about the number of concurrent matches on a single Nakama instance for a specific hardware config using rUDP (or other protocols)?

@Mahdad-Baghani It’s a good question. You can see the benchmarks for the server available on the docs:

As far as what you can expect from the performance specifically as it applies to your game only you will be able to evaluate the performance profile because it depends on a number of factors:

  • How efficiently you’ve packed and divided up the messages that make up your game’s specific netcode.
  • How many messages you send to the server per tick.
  • How much computational logic you need to execute per tick. What does the CPU load look like on average per tick?
  • Etc, etc.

Hope this helps.

1 Like