I’m new to Unity and have been doing a lot of tutorials and then came to great confusion regarding networking. I read a lot of posts until now but my mind is a bit mixed up.
I’ll try to explain what I understood of it globally and if someone could help me would be really appreciated.
Ok, so my goal is to make a minimal and simple FPS with networking. I plan on using an authoritative approach and having Reliable Delta Compressed for the player movement. The rest I would use RPC’s for the rest.
Then I think there’s where those external servers come in. So if I want to search for available games (6 to 10 players max p/g) I would connect to one of this external servers and check a list (like Counter Strike and others), connect to a game and this server would basically route the information between different games running on that machine and its clients. Right? And if so, is one computer as a server enough for a few multiplayer games simultaneously?
Hope I explained myself clearly and thanks for the time!
One computer potentially can host a few games yeah, depends a bit on the number of players and stuff going on, at worst you end with 1 server per processor core on your server with too much collision and physics.
But you need Unity Pro to even do that, and you must start the servers through a small starter application so you can change their processor affinity, otherwise they will all lock themself to core / processor 0 and then you can bet that it won’t work out with multiple servers reasonably well.
Photon etc are for massive backends with hundreds of players etc where scaling over more cores etc is required, something unity won’t scale well too and multicore usage isn’t a topic at all as unity only uses a single core basically
As deamora says - want to scale? Use dedicated middleware that has minimal overhead + technology like Terracotta and similar that can run the same game across multiple servers.
Want to play around on small tests on a single box - use Unity networking
Offerings like Electroserver, Smartfox and Photon are fundamentally different than the built in networking in the sense that they are designed to be client-server solutions. The built in networking is generally a peer-to-peer style arrangement. Each approach has advantages and disadvantages. For example a LAN only game where there is little or no persistent state might be a candidate for Unity networking. If you want to have internet gameplay, or persistence or server authoritative state are important, you might want to look at dedicated servers.
I’d say another general distinction is that the Unity networking is generally more ‘low level’ when compared to some of the dedicated solutions. For example, if you take a peek at the Electroserver 5 documentation you can see that it has native support for things like users, zones, rooms, chat, etc. If you need some or all of those features, you might save a lot of time and frustration not writing it yourself.
After a bit of looking around and some mounting frustration, I settled on Photon for my networking. It’s massively scalable, now allows server-to-server connections (a big step toward clustering / load balancing), and is ultra tweakable. For you, it has great built in (basically, they are samples) features for logging in to “rooms” and from there finding and joining/starting individual games.
You can use it to do peer-served or authoritative-server scenarios. I’m only just starting to get into the nuts and bolts of it but so far so good: great samples, extremely easy setup, just a few minutes to get the server installed and running. Best of all, you don’t have to pay for it unless/until your game gets so popular that there are more than 50 connections at a time, or you make a certain amount of cash. There are tons of people on their forums who, like I have, saw that Unity is a superior client-side platform to XNA, Silverlight, or Flash, and many threads talk about just what you are asking. Photon is .NET/C# compatible so you can use it with MS developer tools, MS OSs, MS SQL-Server databases, etc. with no problems (but you don’t need an actual server to run Photon server). I think the MS developer tools are strong for what I need on the server side, but they were not so great for the client side and I quickly moved over to Unity.
My view on all this is all about your skillset. I believe it wise to let outside companies with solutions like SFS etc deal with the middleware tech, so you an your team can purely concentrate on getting the game/app done. One less thing to worry about, and if you go commercial, you have a company that will support your server solution.
You can use the free license independent from how much cash you are making and there is even a free license for 100ccu (also no matter how much cash you make), the 50ccu one is free to download for every one, while the 100ccu one is free, too, but only avaiable as customized version working only on your server.
You do not need server hardware while in development, correct (easiest is to just use localhost or IPs in you internal network for development), but I would recommend to use it, when going live, although if dependent of your game and the CPU/RAM-load, which your server-side game-logic is producing, the low end price-area would do well.The reason for that is, that you will have to run your hardware 24/7 to use it as a live server. Windows server is better for that kinf of use than Desktop Versions of Windows.
Aside from that, nice post