I want to start a new multiplayer game project. It is an RTS game like red alert.
I am very confused about the changes on multiplayer, what apis should I use with this game,
I don’t want to use alpha, untested features and would like to use High Level apis for most common things.
Please guide me on this, you can also suggest 3rd party services/libraries.
I am in the same boat. I am afraid of using a lot of these 3rd party services now because some of them are using UNET which is being abandoned but I also don’t want to use the alpha of the new Unity Multiplayer.
I see on this forum that UNET High Level API is not developed anymore but the low level api is here until the end of 2022. So that’s a good amount of time, maybe it’s okay if those 3rd part packages use the low level api to build upon. Looking at Mirror but still haven’t decided yet.
Trying to assess if the new system they introduced with FPS sample is a logical choice.
If you’re okay with using the regular MonoBehaviour system, and not ECS, I would recommend Mirror . I’ve used it for a project and I was very satisfied. It works like the old UNET system but has fixed a lot of bugs and become a lot more reliable. A big plus is that most of Unity’s own UNET documentation still applies to Mirror.
Yes I’m okay with MonoBehaviours instead of ECS.
Thank you both, I could use one them. Now I’m thinking about the server infrastructure. I remember UNET gives us the ability to use their servers as service, and pay for what you use.
How does this work with either MLAPI or Mirror?
I’m no expert on that subject, but from what I know, the multiplayer service that Unity offered you could use with UNET has been removed from Mirror. Unity didn’t support it fully either so there was no point in having it. They did launch a new thing however called List Server, which by the looks of it, allows you simply list servers, but you have to host it yourself and has a small fee.
I hope this answers your question! And I would recommend Mirror’s Discord server and then ask all your question there about Mirror.
Don’t use the List server, It’s horrible. It’s a walking, closed source security hole. I wrote a full clone of it and open sourced that I suggest you look through to understand why it’s not a honest product.
I notified the author about these security flaws in private and provided how to actually fix them. But no, the product is still being sold. I just think it’s dishonest.
And IF it was a good product, then how come I created a clone of it in 5 minutes.
If you want something good, use PlayFab, or Steam. Unlike Mirror, the MLAPI supports proper login authentication.
Traditionally RTS games often used a technique referred to as lock step rather than a system of syncing various GameObjects semi-independently like most high level API’s for Unity employ. This is a very deterministic game design where just inputs are synced and all clients simulate the game independently but end up at the same game state, rather than a server simulating the game and syncing the state of all objects to clients.
This technique is on the down trend, but I believe still used for games with high numbers of units, as syncing player inputs is a lot lower bandwidth than syncing the movement and stats of hundreds or thousands of GameObjects. I’m certain Red Alert used lock step.
So what would be your suggestion?
I suppose I can send send input from users with a node.js server, but I have no idea how to deal with matchmaking and lobby.
I’m sure there is an elegant solution from a third party. I hope you give me more direction @Joe-Censored@TwoTen
It all depends on what you’re trying to create. RTS describes a wide range of games. If the total number of units to sync were around 100 or less, I’d probably just go with a server authoritative solution where clients send orders to the server, the server simulates the game, and syncs updates for all the objects to the clients. That’s the typical approach of most available Unity network API’s.
If you’re instead planning hundreds or even thousands of individual units though, that approach may end up impractical.
I’d recommend SmartFoxServer or a similar solution, as I’ve done in other posts.
One thing I have struggled with is using one API for the core game, another one for matchmaking, one more for storage/database, and yet another one for authentication etc.
Authoritative servers like SmartFox (maybe folks can provide alternatives?) have all you need in one SDK. You get all the necessary goodies: room/user/buddy management, matchmaking, chat, npc, server side logic, access to local or remote storage, security and admin tools and the list goes on… Granted, if you’re doing a real-time, physics-heavy type of game this won’t probably cut it, as you depend so much on the Unity engine that you would need Unity on the server side too, but other than that I’d recommend taking a look. www.smartfoxserver.com
The product is solid, support is fast and you have multiple options for licensing. Personally I am using the elastic option, which is more affordable for my needs.
Years ago there used to be a similar product called Electroserver but I don’t think it’s alive anymore.