Probably really nooby question


I do apologise if this is a really dumb question...

I am using Unity for a project, and am now at the point where I need a server. I've spent a couple of days reading through all of the different servers' pros and cons; and it looks like Photon most suits my needs.

I really don't want to use a specialised Unity client as a Master Client, preferring to use a server that can stand alone, in a semi authoritative fashion. Using Photon, do I:-

1. Have to use a Master Client?
2. Happily add server-side code (hopefully in c#), to do all the things I want, recompiling the server every time?
3. Use the Unity Networking Plugin to help client-side, or is it not helpful if I'm not using a Master Client?
4. I'm presuming (possibly wrongly), that the server automatically keeps track of client connections, and keeps lists of game objects?

Again, I apologise if any or all of these questions are dumb, it's been a long day of surfing and reading about server possibilities.


  • I'll do my best, but I've only been working with PhotonCloud for a few months, so I'm still a bit noobish:

    1. The idea of a Master Client in PC isn't as "rigid" as it can seem in Unity Networking. Since everything is in the cloud, there is no "server" player with the rest being clients, but the first player to create a room becomes a master client. If he leaves, it automatically sets another player to the master client. This has its uses, like choosing teams (something you'd want one player to do the logic for then RPC to the others), but it doesn't mean you NEED to do anything with the master client. It's extremely flexible.

    2. You get all the PC code with the Unity download, so as long as you understand what's happening (props to you), it's well within your limits to make adjusts to their background code.

    3. I wouldn't bother using Unity Networking with PC, just stick to all PC code, it's faster, easier, and more efficient.

    4. You presume mostly correct, the server hosting your connection keeps track of all rooms, and all players connected. Each player has a unique identifier that can be accessed from their PhotonView (the PhotonPlayer class), and anything with a PhotonView on it is kept track of by the server with the same basic syncing options you see offered from Unity. As far as a list goes, I'm not 100% sure on that one. I'd assume there's a way to find all objects with PhotonViews and you could access them via that, but I've never had a reason to do that, so I couldn't tell you.

    Any other questions, I'll do my best to help!
  • Thanks Befall! Good answers.
    Little additions:

    2. The Photon Cloud currently does not run any custom code. You can modify and run your own servers easily by using the Server SDK.
    4. It keeps track of connections and such but the server's tracking of Game Objects is limited. It just caches the events necessary for Instantiates and removed those when the GO gets destroyed. It won't track position or something like that.