Unity Network library looking for 2020 advice in a MMO like game

Actually im working in a game like MMO but with “real time” combat, right now im using Photon PUN2 and is working well, I have some issues trying to make a correct interpolation-extrapolation class for the combar but more or less work correctly.

The problem is, I want to have many many users connected at same time, and I want to balance myself the player over “layers” in the world, so in some moment I need to pay many money to photonengine people, but i want to manage all myself (I have experience in server management).

So before “waste” more time doing special load balance, and lag compensation code, i want to move to other option, when I have my own server without external people.

The problem is… I have no experience to decide correctly what is the best library actually with the idea to have a working game in 2020.

Actually I want somethink like Photon PUN2, that allow me send RPCs and events “in real time” to “groups”, “rooms” or “interests groups” (I dont care about things like chat because im working in self code using redis) and allow me to send like Photon the Vector3, Quaternions and object without need to serialize/deserialize the data (i dont want a very very low level library).

I check about Mirror, because I read the documentation and is very similar to PUN2, but I have doubts because I read the UNET are going to be deprecated with the new DOTS system (I know nothing about DOTS) but not sure if is a problem because Mirror use Telepathy and not UNET?

Anyway, i want some advices of people with experience, I want to develop the server/client code in the same code (open 2 instances like I do, flag one as server and others as client) and allow me to manage all by ports, IMPERATIVE server, but with some NAT support for external connections.

Thanks!

Judging from recent history, avoid any 1st party Unity solution.

3 Likes

For an MMO I’d recommend developing your own network library which fits your specific needs.

1 Like

Thanks for the replys, im a little Lost, whats the reason do dont use any Unity Network library?

And about create a self Network solution, some base class to use for all TCP or UDP work?

Here’s Unity’s track record on their own network libraries.

  • Unity releases solution based on RakNet. The solution suffered from several issues which were never resolved before it was deprecated.
  • Unity releases their internally developed Unet. The solution was buggy and arguably incomplete, though development on the High Level API portion basically stopped not long after its release, with no communication with the community on its future for years (the primary developer of the HLAPI left the company with no known replacement taking over).
  • Unity deprecates Unet in August 2018, stating they have been working on yet another network solution. As of well over a year after that announcement only alpha quality code with no official support has been released as well as a few demo projects and almost no documentation or even a solid timeline for the networking solution to be ready for the masses.

So Unity’s track record is one of not taking networking seriously, abandoning their official solutions as fast as they are released, and not following up a release with improvements and fixes. Their current effort hasn’t shown they are taking it anymore seriously than their previous solutions.

C#'s Socket class works just fine in Unity.

3 Likes

Ok after read that and look some info, appear Unity developers are more focused on other things than give a decent network support, or dont know the direction to follow…

About doing myself the network library, well, like I say, I going to do a complex project alone in my non-work time, so I dont have to much hour at day to work in, and I think doing all the network management with multy-threading, lag compensation, secure serialization/des, groups, ownership, etc, etc, is to much for the time I have (and test all this properly compared with a months or years external solution with many people on it).

I need something “in the midle”, I search to much and I see 2 options maybe can fit my needs (need advice):

Mirror: Years of work of improvements and support, NOT fixed to UNET (By default i want to use telepathy maybe, this make me free of extra companies or Unity Network changes I hope) and similar to PUN2.
I read some issues to take in consideration: Because use 2 threads per connection, the “real limit” is arround 500 multiple users before lag is insane, this is not an issue because I want to use a player balance based on layers that spam new unity instances, so in my mind is max 200 users per layer.
Some users talk about bad memory usage, but I see some tests and dont see to much memory usage or GC Collector spikes, maybe im wrong.

MLAPI: Used in some FPS example, and some people tell about is better than Mirror because manages better CPU/Memory, but the documentation is a bit limited, the examples, the same, and appear is only a unique Dev working in their free time to, dont get me wrong, I dont think that is bad, simple im thinking in the tests and real case scenarios of the library.

Maybe exists other options that I dont found, or maybe one of this two can be enought in my case scenario.

Thanks!

Mirror has allocation free sends and almost allocation free receives now. Last year this still used a lot of memory, not anymore though.
Telepathy uses 2 Threads per connection because that’s the best scaling TCP solution in Unity’s C# backend.
We have a new TCP transport called Apathy which uses native C code, not needing threads anymore. That should allow for 1k+ CCU.

Thats sound really good… Today im making some performance tests and testing Smooth Sync of the asset store, because I purchase it months ago to “learn” the code and make my own class with lag compensation, and when I open it in a Mirror proyect I see that allow me to set the Tick rate PER OBJECT, this is a must (and the reason I want to switch from Photon) because I have in mind some performance logic that need per object tick rate and multiple server instances with Redis.
For now I going to use Mirror, and if is available, going to test the Apathy transport you mention, because if I can have near 1K synced objects without issues, this open a world of options and mad fun things to do :stuck_out_tongue:

Thanks guys!