What goes in DefaultEngine.ini?
The block below, from Epic's documentation. The first section adds a Steam net driver with the IP driver as a fallback. [OnlineSubsystem] tells the engine to use Steam. [OnlineSubsystemSteam] turns the module on and sets the development app ID. The last section sets the connection class for the Steam net driver. New projects have none of these settings; sample projects may already have some.
DefaultEngine.ini
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Steam
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
; If using Sessions
; bInitServerOnClient=true
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"Sources: Unreal Engine documentation, Online Subsystem Steam Interface.
Do you need bInitServerOnClient?
Only with Sessions. Epic says that without bInitServerOnClient=true the Steam subsystem does not initialize correctly for Sessions: the Create Session node and its C++ functions fail, and players cannot join. Games that use lobbies do not need it; for a lobby, set bUsesPresence and bUseLobbiesIfAvailable to true in the FOnlineSessionSettings you pass to CreateSession.
Dedicated servers need bUsesPresence set to false and three macros that match Steam's dedicated server tool page: UE_PROJECT_STEAMPRODUCTNAME, UE_PROJECT_STEAMGAMEDIR and UE_PROJECT_STEAMGAMEDESC. If they do not match, Steam does not list the server.
Sources: Unreal Engine documentation, Online Subsystem Steam Interface.
Where do the Steamworks SDK files go?
Under the engine's ThirdParty folder. Download the Steamworks SDK and copy it to Engine/Source/ThirdParty/Steamworks/Steam<VERSION>/sdk, where version 1.53 is v153; when you update it, change SteamVersionNumber in Steamworks.build.cs. Copy the redistributable libraries, such as steam_api64.dll and steamclient64.dll on Win64, and ship libsteam_api.so next to a Linux executable.
Make sure the module builds with the game: Epic suggests adding DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam"); to the constructor of your game's .build.cs file.
Sources: Unreal Engine documentation, Online Subsystem Steam Interface.
How do app ID 480 and steam_appid.txt work?
They let you test without your own app ID or the Steam client launch. App ID 480 is a test ID shared by all developers; most Steam interfaces work with it, but you need your own app ID to ship. Unreal writes steam_appid.txt before it starts Steam and deletes it on a clean shutdown. The file must sit next to the executable and must not go into a Steam build.
Valve gives the same rule for any engine: the file holds only the app ID, and you should not ship it, because SteamAPI_RestartAppIfNecessary returns false whenever the file is present. A dedicated server is the exception: Valve has you create a separate Tool app ID for it and include a steam_appid.txt with the game's app ID in the server package.
In shipping builds, the engine checks that the logged-in user owns the game and shuts down if not. To launch outside Steam in Unreal 4.22 and later, UE_PROJECT_STEAMSHIPPINGID must hold the game's Steam ID.
Sources: Unreal Engine documentation, Online Subsystem Steam Interface; Steamworks API Overview and Distributing Your Dedicated Game Server documentation.
Do you need SteamAuth or Steam networking?
SteamAuth if your servers should check Steam authentication; Steam networking is on by default. Enable SteamAuth with a [PacketHandlerComponents] entry, +Components=OnlineSubsystemSteam.SteamAuthComponentModuleInterface; it then kicks players who fail the check, unless you bind OverrideFailureDelegate. To use the IP net driver instead of Steam networking, set bUseSteamNetworking=false under [OnlineSubsystemSteam].
Sources: Unreal Engine documentation, Online Subsystem Steam Interface.
How to measure the result
Manalens is the analytics and growth engine built for games. Its Unreal SDK is a UE5 plugin with Blueprint nodes, tested on macOS; Windows, Linux, Android, and iOS builds are not tested yet. It sends app events with the project's publishable key and engine set to unreal. Send an event when a session or lobby is created, joined or fails, with the error as a property, and a funnel shows how many players who open multiplayer actually get into a match.
Sources: Manalens SDK overview and Unreal SDK documentation.
Frequently asked questions
Why does Create Session fail with Online Subsystem Steam?
Often because bInitServerOnClient is missing. Epic says that if you use Sessions, you must add bInitServerOnClient=true under [OnlineSubsystemSteam] in DefaultEngine.ini; without it the Steam subsystem does not initialize correctly, Create Session does not work, and players cannot join. Lobbies do not need the setting.
What is SteamDevAppId 480 in Unreal?
A test app ID shared by all Steam developers, which Epic uses in its example DefaultEngine.ini. Most Steam interfaces work with it, so you can test matchmaking before you have your own app. Replace it with your game's app ID before you ship, because the game needs its own ID.
Should steam_appid.txt be in my Steam build?
No. Epic says Unreal generates steam_appid.txt next to the executable during development and deletes it on a clean shutdown, and that the file should not be included in any Steam images. In a shipping build, the engine checks that the player owns the game instead.
Can I use Online Subsystem Steam without Steam networking?
Yes. Steam networking is the default socket subsystem, but from Unreal 4.22 you can set bUseSteamNetworking=false under [OnlineSubsystemSteam] in DefaultEngine.ini or a platform engine file, and use the IP net driver. You then also need to change the net drivers in your configuration.