- Home /
Create a custom network manager?
Hi,
I'm starting to use Unet to make a multiplayer game. It seems that if the game is hosted on a server, not a client there is a limit of 20 ccu with the free services of unity. My question is : if I create my own network manager and still use unet, could I bypass this 20 ccu limit?
And if so, do you have any advices / recent tutorials on how to make it? I found a lot of things that seems out of date.
Thanks!
it is out of Date. I talked to the network $$anonymous$$m at Unite Berlin and they said they're working on a new network solution
Answer by Bunny83 · Jul 22, 2018 at 10:02 AM
You seem to confuse several things here. First of all the NetworkManager is just a convenient class that ties up the serveral different parts. Next thing is the CCU limit is only a development limit that is tied to your Unity editor license. It's meant for testing during development. When you're game is ready to be published you would "go live" and would have to pay for the used traffic seperately but have no limit on the number of players.
Note that the CCU as well as the traffic you have to pay for only accounts traffic going through one of the services Unity provides. That is the Match Making service (lobby system, etc) as well as the Relay server service which ensures connectivity for prople behind NAT routers. You can use UNet without those services as long as you make sure your players can connect to each other. That means they either have to forward a port in their router in order for others to connect or you have to provide some kind of relay service yourself. The pure network system of UNet doesn't have any limitation.
So for example if you have played older games it was common to only have direct connections where the server has to ensure he is reachable by other players and the other clients have to directly connect to the IP / port of the server.
Most of this information you can find here, though not as clear as we would like. If you scroll down to where they distinguish between personal, plus and pro just scroll down a bit further. When you release a serious game and you want to use the services that Unity provides it was never meant that you use the CCUs you have included in your Unity license.
Keep in mind that any traffic through the internet costs money. Unity has to pay for any traffic that goes through their servers. That's why when you go live you simply have to pay for the traffic that your game produces on their servers. Note that flat rates basically do not exist in the business area. Flat rates work like an insurance as they expect the majority of the users to only use a tiny fraction of what they pay for.
@Bunny83 Thanks for your answer. Some things are not quite clear for me yet (I'm sorry, hard for me to understand).
In the link you provide There is an estimation of the cost depending on the game you have. But for each offer there is a ccu limit between 500 and 5000. That seems quite low for a game, is this normal? And with this offer you would have servers to host games right?
Plus the costs seems expensive. $$anonymous$$y situation is that I have a little amateur multiplayer game made for fun with unity / unet (based on this tutorial). Now I would like to "go live" as you said, so players could download and try my game, give me some feedbacks... But I did not want to spend like 150€ a month just for feedbacks on a little amateur game (cost in the 1st link for a fps). Do you have any advices on how I could do it without paying a lot of money or creating my own server? I wonder how others indies would do that.
Sorry but you did not understand what i said at all ^^. Please re-read my first paragraph:
Next thing is the CCU limit is only a development limit that is tied to your Unity editor license. It's meant for testing during development. When you're game is ready to be published you would "go live" and would have to pay for the used traffic seperately but have no limit on the number of players
The estimate on the site is only a rough estimate and i wouldn't pay too much attention to it. Also as i said if your players manage to establish direct connections you will not produce any traffic on Unity's servers at all. You may have a tiny amount if you use the matchmaking service. Where you may produce a lot traffic is when you have to use the relay server as the whole game traffic would go through the relay server of Unity.
However again you don't have to use the matchmaking service or relay service at all in order to use UNet. Just like $$anonymous$$ecraft for example. If you setup a server locally on your PC you can simply add a port forward rule in you router to make your server available from the internet. Other players can enter your public IP address and directly connect to that server. There's no limit on the player count and no additional cost as long as your connection can handle it.
However if you want to use the matchmaking service there are two ways you can use it:
First is using the CCU limit that your Unity editor license has built in. That allows 20 users to use Unity's matchmaking and relay service without any further cost. But as i said this is meant for development. During development you just have a CCU limit of 20 / 50 / 200 but no bandwidth limit so you can actually develop your networking and doing tests / measurements, etc.
Second is when the game is ready to be published you may want to "go live". At this point there is no CCU limit anymore but ins$$anonymous$$d you have to pay for the traffic you generate when your game uses Unity's services.
Again, if you don't want to use the services, don't use them. If you want to use them, either live with the CCU limit or pay for the traffic.
I can't explain it any more in detail. I've never actually gone live with any game / product so i can only relay what i read / understand from the documentation. If you have further questions you may contact Unity directly. Note that the traffic cost is not that expensive. 50 cents per GB
If you want more control over your cost, you would need to host your own servers to ensure connectivity and matchmaking. If you develop a game that is free to play i would strongly recommend to not use Unity's matchmaking unless you are that generous and want to finance it for all those players.
Answer by Tritize · Jul 23, 2018 at 03:27 PM
@Bunny83 Ok! I'm sorry I'm doing my best to understand but english is not my native language and networking is new for me, I swear I'm really trying ^^
I think I get what you meant and yeah, for a little free-to-play I will try to avoid using the matchmaking. I did research and found this that seems to be what I'm looking for, to avoid unity matchmaking :)
But if I understood what you said, this is a solution where the game is hosted on a player's computer, and this plugin can be use to avoid the use of unity's services. I can do the job for my little game I think, but out of curiosity if I wanted the game to be hosted on a server (so that if the host disconnect it won't end the game), what would I need to have to perform this?
Thank you very much for your time
Answer by Strixie13 · Jul 23, 2018 at 03:28 PM
Changing the network manager will not increase the CCU. Generally, that free 20 limit is just to test the initial features between developers and maybe a few friends. Any kind of live game with an actual player base would require you to rent a server. Unity basically just sees how many people are connected to the project and limits it, regardless of your code.
As far as hosting options, Unity builds just need a 'computer' to run on. It doesn't have to be from Unity specifically. For example Google, Amazon, and Microsoft all have virtual cloud hosting that gives you a unique IP address, hard drive, processor, etc. Virtual servers are the cheapest solution, since you are only using a small portion of a physical server. Never done it with the High level stuff, only base transport layer code.
You can also just run a UNET server from your home PC. I do this all the time for testing over LAN, lets you hook up different computers and test it without needing data plans. While you can also open that up to the public, its generally a bad idea to do on your own stuff.
If the game ever really took off you would want to look at renting an entire physical server. Of course, super pricey.
The cheapest and most efficient option is usually to get a headless Linux server. That way you aren't paying for an operating system license. Companies like Digital Ocean (my favorite) let you rent out a server for 5$ per month. Keep in mind you'll need some kind of headless Unity project file that doesn't need a user interface, and it requires some knowledge of setting up Linux from the command line.