Getting Started
Like what you're seeing?
Support us as a GitHub Sponsor and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our GitHub Sponsors ... become a sponsor today!
Be sure to read the Installation article, it contains information on initial engine and project configuration that will prevent most "getting started" issues.
Import the Toolkit for Steamworks plugin to your project. Whether you purchased the plugin from Unreal Marketplace or are a GitHub Sponsor you will need access to the Toolkit for Steamworks plugin to get started using it.
The plugin is not free and is only available from Heathen via the GitHub Sponsor program and on the Unreal Marketplace. If you acquired the plugin anywhere else we suggest you remove it immediately as it's not a legit copy and likely contains malware.
Configuration
Toolkit for Steamworks works with 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 Toolkit for Steamworks.
App ID
In development, the OnlineSubsystemSteam SteamDevAppId value is used
For a build the define UE_PROJECT_STEAMSHIPPINGID
is used. There are several ways to "define" this define.
Using the PublicDefines list in your game's Build.cs
Or in the GlobalDefines list in your game's Target.cs (preferred)
Steam Sockets
We leverage the built-in Steam Socket Net Driver which has a dependency on the Online Subsystem Steam plugin. When you enable 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
With the plugin installed, you will want to set up your Game Instance.
The plugin ships with a ready-to-use Steam Game Instnace named BP_SteamGameInstance
You can use this as is or use it as a learning tool to create your own Game Instnace derived from our SteamGameInstance parent class or use it as is.
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 defines declared, there are several ways you can go about this such as the Target.cs, please see Unreal Engine's documentation for details.
This is a requirement from the Online Subsystem Steam plugin and deals with how it initializes the Steamworks SDK.
We document it here because it is often overlooked, to find the source documentation please review the Server Details section of the Online Subsystem Steam article on Epic's documentation site.
You can use your game's Target.cs to set these values using the GlobalDefitnions list.
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 similar in their article here.
In short this should only be needed when your running a packaged project from outside of Steam or if your running a Dedicated server build.
Use the kit
The Example Level presents a UI that demonstrates key features
Be sure to check out the Graph on the BP_Example_UI for additional examples such as how to find, join and create a Steam Lobby, Host and Join a network session via Steam Networking Sockets, etc.
The Center Bottom text boxes are used to test lobby and multiplayer features.
Lobby
You can create a lobby by clicking the button with the input field empty.
You can join a lobby by typing in the Hex ID of the lobby you wish to join.
Browsing and matchmaking can also be done with blueprint nodes only, we simply didn't want to clutter the example with to many use cases.
Multiplayer
Everything in the example scene is done with Blueprint Nodes requiring no C++ work at all. The UI WIdgets used are all created using Blueprint Nodes only again no C++ work required at all.
Beyond samples we have extensive documentation including how-to guides for nearly every aspect of the Steam platform, going beyond simple documentation for our tools and assets. You can learn more about all the features of Steam in our knowledge base by reviewing the hundreds of articles linked in the navigation panel to the left ๐
If you have any questions simply look up ... there you will find our Search tool which is AI-assisted and fairly useful as well as links to our Discord Community where you can get live support.
Troubleshooting
Package Closes/Crashes on launch
This happens when you run a package that has not been deployed by the Steam client. You will find that the Should Restart event if you simply copied the example implementation closes the app if it has not been launched from the Steam client.
You can prevent this check by adding a steam_appid.txt to the root of your project as shown in the image below
DO NOT ship your game with steam_appid.txt this bypass is meant for devs.
You DO want your game to shut down and relaunch from the Steam client to ensure the Steam API works properly in every other use case.
Learn more about steam_appid.txt and when to and when not to use it.
Editor Crash on Play
Where the crash log mentions and Access Violation or similar low level exception noting the steam_api.dll or a similar Steam-related assembly.
Typically caused by an issue with the Steam Shared plugin. This is a built-in plugin of the Unreal engine not part of Heathen's codebase but is a dependency. If you attempted to update Steamworks SDK or made some change to the engine build that prevents the Steam Shared plugin from loading properly you will get this sort of crash.
To correct the issue start by verifying your engine install, if you are building from source check for compilation errors and changes to the ThridParty Steamworks engine plugin. If you installed via the launcher you can simply right-click on the engine version and select Verify, it will clean and correct any issues found.
Callbacks not working in the package
In most cases, this is due to Steam API not initializing,
In most cases, with a package, this is due to you running the package without deploying it from the Steam client without using the steam_appid.txt and without properly handling the Restart Required case.
When you run the package Steam API will perform a check known as "Restart Required" This checks to see if the app was run from the Steam client, if it was not it will attempt to re-launch the game from the Steam client.
If you are just getting started however your game won't have launch options in the Steam client so that will do nothing.
In addition, Steam API will not have initialized and will not be processing callbacks e.g. Steam API is simply not working in that case.
You can sidestep the Restart Required check by using the steam_appid.txt, please read and understand what steam_appid.txt is before you use it.
The Game Doesn't Stop (in the editor)
When you run your game in the editor, the editor's process (as far as Steam is concerned) is your game, so it will show it as "playing" as long as the Editor remains open. Attempting to force it to stop may close your editor unexpectedly or cause an Editor crash.
It doesn't hurt anything for Steam to see the Unreal Editor process as your game so you can simply ignore this.
If it bothers you, you can run the simulation as a Standalone Process from the editor, as this is its own process Steam will properly see it start and stop and the Overlay will work properly. Keep in mind if you have already ran in the editor you may need to restart the editor to get Steam to let go of that old initialization.
Overlay Doesn't Work
Your probably running the simulation in the editor as opposed to as a separate process. The Steam Overlay works by finding the window handle of the window process that initialized it. When your running the simulation as part of the Editors process you will have issues with Overlay because Unreal Editor has a great many window handles most of which do not update every frame and so Steam Overlay just doesn't work properly.
If you run your app as a Standalone Process Overlay should work for you, though if you have already initialized in the editor you may need to restart to clear that initialization. See my game doesn't stop when I stop the simulation.
On Launch 2 Windows Open
You are running your package without having deployed it from the Steam client.
You have configured launch options for your app
You are not handling the Restart Required case properly.
When you run the package Steam API will perform a check known as "Restart Required" This checks to see if the app was run from the Steam client, if it was not it will attempt to re-launch the game from the Steam client.
In addition, Steam API will not have initialized and will not be processing callbacks e.g. Steam API is simply not working in that case.
You can sidestep the Restart Required check by using the steam_appid.txt, please read and understand what steam_appid.txt is before you use it.
Last updated