Built-in Multiplayer in Unity3D without a Server?

2019-02-09 21:40发布

问题:

I heard Unity3D has a Built-In Multiplayer functionality and it can provide the service without a server. But I couldn't find any information about it, all the turtorials I found were just about working with Photon(PUD) or Google Services. I know Photon is good, so I just started to study it and have a plan to use it.

However I still want to write some very simple apps not using servers, something like One VS One Rock Paper Scissors game. Using Photon must be better on performance but in some cases like I said above, it seems to be too much. In addition, CCU of PUD for free users is just twenty, so it means only ten groups can play at the same time, Rock Paper Scissors game, for instance.

I saw some said it's possible without a server, but some other said impossible.

What is right?

回答1:

You're completely right, new Unity Networking allows you to create kind of P2P multiplayer where one client is server. Documentation can be found here: http://docs.unity3d.com/Manual/UNetOverview.html

In the unity networking system, games have a Server and multiple Clients. When there is no dedicated server, one of the clients plays the role of the server - we call this client the “host”.

There is also awesome presentation about it, where Lucas Meijer changes single player game in multiplayer couple of minutes during Unite 2015: https://www.youtube.com/watch?v=tUEreuxmBj0