question

Dylan Hunt avatar image
Dylan Hunt asked

What is the most current, best way to invite a friend to your game? Simply pass a string

We've been using Steam to invite people to games, but it's REALLY limited:

  1. We can't even interact with people unless they are on your Steam friends
  2. We can't release to other platforms because we're bound to Steam funcs
  3. We can't even programatically send Steam friend requests, so you have to manually add friends when their Steam id may be different from their PF name. It's just horror.
  4. Adding friends via PlayFab is pointless since we can only interact with Steam friends.

Here's are the issues:

  • PlayFab is data, Photon is realtime. If you something is too data-ish, PlayFab will do the job over Photon. If it's too "instant/now", Photon will handle it due to its realtime nature. However, in this case, none seem to offer a practical solution when asked several months ago (that's when we chose Steam) -- i'm now revisiting this to find a better option.
  • When asked about inviting friends to a game, both PF and Photon say we can't do it unless we do something hacky and time-consuming.
  • Photon will recommend their chat system for $$/mo more than what we're already paying for Photon, which is depressing. However, they're realtime! So there are always workarounds - but again, back to hacky/weird implementations.

Can anyone suggest what the "current best way" to handle this is in Unity? involving Photon + PUN without getting into 3rd parties? Between these two, I feel that there's something I'm missing -- it seems so basic/standard to me, but it's giving me the biggest headache lol.

photondata
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

Ultimately, you're wondering about how to invite a friend into a realtime game, is that correct?

The fact that you cannot interact with folks if they're not Steam friends seems to be orthogonal to the question, as the issue is around getting the request to a friend, regardless of how that friend relationship is formed. You have Steam friends, Facebook friends, and PlayFab friends/followers in our system.

If you want to have a realtime messaging system, then yes, I would agree with Exit Games that you likely want to use Photon Chat, so that you can get invites to players immediately. We will be providing a generic messaging service in future, but right now the PlayFab-specific implementation would be to write something to the other player's User Data space, to let them know about the invite.

Could you clarify what the "hacky and time-consuming" recommendation you heard about?

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.

Dylan Hunt avatar image Dylan Hunt commented ·

The Steam mentions were directly related to a previous post asking this a while back when someone asked how to implement an "invite a friend to a game" approach. We can use the UpdateSharedData, poll for it every few mins and awkwardly wait 2-3 minutes for your friend to actually join after accepting the invite -- then delete the message. This will look like our game is laggy and buggy, since PF polling is limited. Ultimately, it gets the job done, but at the heavy cost of super awkward waiting times to receive the invite.

When asked to Photon, "Get Photon chat for +$45/mo per 100CCU) or something about that price. We already have chat -- we just need a simple invite solution and it seems crazy that the only solution between PF+Photon is polling PF every 2-3 minutes to find shared data. Photon also offers LLAPI as hacky alternative, but it's not friendly.

Photon has realtime. Surely there's a way to send a string to someone in lobby. The hacky alt. is to have ONE GIANT room and rpc your friend the room invite info to leave/join new room.

0 Likes 0 ·
brendan avatar image brendan Dylan Hunt commented ·

We partnered with Exit Games, to provide an integration with Photon Cloud, as one of our first marketplace partners specifically because PlayFab does not provide a realtime room type of system outside hosted game servers. Bear in mind that our service is Web API based, and so does not have an open socket connection to the client.

I'm sure that further down the road, we'll provide functionality along those lines. But for now, the solutions you describe would be the recommended way to accomplish this sort of invitation system. And to clarify for others, the Shared Group Data method is that you would be writing the invitation into a Shared Group that is "assigned" to the player being invited (or just use that player's UserReadOnlyData, which is even easier). Shared Group Data is, like player data, not a sharded or cached resource - it's not possible to use a single Shared Group across all players in your game.

1 Like 1 ·

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.