I made this post to warn some people who are new to Unity and aim to make a networked game.
Well to be honest, It has been really hard for me to understand how networking on Unity works and I’ve written plenty client,server code in the past in many different programming languages and I’ve especially focused on the MMORPG architecture.
I’m sure this is all harder to understand if you have already learned networking the way it’s actually done with no help.
It’s kind of funny because at some point I was sure it would take me less time to build my own networking code than learning Unity’s networking.
I spent very long hours reading everything I could about networking on Unity.
Now I realized the only hard part was to get into the right(Unity) mindset after you know how networking works outside the user friendly Unity. EVERYTHING is done for you in Unity.
Took a while to realize they made it THIS simple. Sadly I never really liked when things were made simple, because simple = anyone can do it = too many things around = less customers for everyone.
Anyway what I’m trying to say is networking might need better documentation.
For example It took me hours just to find out how to run a server because the example files have so many files with like 3 of them connecting somewhere or creating servers themselves etc. This was not that bad, but what really made me sad was the fact that there is no example that separates client and server code to two different projects and this really sucks for someone who wants to make a server-auth game with a dedicated server. (What makes this a bit difficult to learn from the tutorials is the fact that there are two servers, one is the MasterServer and one is the actual game server and this is very confusing if client and server are built into the same project.
The official networking examples should at least say what is for the server and what is for the client.
It took a while until my brain accepted the way OnSerializeNetworkView works.
I examined the tutorial files, read random questions on Unity networking, watched random networking tutorials etc for two days and now I’m starting to get how it works so just keep forcing yourself to learn.
It’s funny how sometimes the way things are made so they would be user friendly makes them very difficult for those who are used to be pissed at compiler errors that make no sense.
Check out MMOKnight