In this short article I want to talk about current situation with Unity real-time multiplayer programming in the beginning of 2019. The official networking solution UNET has been deprecated and the official replacement hasn't been released yet. Good job Unity team! It was clear that UNET is dead even before it was officially deprecated. The new networking library seems to be insanely complex and far from version 1.0 for now. So it seems like now is not a good time to start a new multiplayer game from scratch in Unity game engine.

The biggest trap here is actually UNET. Networking is a very difficult kind of programming so we need to try things to find the best solution for us. And the best solution seems to be Mirror. Mirror is a high level Networking API for Unity, built on top of the low level Telepathy library. It's the networking solution that UNET always wanted to be. Basically this is community replacement for UNET. People do what Unity team failed to do – they rewrite and improve UNET - link to official Unity forum.

Mirror is great as it keeps the traditional UNET-like syntax and the way of doing things however it has improved/rewritten components and heavily optimized code. Mirror is in active development now. Source code available on GitHub - and after a few days of testing I want to say that I like it. Mirror runs great and has addressed all of the issues wrong with UNET. It is super easy to migrate to Mirror from UNET. There is automatic migration tool - UNET to Mirror Converter - migration from UNET is usually a matter of a few minutes.

I have tried many networking solutions and Mirror is by far the most stable and focused on gameplay code, not packets and bytes. A lot of the competitors made false promises and made claims that didn't stack up. Mirror passed all my expectations and it has great Discord community (https://discordapp.com/invite/N9QVxbM). Questions are answered realy quickly. After UNET deprecation the multiplayer tutorial was removed from "Learn" section so there is official Mirror documentation - https://vis2k.github.io/Mirror.

Ok now we have solid network foundation for our new multiplayer game but what about lag compensation and interpolation? Achieving smooth multiplayer movement is quite a complex task. Have you had problems with choppy and unrealistic movement with NetworkTransform component? Then you need Smooth Sync – asset store link.

I have replaced my own system which took me a couple of weeks to write and tweak with this one and the game behaves much better in high lag conditions. This asset covers all the bases of lag compensations while keeping it simple. Just remove NetworkTransform from each of your prefabs and add Smooth Sync. It took me less than 5 minutes to do. The tech behind the plugin, the interface, the source code, all that is great and it makes your game's movement syncing way better. It works out of the box and there is now Mirror support.

Well that’s all about Unity networking in the beginning of 2019 for now. Please note that this networking solution we use for our new multiplayer game but you may wait for a new networking library from Unity team. If you have something to add just write a comment.