Steam Advanced Sessions Setup
This guide covers how set up the Advanced Sessions Plugin to allow you to play with friends over Steam using Blueprints only.
This article assumes you already know the basics of Unreal Engine. It does not cover setting up UI or levels to keep the content focused. Future guides will cover these topics β stay tuned!
π§© Advanced Sessions Setupβ
-
Download the Advanced Sessions plugin version that matches your Unreal Engine version.
-
Create or open your Unreal Project.
- The project must be a C++ project.
- If you're using a Blueprint-only project, you can convert it to a C++ project by creating an empty C++ class at the top of the editor by going to Tools -> New C++ Class
- In the window that opens, click next, then Create Class.
- In the window that opens, click next, then Create Class.
-
Copy plugin files:
- Copy the
AdvancedSteamSessions
andAdvancedSessions
folders from the plugin download into your project folder's/Plugins
folder.- If the
Plugins
folder doesnβt exist, create it.
- If the
- Copy the
-
Edit config:
- Open your project's
DefaultEngine.ini
file inside theConfig
folder and add the following to the bottom of the file and save:
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Steam
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"This config change does the following:
- Tells Unreal to use Steamβs networking driver (
SteamNetDriver
) by default, falling back to IP networking (IpNetDriver
) if Steam isnβt available. - Sets Steam as the default platform for online services.
- All networking features (sessions, matchmaking, friends, etc.) will use Steam's systems.
bEnabled=true
: Activates the Steam Online Subsystem.SteamDevAppId=480
: Uses the Spacewar test app (ID: 480) for development.- This is Valveβs default app ID for testing multiplayer with Steam.
- Ensures that peer-to-peer connections use Steam rather than raw IP sockets.
- Open your project's
-
Add
steam_appid.txt
:-
In the root folder of your project, create a file called
steam_appid.txt
. -
It should contain a single line:
480
infoThe
steam_appid.txt
file is only required during development to tell your application what Steam AppID to use when integrating with the Steam API. When your game is launched through Steam (rather than from your local file system), the Steam client automatically provides the AppID, so this file isn't required in shipping builds.
-
-
Test Steam overlay:
- Launch a standalone game from the editor.
- The Steam overlay (Shift + Tab) should now appear.
- You may need to restart the editor to properly import the plugins and enable overlay functionality.
π§ Session Creation and Joiningβ
-
Create a Game Instance: While the Advanced Sessions functionality can be called from any blueprints, it's typically best to call from within a game instance, as this is always globally available and exists for the entire lifetime our game is running.
- Create a Blueprint class inheriting from
AdvancedFriendsGameInstance
calledBP_GameInstance
.
infoThe
AdvancedFriendsGameInstance
is a child of the standardGameInstance
class provided by the Advanced Sessions plugin. It provides several pre-defined delegate functions for friend-related events such as:- OnPlayerLoginChanged
- OnSessionInviteReceived
- OnSessionInviteAccepted
- And many more...
as well as setting up several other systems for tracking friend-related behaviour. As such, it's highly recommended that you use it in your project if possible.
- Create a Blueprint class inheriting from
-
Create two events inside BP_GameInstance:
-
Create Session:
- Use the
Create Advanced Session
node to create a session. - Make sure the Player Controller is connected.
OnSuccess
useOpen Level
withlisten
added to the Options parameter
- Use the
-
Join Session (via invite):
- Use
OnSessionInviteAccepted
to respond to friends accepting game invites (this is only available when using theAdvancedFriendsGameInstance
or a subclass of it). - Use
Join Session
node, being sure to pass in thePlayer Controller
andSession to Join
.
- Use
-
-
Create a menu widget:
This guide doesn't cover how to make UI or have it appear on the users screen.
-
Add buttons and blueprint logic for:
-
Creating a Session
-
Finding and Joining a Session
- The below blueprint is a very simple and naive way of joining the first session found. In practice, you should return the array of results from
FindSessionsAdvanced
and display these in a server browser UI.warningBe sure to connect the
Player Controller
and increase theMax Results
from it's default of 0 for theFindAdvancedSessions
node.
- The below blueprint is a very simple and naive way of joining the first session found. In practice, you should return the array of results from
-
-
-
Set GameInstance:
- Go to Project Settings β Maps & Modes.
- Set the default GameInstance class to your
BP_GameInstance
.
π§ͺ Testing Multiplayer in the Editorβ
- In the play dropdown (next to the play button), set:
- Number of Players:
2
- Net Mode:
Play As Listen Server
- Number of Players:
- Press Play.
- Two windows will open.
- Create a session in one and join from the other.
This is still local testing and does not use Steam. This is useful for testing your multiplayer gameplay code in the editor, but does not validate if your Steam sessions work correctly. To see how to test Steam from a single computer, see π₯οΈ Testing Steam Multiplayer Locally
π₯οΈ Testing Steam Multiplayer Locallyβ
This step is Windows-only (although alternative sandboxing tools for other platforms do exist).
- It uses Sandboxie Plus to run two Steam clients simultaneously.
- You'll need two separate Steam accounts.
Step 1: Sandboxie Plusβ
Download and install the latest version of Sandboxie Plus.
- Choose your version (
x64
,ARM
, orx86
) based on your system:- If you're unsure, in Windows go to the Settings app, then
System β About β Device Specifications β System Type
to check.
- If you're unsure, in Windows go to the Settings app, then
Step 2: Build Your Gameβ
In Unreal Engine:
- Go to Edit β Project Settings β Maps & Modes.
- Ensure you've set the correct Game Default Map, typically your main menu level.
- In the main editor window open the
Platforms
dropdown next to the play controls,Windows β Package Project
(setting the Binary Configuration as needed) to build your game as a.exe
.
Step 3: Configure Sandboxieβ
- Launch Sandboxie and find the default sandbox:
DefaultBox
. - Right-click β
Sandbox Options
βGeneral Options β Run Menu (Tab at the top)
.- On the right-side of the window, click the dropdown next to
Add program
and selectBrowse for Program
- On the right-side of the window, click the dropdown next to
- Add:
Steam.exe
(usually inC:\Program Files (x86)\Steam
)- Your packaged game
.exe
Step 4: Run Two Instancesβ
- Start Steam normally and log in to your main account.
- Start Sandboxie, then run Steam in the sandbox and log in to your second account.
warning
If using AppID 480, ensure both your Steam account and the sandboxed account have the same Download Region, which can be set in
Steam settings β Downloads β Download Region
.- The test AppID 480 has restrictions that require players to be using the same Download Region, so if these settings differ you will not find the other player's session.
- When testing with friends online, they will also need to be in the same download region.
- This limitation only applies to the AppID 480, so if you have your own AppID then this step is irrelevant.
- Launch your packaged game
.exe
directly and from Sandboxie.
You should now be able to:
- Create a session on one client.
- Find and join the session on the other.
If Steam doesn't show the overlay in your packaged game, double-check:
steam_appid.txt
exists and has480
- You're using a packaged build, not running in-editor
- Steam is running before the game starts
π₯ FAQ / Errorsβ
Unreal Engineβ
- Unreal Engine versions 5.3 and earlier do not have Online Subsystem Steam enabled by default. You can enable this from the plugins window within the editor (contributed by @CallumPooleProgramme)
- The Steam Sockets plugin can cause issues with the Advanced Sessions plugin, so ensure that this is disabled (it is usually off by default in recent engine versions). (contributed by @daltoncave112)
Sandboxieβ
-
When Sandboxie is the host, my client can discover session but can't join. When I host on my regular client, Sandboxie can't find the session.
This is due to Sandboxie restricting network behaviour. Resolving it requires you to declare a specific port and query port to run the sandboxed game client on. You can do this by:
- Opening your 'DefaultBox' Options in Sandboxie,
General Options β Run Menu
. In the list of applications you've added, double click on the path (in the command line column) of your client and add the following after the.exe
:
--port=27015 --query-port=27016"
As a full example, this should look like:
"F:\GameDev\Projects\SteamMultiplayer\Build\Windows\SteamMultiplayer.exe" --port=27015 --query-port=27016
(contributed by @Lazaerus, @mrruzvert)
- Opening your 'DefaultBox' Options in Sandboxie,
β Done!β
Youβve now set up and tested the Steam Advanced Sessions Plugin entirely using Blueprints.
This allows friends to host/join games via the Steam API with no C++ coding required.
π§ββοΈ β Hanayou, Chronicler of Unreal
P.S. Want a future guide for matchmaking UI or persistent lobbies? Let me know!