question

denischrist avatar image
denischrist asked

Difference to Photon

Hello,

We've just started an Unity Multiplayer project and after some research we found playfab/Photon/Unity Multiplayer. We want to try it out. What i get so far:

PUN is some sort of Better unity Multiplayer?

What i dont quite understand: What is the difference between PUN and Playfab?
It seams that i can use both (photon and playfab?) or only one of them?

There is the "merry Frapmas" Tutorial for Unity, they use Photon, can i just substitute Photon with Playfab, or is playfab some sort of layer over pun?

Thanks in Advance!

Partner Add-ons
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.

Larry T McBride avatar image Larry T McBride commented ·

Greetings,

We have a similar question. We have our beta multiplayer and chat working with the free version of Photon for Unity but we wanted to upgrade when needed. We also need to save user profile and data so that brought us to Playfab. I read else where that we will need both SDKs for Unity. So I guess PUN is separate from Playfab in that the intergrated Photon doesn’t work with Unity?

Another question is does Playfab’s monthly subscriptions cover the costs of Photon’s paid services, like chat? Or is that all setup separately?

0 Likes 0 ·
brendan avatar image brendan Larry T McBride commented ·

While we integrate what we can into our backend for add-ons (such as Kochava, where we eliminate the need for an additional SDK), there are cases where you still need to have the SDK for the other service, as with Photon. Our Photon guide (https://api.playfab.com/docs/tutorials/landing-tournaments/photon-unity) is the best place to start with getting set up.

So yes, it does require having the Photon SDK in your project. And no, services in the add-ons marketplace are not paid for as part of our pricing tiers - they are distinct services that we do not manage, nor do we control their pricing. In the case of Photon, you're actually using your own Photon account, which you create in their site.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

Well first, PUN is Photon Unity Networking (https://www.photonengine.com/en/PUN), which is a product from Exit Games, and which provides a simple way to connect players for multiplayer games.

PlayFab is a suite of cloud-based functionality for games including authentication, data systems, purchasing integration, catalog/inventory, and automated live ops. You can see more about our features here: https://playfab.com/features/.

PlayFab is integrated with their Photon Realtime (https://www.photonengine.com/en/Realtime) and Photon Chat (https://www.photonengine.com/en/Chat), to provide simple authentication and webhook calls into Cloud Script. So yes, you can absolutely use both together - that's actually a common use case. And if you don't need the webhook callbacks into Cloud Script, you could use PUN as well. There's no particular integration with PUN, but there's nothing that would prevent the two from being used together.

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

denischrist avatar image denischrist commented ·

Hello Brendan, Thanks for the reply!

So for example:

i use photon Realtime with photon Cloud WITHIN my playfab account? And Matchmaking etc. from Playfab.


That sounds great! I like the GameManager functionality!

0 Likes 0 ·
brendan avatar image brendan denischrist commented ·

It would work like this: You'd use PlayFab for all the accounts, data, etc., and you would use Photon Realtime, logging into it with the token you get from our service, to create Lobbies/Rooms in Photon Cloud, search on them (matchmaking), join them, etc. When you perform those Room actions (join, leave, etc.), a webhook callback can run custom logic you have in Cloud Script in PlayFab.

The PlayFab matchmaker is for when you want to have custom game servers - either hosted by us or elsewhere - for your game logic.

0 Likes 0 ·
denischrist avatar image denischrist brendan commented ·

Ok, understod. But: there is no need to use photon, right? I could do everything (create Rooms, joining, etc) with playfab alone.
If i start completely new, why woul i use photon at all (Excpot because the tutorials use it?), is there any advantage?

0 Likes 0 ·
Show more comments
terrypapamarkou avatar image terrypapamarkou commented ·

We are using Playfab to handle all our user and game data, and photon to handle the realtime multiplayer games. I'm really struggling to get my head around why I would want to go to the trouble of getting playfab and photon talking to each other, when I already have matchmaking etc working with photon on its own.

Can you please provide some examples of what is commonly done on the playfab side when a photon room event is triggered?

Is there a way to use playfab as the authoritative data source, so the peers send messages like "move unit x to point y" to playfab, which then verifies they are valid moves and sends a message to connected peers to complete the action? Or is that something that is better handled by photon with a dedicated server?

Thanks

0 Likes 0 ·
brendan avatar image brendan terrypapamarkou commented ·

The most common use case is to save the data from the room in PlayFab when the last player leaves, so that you can restore that state the next time you need to. PlayFab should be the authoritative source for info about your players, but it's not something you can query and update at high frequency. So for a realtime game, you would need to use something that can store state information for use in high frequency exchanges with the connected clients. That would then update the longer-term store in PlayFab either at the end of the session or periodically (every few minutes) throughout.

1 Like 1 ·
terrypapamarkou avatar image terrypapamarkou brendan commented ·

thanks again Brendan

0 Likes 0 ·
Haris Sevinc avatar image Haris Sevinc commented ·

Hi, this question confused me too. So what is the point on your multiplayer service then?

0 Likes 0 ·
brendan avatar image brendan Haris Sevinc commented ·

Depends what you mean. For multiplayer services, we have:

1. Custom game server hosting - your server executable, running containerized on servers in whatever regions you choose.

2. Matchmaker - flexible system to match players according to rules you define, with the ability to relax match requirements if the player is waiting too long. Can launch our hosted servers (above), but you can use it with your own, or with Party (below).

3. Party - a relay service where you can connect players to a "room" and then all packet exchange is relayed through our service. This is the most similar to Photon, except a) Photon provides state info you can save in the room and query, and b) our Party service can also provide you with Chat, including translation and transcription services (so that you can be CVAA compliant).

2 Likes 2 ·
Haris Sevinc avatar image Haris Sevinc brendan commented ·

Yea i mean first one; game server hosting. Generally playfab looks like database service but this gameserver hosting looks like photon or any other multiplayer services.

For example i cant make a mmorpg game with photon but it is okay with room based FPS games.

Can i make room based games with playfab multiplayer? Or can i make a mmorpg game with playfab multiplayer? ( I mean custom gameserver hosting, other services are clear )

0 Likes 0 ·
Show more comments

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.