question

joehot200 avatar image
joehot200 asked

How best would I convert my master-client-controlled game to a custom game server?

Hello,

I have got a game with PlayFab & Photon which currently has no PlayFab (or Photon) scripts or server-side code.

At the moment, the entirety of my multiplayer game is controlled by the master client. The master client controls the AI tanks and turrets, and controls all damage taken, as well as bullets, etc.

Basically, the master client is the same as a server.
As for the reason for this design choice, it is because Unity Networking, Unlike PlayFab+Photon, allowed me to upload a "master client" as a custom game server.

As PlayFab+Photon does not allow a client to be uploaded to the server, I need to convert this to a custom game server.

What would be the most efficient way of converting my master-client-controlled game into a server-controlled game?

Custom Game Servers
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

I'd take our example server (https://github.com/PlayFab/PlayFabGameServer), which is also a Unity project, and port your game server logic from your "master client" to it. What you need is a server that waits for players to joins, then hosts the authoritative state of the game world.

However, I'm not clear on what you mean concerning "PlayFab+Photon does not allow a client to be uploaded to the server". Photon would have nothing to do with the solution in this case, since you want to have server authority. Photon Realtime does not provide server authority - it's for connecting players in a Room (so that all network connections are simple) and exchanging data. You would need to use a custom game server, to accomplish what you're describing (https://api.playfab.com/docs/tutorials/landing-tournaments/custom-game-servers).

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

joehot200 avatar image joehot200 commented ·

I've downloaded the example server, but I don't really see how best to convert my game into a custom game server. I'll probably have to give it some dedicated time, later down the line.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.