question

martinliu1993 avatar image
martinliu1993 asked

Using Photon with PlayFab and Unreal

Hi, our team is looking at supporting cross platform play for our Unreal Engine game. We have already been integrating user stats/data on the backend using PlayFab. For now, our players are all on Steam. So i've added Steam plugin integration to PlayFab, created PlayFab accounts for users logging in through Steam, stored their stats and stuff for leaderboards including skill points and levels and otherwise.

Now that we are looking at CrossPlatform play (Oculus, Steam, PSN and maybe others), would we now be required to look at Photon integration with PlayFab? If so, does that mean on Unreal side, we would not be using UE4's onlinesubsystem to do match making, but start using PlayFab's match making Server API calls instead?

Finally, I noticed that there are some tutorials about integrating Photon with PlayFab here. Are there some tutorials for using Unreal? Also when creating games and lobbies cross platform, would I have to create a server to do so (perhaps on PlayFab), or can I still use a peer-to-peer system where 1 of the players act as a host?

Thanks

photon
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

Regardless of the language/engine being used, if you're doing real-time connected sessions, you need some way to matchmake those players, and some way to connect them. How you do so will be down to your requirements concerning server authority. If all you need is a way for players to matchmake and you want to have clients run the "server" (granted, not using any Server API calls, since that would then require exposing the Secret Key to the client, which would then result in hackers being able to make those calls directly, with any values they like), you could simply use Photon as your matchmaker, having players open Rooms for others to use to find sessions. Bear in mind that player's bandwidth, connection, and router type may cause problems for other players connecting to their machine, so one thing I'd recommend is keeping a local tracking file that maintains info on average connection speeds and overall quality whenever the local user is the host, and use that to decide whether that player should host or not (if you're not letting them control that choice directly).

If you do need server authority, you'll want to consider either Photon Enterprise, so that you can upload dlls to their servers that run your custom code, or just use custom game servers, whether hosted with PlayFab or not. If you're using custom game servers, you could either use our matchmaker (Client/Matchmake), which specifically finds an available slot in the currently running custom game server sessions, or you could use the Matchmaker API to create you own matchmaking server logic, which you could then host (again, either with PlayFab or separately).

We don't have specific tutorials for building titles in Unreal. To be honest, only a small percentage of our developer community uses Unreal, so it hasn't been an area where we've developed deep internal expertise - but our developer community has definitely stepped up there, and worked with us on development of our Unreal SDK.

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

martinliu1993 avatar image martinliu1993 commented ·

Hey Brendan, so I've been looking into Photon again and considering whether or not many of Photon's functionality for us can be just done using PlayFab. Currently, what we really need right now is a place to host custom game servers, providing match makers for joining players, and provide cross platform support.

I know that PlayFab is able to provide match making and custom game server hosting, but I don't know about the cross platform part. Ideally, the players just connect to a custom game server hosted on PlayFab independent of whether they are playing on Steam, Oculus, or PSN. Is this possible?

The other major part of Photon is their Photon Netcode. That is something that we don't want to do for our game because we would like to keep using Unreal's Netcode. From asking on the Photon forums, I think the jist I am getting is that we can just use Unreal networking for in game networking, but use Photon networking for Matchmaking.

With everything being said, is PlayFab capable of providing much of the functionalities we need from Photon? The functionalities we want include hosting a custom game server, match making, and cross platform play (P2P and dedicated server)?

0 Likes 0 ·
brendan avatar image brendan martinliu1993 commented ·

From a technical standpoint, nothing prevents any device capable of making the connection to the server from doing so.

What we provide for realtime connections to players is what you mention - custom game server hosting. That is, servers which run your own executable, which communicates with the clients. So, it's entirely up to you what the servers do with connected clients, and platform is largely irrelevant. And yes, our matchmaker is specifically for getting players connected to those hosted game servers.

But what you'll need to check on is whether there are any policies of your target platforms which would prevent you from having them play together in that server. Each platform owner (Valve, Sony, etc.) has their own requirements around what is and isn't allowed - it's very important for you to be familiar with those requirements, if you're targeting their platforms.

0 Likes 0 ·
martinliu1993 avatar image martinliu1993 brendan commented ·

Hey Brendan, a quick question in regards to LobbyId and Game Servers. For each game server, they have one and only one lobby id correct? Until a game server is shut down, the lobby id may be assigned to only 1 game server. The lobby id may be reused, but only 1 lobby and 1 lobby id is assigned to a server at a time for each server.

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.