Unreal Configuration
The Toolkit for Steamworks works with the Steamworks SDK and is compatible with all of Unreal's built-in Steam-related plugins. It uses the same configuration features to keep things simple. This means even if you are not using OnlineSubsystemSteam, you will be using its Engine.ini settings to configure and control the Toolkit for Steamworks.
App ID
In development, the OnlineSubsystemSteam SteamDevAppId value is used
[OnlineSubsystemSteam]
SteamDevAppId=480
To define UE_PROJECT_STEAMSHIPPINGID
we use the game's Target.cs, an example from one of our projects follows.
The following is just an example, you would use your own settings and the name of your constructor would of course be different. The point is to show you a working example in the Target.cs of your app.
public TuathaLegendsTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V5;
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
//Set our app id
ProjectDefinitions.Add("UE_PROJECT_STEAMSHIPPINGID=1024120");
//Set our human-friendly name
ProjectDefinitions.Add("UE_PROJECT_STEAMGAMEDESC=Túatha: Legends");
//Set our directory name
ProjectDefinitions.Add("UE_PROJECT_STEAMGAMEDIR=TuathaLegends");
//Set the product name
ProjectDefinitions.Add("UE_PROJECT_STEAMPRODUCTNAME=1024120");
//Add our module name
ExtraModuleNames.AddRange( new string[] { "TuathaLegends" } );
}
Steam Sockets

We leverage the built-in Steam Socket Net Driver which has a dependency on the Online Subsystem Steam plugin. When you enable the Steam Sockets plugin (not just Online Subsystem Steam) the related dependencies should also be enabled and will require a restart of the engine.
Once enabled, the following ini settings become relevant ... learn more in Unreal's official documentation
[URL]
; This is the Game Port that Steam Game Server will use, and by default should be 27017
Port=27017
[SystemSettings]
; Need this to sort out handshake issues with 5.1 and 5.2
net.CurrentHandshakeVersion=2
net.MinHandshakeVersion=2
net.VerifyNetSessionID=0
net.VerifyNetClientID=0
[OnlineSubsystem]
; Let the Online Subsystem know which platform you are working with
DefaultPlatformService=Steam
[OnlineSubsystemSteam]
; Should the Steam Shared and Online Subsystem Steam be enabled ... should always be true
bEnabled=True
; When Development Build, should RestartAppIfNecessary be checked and used should always be true
bRelaunchInSteam=True
; Should VAC be used, only applies to Steam Game Server
bVACEnabled=True
; Your AppID is only used for dev builds and in the editor
SteamDevAppId=480
; The game version ... this is only required if you are going to run a
; Dedicated Server and have it visible over the Steam Game Server browser
GameVersion=1.0.0.0
; Query Port is by default 2017, this is only used by the Steam Game Server
GameServerQueryPort=27018
; If using Sessions, then you need this set to true, else you can ignore it
bInitServerOnClient=true
[/Script/Engine.GameEngine]
; Clear existing definitions
!NetDriverDefinitions=ClearArray
; Add the Steam Sockets Net Driver
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/SteamSockets.SteamSocketsNetDriver",DriverClassNameFallback="/Script/SteamSockets.SteamNetSocketsNetDriver")
[/Script/OnlineSubsystemSteam.SteamNetDriver]
; Set the Connection class name for the net driver
NetConnectionClassName="/Scripts/SteamSockets.SteamSocketsNetConnection"
Game Instance
With the plugin installed, you will want to set up your Game Instance.
The plugin ships with a ready-to-use Steam Game Instance named BP_SteamGameInstance
You can use this as is, or use it as a learning tool to create your own Game Instance derived from our SteamGameInstance parent class, or use it as is.
Global Events
Steamworks is largely a multi-process and thus asynchronous toolkit where you will need to listen to events to know when a request has been serviced. In many, if not most, cases, we provide a "Callback" parameter to methods where you can create an event that will be invoked for that specific method call.
In some cases, however, you may wish to bind to the global event

To help you do this, we defined all of the global events as delegates on the Steam Game Instance and created a simple Get Steam Game Instance method that will fetch the current instance for you. You can then browse and bind to any events you like, be sure to unbind before the object in question leaves scope, as these are global events that remain in scope themselves for the life of your game.

Callbacks
As you should know, Steamworks SDK enables your game to ask Steam (the authenticated client on the user's machine) to do stuff for your game. This means it is largely a multi-process and asynchronous thing.
Valve classically handles this using Callback and CallResult delegates. This is translated in Unreal as "Global" events and Function callbacks.
Global Events
You can bind to global events via the Steam Game Instance ... we provide a simple Get Steam Game Instance node to make this easy to "get".

You can then browse and bind to any events you like, be sure to unbind before the object in question leaves scope, as these are global events that remain in scope themselves for the life of your game.

Function Callbacks
These take the place of Valve's "CallResult" delegate and are scoped to a specific method call. For these, you will see there is a delegate parameter on the function call where you can create an event that will be invoked when the request is complete.

Steam Developer
Become a Steam Developer and get your own App ID.
Valve does provide a test app ID you can use as a matter of demonstration, and our Steam Game Instance will default to its App ID (480); however, you will want to register for your own App ID as soon as possible.
You can learn more about getting started as a Steam Developer in our article here!
Builds
If you are building a Dedicated Server, you will need to ensure you have the following definitions declared. There are several ways you can go about this, such as Target.cs, Please see Unreal Engine's documentation for details.
You can use your game's Target.cs to set these values using the GlobalDefinitions list.
GlobalDefinitions.Add("UE_PROJECT_STEAMSHIPPINGID=480");
GlobalDefinitions.Add("UE_PROJECT_STEAMGAMEDESC=Human Styled: Name");
GlobalDefinitions.Add("UE_PROJECT_STEAMGAMEDIR=FolderName");
GlobalDefinitions.Add("UE_PROJECT_STEAMPRODUCTNAME=480");
UE_PROJECT_STEAMPRODUCTNAME
STEAMPRODUCTNAME
Typically your App ID Used by Steam Game Server Matchmaking features.
UE_PROJECT_STEAMGAMEDIR
STEAMGAMEDIR
This should be the folder where your game resides and is usually just the game name sans spaces and symbols. note it's just the folder name, not the path it's self
UE_PROJECT_STEAMGAMEDESC
STEAMGAMEDESC
Usually the human name of your game
UE_PROJECT_STEAMSHIPPINGID
This is 100% Unreal Engine and is used in both client and server when not in the editor or a Dev build. It is simply your App ID and is used during initialization.
steam_appid.txt
We have a full article on what this text file is and when you should or should not be using it. Epic notes are similar in their article here.
In short, this should only be needed when you're running a packaged project from outside of Steam or if your running a Dedicated server build.
Last updated