question

Amar avatar image
Amar asked

Multiplayer game with a Lobby, Tournament and lobby system, using just the (TitleData & PlayerData) and NO Multiplayer GameServer?

@Sarah Zhang @Brendan

We are building a gamified mobile App that will be running both on Android and iOS, and is using PlayFab for anonymous authentication based on deviceID. IN the app, we have a simple game that few of the users will be choose to play and will be join a lobby when they choose to pick a game that is waiting in a queue..


It is a tournament style game play, where the winner from each round is sent to the next round, where three more players join the game and the entire game has "n" rounds with four players each in a round , with a maximum length of 15 seconds for the game .. the goal of the game is to guess an answer from multiple options by rearranging few options in a round.

While 4 people are playing the a game from the queue, remaining people are waiting in the lobby. Is this something we can implement without a game server like (Photon or Multiplayer V2 from PlayFab).

We are planning to use Titledata, to seep the state of the current game, and the players in the game, and also a list of all the game that are waiting in a queue. As the games progress the title data will be updated, along with the PlayerData.. and the entire game logic is written in CloudScript..

The question, is this a viable soultion? Can we use TitleData to read and write, from multiple games that are being played. Does this approach scale, or will be run into some kind of inconsistency issues where multiple players and game fight to read and write to the TitleData at the same time?

Is this an approach to have a simple lobby system, or should be look into having a seprate game server that runs the games and manages the lobby, and players joining a game in a tournament system?

Player DataTitle DataMatchmaking
10 |1200

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

Sarah Zhang avatar image
Sarah Zhang answered

Firstly, as this thread -- https://community.playfab.com/questions/24571/should-i-have-to-use-photonunet-or-something-else.html says. The question that whether you need dedicated sever to multiplayer matches, or if you can just use Cloud Script. It comes down to whether your games follow a synchronous or asynchronous multiplayer model. We can find such description about the differences between them, “synchronous multiplayer is when both players have to be connected at the same time to be able to play together; and asynchronous multiplayer is when player actions are stored somewhere in a database and other players can see those actions sometime later.” According to your description, the game is more like the synchronous game, because the game has a time limit -- 15s. Please correct me if I misunderstand. If what I understand is right. We would suggest you use PlayFab Multiplayer.

>> The question, is this a viable soultion? Can we use TitleData to read and write, from multiple games that are being played. Does this approach scale, or will be run into some kind of inconsistency issues where multiple players and game fight to read and write to the TitleData at the same time?

No matter it’s a synchronous model or asynchronous multiplayer model. We would both not suggest using TitleData to store the state of the current game. As this thread says -- https://community.playfab.com/questions/10445/using-titledata-for-world-stats.html, TitleData should never be written to as a result of a player action, as it is a sharded and cached resource. If you have a TitleData key with some data in it, when you update the value for that key, there's a short period while that data is updated in all the shards. During that period, queries to the data may get either the old or new values, depending on the shard the caller hits. Also, attempting to write to Title Data too frequently will simply fail.

[Edited] For the synchronous game, you can cache the data in the server directly. [Whether using Server or Client APIs, we do not recommend using TitleData in such game models. Please avoid using any player-generated action to trigger the update of TitleData. For example, if you have multiple sessions running with different players, that’s going to cause serious issues. In general, the only time TitleData should be used is for global static data that is updated by the developer. It would be better to use an Entity Group for the session and save the data to an Entity Object (assuming it’s a small amount of data) or an Entity File.]

>> Is this an approach to have a simple lobby system, or should be look into having a seprate game server that runs the games and manages the lobby, and players joining a game in a tournament system?

PlayFab has provided a Matchmaking feature that can integrate with MutiplayerServer directly. Please check the docs for more details.

In addition, PlayFab Multiplayer Server is designed to provide the server sessions, we suggest controlling the running time of a session to one hour. So PlayFab Multiplayer Server is more suitable for the game server, but not suitable for a persistent server, may not suitable for the lobby server. So you may need to host a lobby system on the separate server. PlayFab provides the multiple multiplayer and matchmaking APIs that you use in the clients and lobby server. Some of them can be used for management.

Besides, there are many threads discussed the multiplayer games in the forum. Please feel free to search for them in your need.

2 comments
10 |1200

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

Amar avatar image Amar commented ·

Thaknk you.. Questions regarding the PlayFab multiplayer. Our clients are not Unity based, they are written in Swift for iOS and Kotlin for Android. Does the client SDK for the PlayFab has all the required calls for PlatFab multiplayer, including Party, Guilds, Entity Models, Shared Data etc..

What networking protocol is used for PlayFab Multiplayer, it is TCP/UDP.. Because the regular PlayFab is all REST based https calls..


Because have two code based, one in Swift and one in Kotlin. I am a little worried about the fact that there is no official SDK;s from playfab for Swift and Kotlin. I have see the one in Obj-C and Java for Android. If you have a different place to look at please let us know.

Is there an alternative to Photon Cloud from PlayFab Multiplayer? On Photon Cloud, all you have to do is have a client SDK and all the scaling around rooms, lobby are automatically taken care of. But with PlayFab Multiplayer, it looks like you have to do a lot around GSDK, ServerBuild, upload the build, VM, Docker container.. etc. What is the most simple managed version PlayFab which is a simple non-authoritative P2P networking?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Amar commented ·

>> Does the client SDK for the PlayFab has all the required calls for PlatFab multiplayer, including Party, Guilds, Entity Models, Shared Data etc.

The latest SDK should be synchronized with API updates, they should include the above features.

>> I am a little worried about the fact that there is no official SDK;s from playfab for Swift and Kotlin.

Yes, there is no Swift and Kotlin official SDK now. You can consider generate them using our SDK generator.

>> What networking protocol is used for PlayFab Multiplayer, it is TCP/UDP.. Because the regular PlayFab is all REST based https calls.

Due to PlayFab Multiplayer Server is a server hosting service, title developers should write the game server logic on their own. It supports TCP/UDP, you can use socket connection in the server.

>> Is there an alternative to Photon Cloud from PlayFab Multiplayer? ...

It is not an alternative. PlayFab Multiplayer Server is a server hosting service, so title developers should develop the server on their own, or you can refer to our official sample -- https://github.com/PlayFab/gsdkSamples and https://github.com/PlayFab/gsdk. It's also not designed for P2P.

0 Likes 0 ·
Amar avatar image
Amar answered

This is a test 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.

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.