Hi guys.
I want to add multiplayer to my game and I’m kinda lost with all the options available.
I’ve already coded some in Unity, but I don’t want reinvent the wheel here so I’m almost decided to switch to a middleware solution to reduce costs.
Problem is, I’ve found a lot of frameworks and all of them looks great and with similar descriptions.
It would take me a lot of time and energy to study the differences, and I was wondering if anyone with experience on the matter could share some light on the subject.
Pros and cons, recommended uses (like, which is better for action fps or rts), comparisons and past experiences would be great.
Is your game going to be an MMO? If not, why are you dead set on using a middleware server solution when Unity’s built-in networking works great for smaller games?
Hey Legend.
No it’s not, and as I said in the post I’m not dead set yet, I’m evaluating options.
And the reason for it is, again as I said :), to avoid reinventing the wheel.
If there’s something already made I might as well as use that and save me the trouble.
Nevertheless, I made the thread for a more general purpose than my own project, but for having a quick overview of available options.
By implementing a middleware solution, you are, in my opinion, reinventing the wheel. Unity has built-in networking libraries based on raknet that make creating a network connection between a client and host mere few lines of code, and you can use the public master server as a server browser. Once a connection is established, you can easily send messages between connected clients with unity’s built in networking functions and components, like rpc’s, syncing networkviews, and its really simple.
If you were to use a middleware solution, you have to do all these things anyway, except you have to use their methods and code, and from what I’ve seen of the few I’ve played around with, they are way more complex than using Unity’s built-in stuff.
You might want to include Electroserver on your list. Aquiris, the folks that made the Boot Camp demo for Unity3 are using it to build an MMOFPS title.
legend411,
Most of the middleware options offer a pure client-server / dedicated server model which can be advantageous for certain types of games.
The built in Unity networking has an advantage of being able to operate without a dedicated central server, but this assumes you use the public MasterServer, which you would find is not recommended by Unity or many members of the community.
Photon would also fit into the list. I can’t compare it with others (as I don’t know enough about them) but you could possibly check out our customers. It’s flexible, inexpensive and powerful.
I suggest you play around with Leepo’s " Unity Networking Zero to Hero Guide" so you can see how ridiculously simple it is to build a fully functional multiplayer game in Unity without any middleware solution at all, before making your decision. It would take you a couple hours at most.
This is not how simple or difficult development is.
I already read that guide and I actually have client connectivity, movement and respawning done, but that’s not the point of the thread.
It’s just not clear to me what’s the purpose of these middleware solutions in a non mmo game, besides not using the public MasterServer for listing dedicated servers.
I dunno. Maybe provide API for ease of implementation of matchmaking, chat rooms, VoIP, decoupling of the netcode from the game logic, package size reduction, etc. Reducing networking dev costs in general.
Not entirely sure how far can you go with generic solutions for all this though, just things on top of my head.
Ultimately I think it depends on your game. Electroserver, for example, has native support for: users, user relationships ( buddy lists), security, zones, rooms, public and private messaging, etc. To the extent you want those types of features in your game, it might make sense to use it -vs- writing it yourself with the built in networking.
If you have the correct requirements, the built in networking might be a perfect fit.
More or less the same features in most of the middleware offerings in terms of what they include (zone, room, buddylist etc). All stuff you would have to code, debug and test yourself. Not impossible, but costs time.
What you do get is proven tech. When its good enough for Disney to run, its good enough for you as an indie. If you code something yourself (totally possible), then you are on your own. So you should also evaluate the community supporting it.
Its similar to the argument - why use a 3rd party physics lib? Or a 3rd party lightmap tool? Its down to time to market, and let someone else handle low level stuff for you. I dont personally gain anything from having written my own network solution (been there, done that). It didnt bring my game faster to market so I could earn money. Thus middleware makes sense
For one of my prototypes I’m currently looking into a dedicated ↔ master server structure which would enable me to offload the game network traffic from my servers to the dedicated servers. What turns me down with most of the network middleware software is the fact, that most often their target are MMOs.
I might be tempted to use them as a master server (including player DB for game stats) but then, as soon as the number of concurrent users increases, it get’s really expensive.
Also, using a 3rd party lib/server such as SFS or ES5, doesn’t really seem to copy with multiple connections with several other parties (ie. the dedicated server maintaining permanent connection with the master server to relay important in-game action such as the usage of user purchased items in the same time than all the clients keeping the a connection with the dedicated server).
Also, the licences often limit the number of concurrent users to 25. So imagine I want to have dedicated servers supporting 32+ players, I would need a licence per dedicated server, which, in my case, would be total overkill.
I’m not sure if I am following your definitions of ‘master’ and ‘dedicated’ servers, but it sounds like you want to have a single or small number of global servers that provide authority for certain types of information, then distribute software to your players that would allow them to host their own dedicated servers?
well… if you have played any recent games such as COD:Black Ops, you have a pretty good example of what I want:
A masterserver which requires a login and which holds player statistics (and additional information such as purchased items etc).
A dedicated game server/client structure which constantly communicates with the masterserver to inform the masterserver about important player updates (such as the usage of player purchased items, updates to the player important player statistics (leveling), etc).
The usage of dedicated game servers allows a better scalability of the games infrastructure. The dedicated server could either be hosted by myself on separate machines or by players (as it is commonly done right now by multiplayer FPS games where players can rent dedicated servers which they then can manage). If you take a look at the tools in Steam, there are a bunch of dedicated servers which you can install on your own machine and which, with a special security key, then can communicate with the master server to exchange important information.
I’m still pondering about a good masterserver/dedicated server/client structure, but currently a web service (as master server) seems to be the most appropriate way to do this (with the right security implementation on hand).
Currently, I cannot see how I could fit any of the current 3rd party network solution into my needs. The classic master server ↔ dedicated server ↔ client structure, which is used in almost all FPS multiplayer games, is just not taken into account by them. At least that’s my observation. But then, I might be wrong and I could just miss the way it could be done (in a cheap way) with 3rd party network libs.
Most networking solutions available are indeed target at many clients ↔ a few central servers hosted by you, they are neither targeted nor usable for “users host their own servers”.
For such a usage, you have basically only the option of unity networking unless you want to develop something yourself. If you happen to use standalone targeting for windows, you can also look at darknet
But if it also needs to support osx or the webplayer, then the integrated network or rolling your own system.net based solution on sockets is the only way to go, cause other things like lidgren don’t offer natpunchthrough and without that you can forget it right away as users without the possibility to add portforwards on the router are not able to host any game at all