question

dan avatar image
dan asked

How might I create invitations to a turn-based multiplayer game?

Hi.

I think I nearly have everything worked out for my turn-based multiplayer flow!

My current vexation is as follows.

I am trying to emulate the Game Center multplayer flow.

I want players to invite friends to join a multiplayer game.

  • Let's say the first player invites 3 friends to play, and makes the first move of the game, creating a room in Photon.
  • He then leaves the room because none of his friends are online.
  • This new room won't appear in his friends room list, because they haven't joined it yet.

No, I can notify the friends with a push message... but that isn't terribly robust. My solution is to send the friends an inventory item that equates to a game invite (with the room ID in the annotation).

That way I can check their inventory for invites on start-up.

Is this a good idea, or just plain crazy?

Thanks,
Dan

photonPlayer Inventory
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

An inventory item grant via Cloud Script is a creative way to do this, though it could result in filling up a player's inventory with items, which could then be a problem for you is you have in-app purchases. Another way to do this would be by writing the details of the invitation to that player's data directly. We will be providing a general-purpose message system in a future update, but for now those would be good ways to solve for this. The limitations to bear in mind are the total amount of data (inventory items or key/value pairs) is limited, so you need to make sure to clean it up as it is used, and focus the game mechanic on this around setting up games with either random players or friends - if, for example, everyone can challenge the #1 player on the leaderboard, that player's account will get filled up with requests from random players, which could be problematic.

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.