question

Big Daddy avatar image
Big Daddy asked

A little confused about clients joining the game server instances.

I'm new to Playfab and have been reading docs to see if Playfab will be good for my multiplayer project. I want to under these 3 things clearly.

(1) If I'm hosting my server build on any non-Azure servers (For eg. Digital Ocean for this case), when the Playfab Matchmaking result is successful, how can I start the game server instance running on the Digital Ocean server and connect the players to it? Is it possible to do this with non-Azure servers? If possible, can someone explain me generally how to achieve this?

(2) If I'm hosting my game on Azure server, according to the docs, if I set ServerAllocationEnabled to true in config panel, the game instance will start automatically on the server right? How can I pass extra data (for eg. Player Rank, achievements) to the game instance running?

(3) How can I extend game backend service using Playfab? For eg. Playfab dont have player achievements system, how can I write my own player achievement system using Playfab?

sdksMatchmaking
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

·
Sarah Zhang avatar image
Sarah Zhang answered

>> how can I start the game server instance running on the Digital Ocean server and connect the players to it? Is it possible to do this with non-Azure servers? If possible, can someone explain me generally how to achieve this?

Because we don’t provide the network development framework for the server, the progress of connecting players to the Digital Ocean Server will be the same as how you do it without PlayFab. We provide some samples shown how to connect player to the server, you can navigate to the Github repo – GitHub - PlayFab/MpsSamples: Samples that show how to use PlayFab's Gameserver SDK for Multiplayer Servers to check more details of them. For clarification, if you don’t use PlayFab Multiplayer Server hosting service, the server instance won’t be allocated automatically when the match is generated. So, in this case, you need to allocate the server instances and sent the server IP address to players by your own. It should be a complex progress since you need to develop the allocator server by yourself. After you prepare the allocator server, you can disable the Client Matchmaking API, such as CreateMatchmakingTicket for title, and only call the Matchmaking API, such as CreateServerMatchmakingTicket on the server so that you can host the matchmaking logic to the server fully.

>> If I'm hosting my game on Azure server, according to the docs, if I set ServerAllocationEnabled to true in config panel, the game instance will start automatically on the server right? How can I pass extra data (for eg. Player Rank, achievements) to the game instance running?

Yes, if you follow the documentation -- Integrating with PlayFab Multiplayer Servers - PlayFab | Microsoft Docs to integrate the server with the matchmaking queue, the server instance will be allocated when the match is generated. If you want to retrieve the player data in the game server instance, you can call the Server API and Entity API in the server logic directly. For example, you can all the API GetPlayerStatistics to retrieve the ranking and score for the specific player, and you can call the API GetUserData, GetUserReadOnlyData, GetUserInternalData to get the player data you stored before. Please check this documentation – Quickstart Player Data - PlayFab | Microsoft Docs for more information about these types of player data.

>> How can I extend game backend service using Playfab? For eg. Playfab dont have player achievements system, how can I write my own player achievement system using Playfab?

You can store the achievement for players as the K/V pair of the player read-only data, then players can access these data after they log in themselves. You can check the documentation -- How to set read-only player data - PlayFab | Microsoft Docs for more information about the read-only player data. You can choose the type of the player data according to the specific application scenarios.

If you have any other detailed technical questions about to how to certain some one feature, please flee free to let us know. We suggest you post the separate threads for every question.

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.

Big Daddy avatar image Big Daddy commented ·

Thank you very much for answering my questions.

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.