I want to build an MMO game, so I need information how to make a dedicated server so game client can communicate on it. I see unity has Networking scripting but I don’t have any information about how things like that work. if anyone knows about it please teach me. Thank you very much
Unity networking engine is deprecated now, we’re waiting for replacement. Meanwhile, you may use low level net api or third party networking solutions (wich I wouldn’t recommend). Also I suggest you develop your game with ECS because new networking API will be ECS based.
The concept of game server in Unity is fairly simple. You just build your game with headless checkbox on and voila - this will be the server.
You’re asking for something relatively big that can’t be put forward in a single post. Even a string of posts. Your best bet is to use one of the more popular frameworks that already handle hosting for you. Unity’s own uNet framework has been deprecated and it’s replacement hasn’t been fully released or documented, so it’s best going to a third party. One of the most popular being Photon. Make sure they can handle MMO. You want to avoid doing this yourself as the server architecture will become a huge undertaking. Generally taking multiple members of staff to consider capacity provisioning, load balancing, auto-scaling, and application health monitoring.
IMO run through some Photon tutorials and look through their hosting options.
@palex-nx why would you suggest against third party? For me my suggestion is to use something that has a high enough level API for someone relatively new to it to consider it as a good option. It might be worth you mentioning why yours is good to give @RxGian some scope between the two ideas?
Well, third party solutions i am aware of have architercure similar to deprecated uNET. I expect a lot from the upcoming ECS based networking engine, and people from unity said here it will be possible to migrate from LLAPI to new networking. I prefer to use built-in solutions and do not use third party tools until absolutely necessary because unity team support and testing coverage are much wider than any of asset store publishers.
You’re basically saying you want to build a Ferrari while never having built a go cart before. If you want something fairly turn key you could take a look at uMMORPG. I haven’t used it, but the developers are active on the forum.
Otherwise you need to take a deep dive into networking architectures and how it all works. Personally, for an MMO you aren’t basing on something like uMMORPG I’d write your own networking API for it instead of using Unity’s or 3rd party.
The new networking solution is supposed to be compatible with ECS as well as MonoBehaviours. ECS is not required.
Unity’s track record with networking is to release a new networking solution, provide almost no bug fixes or support, let it linger a few years, then resolve all the issues through deprecating the solution. Believing that they won’t repeat this cycle a third time is simply a leap of faith, not based on any evidence or past behavior.
I think he is just asking for general tips and links to tutorials. I have not built a MMO yet in Unity but I know their are several tuts out there on Youtube covering the topic but I assume you have already did your homework and researched that portion. I recommend you start by building a simple game that people can connect to each other using LAN before you try to build a MMO. Once you understand how to build a LAN based game, a WAN based game should be easy.
Basically though if your confused, you need to research something called Server/Client. In a nutshell the clients will be sending information or data to the server. The server will receive the information or data and determine which clients need the updated information. Kind of acting like a GPS for data. I hope that helps. Try the MSDN for info about Server/Client. I would suggest building a simple chat server/client system before trying to build your MMO.
Good advice. Start with something simple, it doesn’t even need to be a game. It can just be sending data back and forth, or moving an object around.
Some more general info, how it normally works in an MMO is it uses a server cluster of dedicated authoritative servers. The servers simulate everything and only take inputs from the clients, without trusting any of the simulation on the client. Unless the world is pretty small for an MMO, you’ll generally spread the world across multiple server instances. Clients are moved between these server instances as they travel the map. You’ll also have some form of master server coordinating all the game play servers, some form of database, and possibly servers depending on the services you need for your game (such as a dedicated chat server, a login server, etc).
It is not impossible to run the entire game on a single server instance, but you’re probably going to have to give up features like server side physics, keep the map small, and/or limit the number of max players to a fairly small number.
Sorry guys I can’t reply every post, so I am write the conclusion. Yes, I want to learn how actually networking program works, I think that what I need for doing this task (making a dedicated server). I was experienced to build some information system that using SQL and I had making java with json api once, but I never touched low level networking program. Also, I don’t understand yet if low level code works with unity C# or third party networking API or some kind of it.
What in my mind about game networking is: “if a clients sends commands to server that affected to other clients (like every event ingame), how to make that sync to other clients? so I must build a server that could commands every clients game event so the game will sync”.
And yes, I will try Photon and watch that youtube channel. Thanks a lot
I use SQL for simple things like turn based games but honestly its a bad practice. SQL is great for storing users data but not for Multiplayer games. What you need if you go the SQL route would be a service that runs in the background checking for updates after X amount of time has passed. Its a pretty basic concept but like I said, its a bad practice or at least not ideal.
I watched this tut awhile ago and its likely one of the best basic Unity networking videos I’ve seen as far as understanding the basics. My suggestion would experiment with SQL and other ideas. The best way to learn is by creating stuff & breaking stuff. Best practices may not be the best solution for you. I personally like to go out side the box a lot just to see what it does etc.
Generally any higher level networking API will have this kind of functionality built in. In deprecated Unet for example this was done through ClientRpcs, Commands, and SyncVars. A low level networking API will just give you the ability to track connections and send messages between computers, but integrating that with higher level functionality of your game will require building all that yourself on top of the included messaging functionality.
It will be more clear when you just try out various networking API’s for yourself. Don’t be concerned with going with the correct one for your game on the first try.
I don’t think Photon is that good of a choice for a traditional MMORPG due to its architecture, but it may be ideal if your MMO is more along the lines of a World of Tanks match based system.
I’ve watched similar video like that but with smooth movement. I don’t really sure if people said Unet it’s mean using Unity.Network library. And if people said I must using other High Level API does it mean I am using another library but not Unity.Network? so that’s mean I must dive into deep of Unity engine code. That’s the point which I confuse.
That’s same question above. Using Unet means Unity.Network library?
I’ve heard about photon, but I don’t know if they will allow me to use it as commercial purpose.
I am sorry guys I still don’t get it about third party library because as far as I know the script only hooked in a gameobject which means it must use unity library. is the DLL is solution? I am reading this on this page: https://docs.unity3d.com/Manual/UsingDLL.html
Well, I believe trying to predict someone’s behaviour from only two points in the whole possible behaviours space is irrational. It is much better to rely on technical details and possibilities given by the engine architecture. And those looks very promising.
UnityEngine.Networking is Unet. Adding a 3rd party networking API just involves following the instructions. Networking is a pretty advanced topic, so if you’re having trouble doing relatively simple things you should probably practice on single player more before jumping into networked games.
Well, if you think 5+ years of behavior boils down to just 2 data points, I’m not sure what else can be said. ok
It’s too difficult… we can’t just write everything in one single post, friend. Use google, friends. I would rather recommend you to rent some dedicated servers, that’s much easier then creating everything by yourself. I have a lot of experience with renting the cheapest dedicated servers, and I would say that it is the best option for you. You will spend a lot of time if you will try to do everything by yourself. You definitely need some persons that are going to help you with that. Wish you all the best and good luck.