Where do Server specific network events run?

Options
Quadgnim
edited January 2013 in Photon Server
Hi all. I'm new to Photon and trying to get my arms around it. In unity when writing networking code usually one of the clients also becomes the game client. Usually we have a Master Game Server (MGS) which handles the match making services, then the client based Game Server (GS) handles in game message routing, and once you're in game you no longer communicate to the MGS. All network traffic between clients go through the GS when you're in game. There are certain events such as PlayerConnectedEvent, PlayerDisconnectedEvent, or a direct message to the GS to have it perform some specific action. Where does this run with Photon? Does one of the clients (the one creating the room perhaps) take on the role of GS? If so, does this client also perform all packet routing between clients, or does the Photon Engine or Photon Cloud do all the routing? I'm assuming the latter where clients connect to the MGS and it handles both the match making lobby and also handles the network packet shipping between all clients?

Is this the right understanding of it all or am I missing anything?

One more question. I think I heard that you can have multiple game servers running. At some point I will be looking to divide the players based on internal game dynamics (ie: maybe different levels) run on different Photon servers to provide greater scalability for a game so instead of one server handling 1000 connections I could have 10 servers handling 100 connections each (for example). I want to confirm I could do this with Photon and then assuming yes, can I also have in game clients send message to other clients that are running on a different server, or at least the master client (the one that created the room)?

Thanks

Comments

  • Tobias
    Options
    Unlike Unity's networking, all clients connect to a dedicated server that's non-Unity (doesn't know the scene, physics, etc). So there is no "random" host.
    The host from Unity is best matched with the Master Client. But it's not directly connected to the other clients and it's "elected" per room and it can change.
    You can target RPCs to the Master Client and the other clients won't notice.

    Unity's master server is best matched by the "lobby" on the master server. The actual gameplay that Unity does on some host is replaced by a Photon Game Server, which runs the actual rooms (games).

    With the LoadBalancing server logic, you can run any number of Game Servers per Master Server. Only the Master knows all existing rooms and can divert the players. Usually we do that by name or random matchmaking. Rooms are distributed across game servers, depending on their current load. You could modify this to do something else.
    So, yes, you can run more servers with less load.

    We don't support room-to-room messages out of the box but it's a possible feature.