question

tkovalchuk avatar image
tkovalchuk asked

Direct Challenges,Direct Challenges (via FB)

Hello PlayFab,

We are already using the PlayFab for your back-end to store data in our game and got request for another features. I didn't find it in documentation, so maybe you can help me here.

  1. We need to have a possibility in game to select one of our FB friends (who have same game installed) and issue him challenge for a generated level of the game. After we both complete it, our scores are compared and winner is selected. The other player could be offline at the moment, so we will probably combine this with push notifications.
  2. More advanced version will utilize the 1 vs 1 multiplayer that we already have, but with random matchmaking. In this case we will also challenge our friend, and wait for him to come back into game (or he already can be there). After that, we will play online-realtime match between each other.

Please let me know what is possible with current API.

Thanks,

,

Hello PlayFab,

We are currently using your back-end for one of our multiplayer games and we got request for new features.

We would like to implement direct challenge of the other player, possibly using FB. We will need to find a friend in list of FB friends that have our game installed and issue a challenge request for them. There could be a generated code to make sure that both we and challenged player will play same level and after that our scores will be compared. Is there any mechanism that will allow us to do that?

Further more, as we have random matchmaking and 1 vs 1 multiplayer battles, we would like to have another type of challenge, where other player (either FB or in-game friend), will be notified about issues request. That player will come back into game(if he is not already there) and play real-time multiplayer match between us.

Please let us know what is possible to implement with PlayFab and how.

Thanks,

MatchmakingCustom 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.

brendan avatar image
brendan answered

Yes, this is actually easy to do in our current system. For 1, you can always get the list of your Facebook friends who are playing the game using GetFriendsList. When you issue the challenge, do so via Cloud Script, so that you can store the unique info on the generated level in User Read Only Data or Shared Group Data. In addition to using Push Notifications, I would recommend using the Cloud Script to also post information to the other player about the challenge, in case the user turned off Push Notifications (again, in some form of User Data or Shared Group Data).

For matchmaking, you could issue challenges to other players based upon proximity to your own score in the leaderboard as well, but when looking for players who are online right now, I would recommend using Photon. Have a look at this thread for some recommendations on how to do that, as well as some thoughts on saving game challenges and state info in Shared Group Data: https://community.playfab.com/questions/515/207129407-Persistent-turn-based-games-.html

10 |1200

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

tkovalchuk avatar image
tkovalchuk answered

Hi Bernard, thank you for the answer!

I have checked the material you have provided. Please correct me, but as I understand the concept of SharedGroupData, to use it, we need to constantly poll it from back-end? Is that ok with your system, or there is any other way except the Push Notifications to notify another user that challenge is waiting for him?

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.

brendan avatar image brendan ♦♦ commented ·

A periodic poll of a users own Shared Group Data (so, checking one specific Shared Group Data every minute or so) won't be a problem. You can also use Push Notifications, but do bear in mind that players can turn that off at the device level - something your client code will have no way to detect.

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]