UNet or traditional WinSockets!?

Unity has its build-in network management scripts - UNet.

Even though it’ll soon be deprecated, it had provided us a very convenient tool to make multiplayer games.

But with people who have “a little” experience of writing network-related programs like me, it make me wonder why the trouble!?

Why not just use traditional WinSockets instead of learning a whole new set of things!?

Is there some, probably fatal, downside that I had overlooked!?

Somebody please be so kind and enlighten me.

Much appreciated!

I’m not sure if your WinSockets refer to Microsofts WinSock API (WSA) or if you meant WebSockets. Anyways you are of course free to roll your own network solution and if you have the knowledge it would be better in the long run since the support would be more reliable in the future. However the only downside I see is that UNet already implements a high level of abstraction in order to work on various platforms.

Luckily since we deal with .NET / Mono we get already an abstraction layer from the framework. So the System.Net.Socket classes (which essentially implement Berkeley sockets) you already have most platforms covered. However WebGL always keeps a seperate topic. WebSockets are not Berkeley sockets and not compatible with actual sockets. However this is the only way (beside manual HTTP requests) to implement socket-like connections.

So one of the major goals UNet had was to provide one solution for the developer that works (more re less) on all supported platforms. While that sounds like a good selling point, the fact that it has been officially deprecated makes it risky to use in current long-term-projects. Also UNet, since it has some high abstraction layers, has some restrictions which can get in your way

My general advice for the time being is that if you have the knowledge and skills to implemnt your own network solution, go for it. Alternatively there are third party network solutions that many people seem to use. One of the biggest would probably be Photon. I have never used photon so I can’t give any recommendations here.