QuickStart: PlayFab Online Subsystem
This article helps you set up and use PlayFab Multiplayer features like Lobby, Matchmaking, and Party for games built with Unreal Engine 4 or Unreal Engine 5. For the full list of supported platforms and versions in Unreal Engine 4 or Unreal Engine 5, see Supported platforms. After following the relevant steps that are outlined in this page for your target platforms, you’ll be ready to start using the PlayFab Online Subsystem (PF OSS). Authentication, networking, VOIP, grouping into lobbies, and matchmaking is handled on your behalf with no other changes required.Download and install PlayFab Online Subsystem
Go to PlayFab Online Subsystem to download or clone the PF OSS source. The downloaded or cloned repository name is PlayFabMultiplayerUnreal. The repository has to be renamed to OnlineSubsystemPlayFab.What you need
- PlayFab TitleID: If you don’t have a TitleID configured for PlayFab Party and Multiplayer Software Development Kits (SDKs), see Enabling PlayFab Party.
Microsoft Game Development Kit (GDK), PC, Switch, PlayStation®5, and PlayStation®4
- Specific platform PlayFab Party and Lobby and Matchmaking libraries: See Obtaining PlayFab Party and Multiplayer libraries.
Initial setup
Unreal Engine code base
- Copy the OnlineSubsystemPlayFab folder and its contents to your Unreal Engine directory under Engine\Plugins\Online.
- Run
GenerateProjectFiles.batto create project files for the engine. - Load the project into Visual Studio by selecting the new
UE5.slnfile. - Set your solution configuration to Development Editor and your solution platform to Win64. Select the Unreal Engine 5 target, and then select Build.
Game code base
- To add OnlineSubsystemPlayFab to your plugin list, apply the following changes to the Plugins section of the project file.
- Remove any platforms that you’re not shipping on
- Use XboxOneGDK instead of XB1 if you’re using Unreal Engine 4. Unreal Engine 5 deprecates XboxOneGDK
- Generate the game solution file by selecting the
{ProjectName}.uprojectfile and then select Switch Unreal Engine Version to the Unreal Engine code path.
Game Configuration
- No matter which platform you’re targeting, your game needs to configure certain PlayFab specific values in your intended platform target’s INI file (located at [yourGameDirectory]/Platforms/[yourPlatform]/Config).
- XBOX Series X GDK: XSXEngine.ini
- PC GDK: WinGDKEngine.ini
- XBOX One GDK: XB1Engine.ini (or XboxOneGDKEngine.ini if you’re using Unreal Engine 4)
- PC Steam: WindowsEngine.ini (or find it in [yourGameDirectory]/Config/Windows)
- Nintendo Switch SwitchEngine.ini
- PS4™ PS4Engine.ini
- PS5™ PS5Engine.ini
- Replace the INI sections in the config if they already exist (for example, Engine.GameEngine) with the ones presented in the following sections.
- Ensure you replace all the <REPLACE ME> fields with your data:
- On UE 5.6 and later the
DriverClassNameparameter requires the “/Script/” prefix. For example, use"/Script/OnlineSubsystemPlayFab.PlayFabNetDriver"instead of"OnlineSubsystemPlayFab.PlayFabNetDriver".
Platform Specific Considerations
With all that done, we’re nearly finished. There are only a few key platform-specific parameters left that must be set.GDK
When developing games with the GDK, set up the platform services.Steam
If you’re developing games for Win64 with Steam, define your platform services.Switch
For more information about Switch, see the ReadMe.md file that comes with the Switch PlayFab OSS. If you don’t have access, you can request access to our private repositories.PS5™ and PS4™
For more information about PS5™ and PS4™, see the ReadMe.md file that comes with the PS5™ and PS4™ PlayFab OSS. If you don’t have access, you can request access to our private repositories.Cross-platform
If your game uses PlayFab’s cross-platform networking support, define which platforms you permit to connect.Use in Game Code
PlayFab Online Subsystem only supports Game Session naming as
NAME_GameSessionPublicDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "OnlineSubsystemUtils" }); in Game.Build.cs, then use it the same way as other game plugins.
Example code in GameSession.cpp:
Troubleshoot
Ways to help you troubleshoot issues.Unreal Engine Installed Builds
Users might face issues when trying to create an Unreal Engine Installed Build with the OnlineSubsystemPlayFab on GDK build flavors. We provide the following guidance to successfully overcome this issue until there’s a more complete solution. If you’re using Unreal Engine 5.4, 5.5, 5.6 or 5.7:- You might encounter the following runtime error:
Runtime dependency Party.dll is configured to be staged from C:\Program Files (x86)\Microsoft GDK\<version>\Party.dll and Engine\Plugins\Online\OnlineSubsystemPlayFab\Platforms\GDK\Redist\Party.dll - Navigate to Engine\Platforms\GDK\Plugins\Online\OnlineSubsystemGDK\
- Open OnlineSubsystemGDK.uplugin and set
PlayFabPartyto disabled:
- Navigate to Engine\Platforms\GDK\Plugins\Online\OnlineSubsystemGDK\Source\
- Open OnlineSubsystemGDK.Build.cs and comment out the inclusion of
PlayFabParty:
- Locate the directory where Unreal Engine is installed on the machine.
- Navigate to Engine\Platforms\GDK\Plugins\Online\PlayFabParty
- Open PlayFabParty.uplugin, and update Modules config with PlatformDenyList:
- Repeat this process for XB1 (PlayFabParty_XB1.uplugin) and XSX (PlayFabParty_XSX.uplugin) if these platforms are required for the Installed Build. If Win64 is also a required platform for the installed build, add Win64 in the array of PlatformDenyList.
- Locate the directory where Unreal Engine is installed on the machine.
- Navigate to Engine\Platforms\GDK\Plugins\Online\PlayFabParty
- Open PlayFabParty.uplugin
- Replace the key WhitelistPlatforms with BlacklistPlatforms
- Repeat the process for XboxOneGDK (PlayFabParty_XboxOneGDK.uplugin) and XSX (PlayFabParty_XSX.uplugin) if these platforms are required for the Installed Build. If Win64 is also a required platform for the installed build, add Win64 in the array of BlacklistPlatforms.
HandShake failure on Steam
If you’re seeing handshake failure (such asLogHandshake: IncomingConnectionless: Error reading handshake packet), refer to this Unreal Engine Forum post to check the settings.
Workflow for OnlineSubsystemPlayFab
The steps outlined in the Platform Specific Considerations section ask you to include:FOnlineSubsystemPlayFab::Init(),
where it initializes both Party and Multiplayer SDKs with PlayFab TitleID (this titleID is defined inside the Game Configuration file. During initialization, we’ll CreatePlayFabSocketSubsystem() as the main online subsystem.
Workflow of Multiplayer SDK: FOnlineSubsystemPlayFab::Init() initializes the InitializeMultiplayer() multiplayer SDK singleton for your title. In the PlayFabLobby.cpp, FPlayFabLobby::DoWork() processes the
state changes triggered by Multiplayer APIs (view Platforms/GDK/Include/PFLobby.h for APIs).
Workflow of Party SDK: FOnlineSubsystemPlayFab::Init() initializes the InitializeParty() multiplayer SDK singleton for your title. In the OnlineSubsystemPlayFab.cpp, FOnlineSubsystemPlayFab::DoWork() processes the
state changes triggered by Party APIs (view Platforms/GDK/Include/Party.h for APIs).
“PlayStation” is a registered trademark or trademark of Sony Interactive Entertainment Inc.
“PS4” is a registered trademark or trademark of Sony Interactive Entertainment Inc.
“PS5” is a registered trademark or trademark of Sony Interactive Entertainment Inc.