question

Dylan Hunt avatar image
Dylan Hunt asked

What is the dev flow for Unity's integrated multiplayer + PlayFab?

How can I use Unity's integrated multiplayer (Unity 5.x) with PlayFab?

For example, do I just pull the info from Unity and call StartGame to store the session with PF?

I'm a bit confused about the workflow with this.

apis
5 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.

Joshua Strunk avatar image Joshua Strunk commented ·

So to be clear you are talking about Unity multiplayer services? Which would be only a matchmaker and relay server, correct? So no authoritative logic in your core game loop?

0 Likes 0 ·
Dylan Hunt avatar image Dylan Hunt Joshua Strunk commented ·

Correct. Would it be recommended to store virtual sessions with PlayFab? For example use StartGame without actually starting a game via playfab client? Overall I'm not sure where the line divides here. Will StartGame return anything if I don't run have an actual playfab server?

0 Likes 0 ·
Joshua Strunk avatar image Joshua Strunk Dylan Hunt commented ·

Well StartGame is actually part of the PlayFab Matchmaker API and as far as I can tell there is no point in using that API if your not planning to host custom game severs with PlayFab. In fact it would probably error if you do not have servers configured to run.

If your wanting to get some analytics on games starting, ending, etc..., I would broadcast out custom PlayStream events. Remember though these can be spoofed and faked without using dedicated servers or verifying some data in CloudScript.

1 Like 1 ·
Show more comments

1 Answer

·
brendan avatar image
brendan answered

As Joshua says, the multiplayer elements you see in PlayFab (tracking active sessions, etc.) all have to do with hosted game servers. However, I will correct one thing - that, and our matchmaker, also work for servers hosted outside our service (https://api.playfab.com/docs/external-server-hosting).

The difference is that with our hosting, we manage spin up/down of server capacity as needed, and we pull your log and output files into S3 so that you can retrieve them later. If you use external game server hosting, you can connect it to us for matchmaking and tracking of users across sessions, but you'll need to manage the server availability and log/output files.

And yes, also as Joshua pointed out, events are the way to track on user activity. We provide default events for actions in PlayFab, but you can also generate custom events via the Write...Event API calls.

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 ·

Ah that makes sense. Joshua said I couldn't use the Matchmaking API because it's probably return errors (since no official pf server): I believe I saw in another post say I should use custom events instead?

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

Our matchmaker tracks on sessions and available slots for custom game servers, whether they're hosted in our service directly, or in another server provider (and using the external game server API calls - https://api.playfab.com/docs/external-server-hosting).

Since you've stated that you'll be using the Unity Multiplayer service, your best bet would be to use the Unity Matchmaker, as described in their documentation: https://docs.unity3d.com/Manual/NetworkManagerCallbacks.html

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.