The Steamworks plugin allows integrating a project with Steam. It is currently only supported with the Windows WebView2 and Linux CEF export options
The plugin provides basic access to the user details, the Steam Overlay, achievements and DLC.
Exporting for Steam
To test your game with Steam, export it with the Windows WebView2 or Linux CEF options. You must also have Steam installed and running on your system for the plugin features to work. Use the Is available condition to check if the plugin features are available.
For more details about getting your project running on Linux or the Steam Deck, see the guide Exporting to Linux and the Steam Deck.
During development, you must also set your Steam App ID in the plugin's App ID property, and check Development mode. This tells Steam your app ID. If Steam cannot determine the App ID it will fail to initialize and Is available will be false, so this is necessary during development to make sure Steam knows the app ID and enable Steam features. If you don't have an app ID yet, you can use the app ID 480, which is the ID for the Steamworks SDK sample "Space war".
Before publishing to Steam, be sure to uncheck Development mode, as when it is on it disables Steam's recommended "restart app if necessary" behavior.
Steam Overlay
When the Enable overlay property is checked, on Windows the Steam Overlay is enabled using a workaround, and can only be shown with an opaque background. This is because technical limitations in the Steam Overlay mean it cannot normally be shown over WebView2. There are more details about the technical issues involved in the blog post Trying to show the Steam Overlay over WebView2. If you uncheck Enable overlay, the Steam Overlay won't show in-game, but in this case Steam reverts to fallbacks. For example the achievement unlocked notification is shown using a different kind of overlay, and attempts to open the overlay will normally switch focus to the Steam application. In some cases this may be an acceptable alternative to showing the overlay.
The Steam Overlay is not currently supported on Linux desktop systems, also due to what appear to be limitations in the Steam Overlay itself, so Steam will always use its fallbacks in that case. However the Steam Overlay works well on the Steam Deck.
If you want better Steam Overlay support, you'll need to contact Valve and ask them to fix the Steam Overlay - we've done the best we can given its limitations.
Steam Cloud
You don't actually need the Steamworks plugin to use Steam Cloud - you can use Steam Auto-Cloud with Construct's File System plugin to automatically synchronize a folder of files between systems. See the Steam Cloud documentation for more details.
The root paths for Steam auto-cloud correspond to the known folder picker tags in the File System plugin like so:
- App Install Directory: "<app>"
- WinMyDocuments: "<documents>"
- WinAppDataLocal / LinuxXdgDataHome: "<local-app-data>"
- WinAppDataRoaming: "<roaming-app-data>"
- WinSavedGames: "<saved-games>"
- LinuxHome: "<profile>"
Further, the StaticAccountKey expression of the Steamworks plugin corresponds to the {64BitSteamID} variable in Steam Auto-Cloud special path values. Therefore you can set up File System to write to a folder that is set up for Steam Auto-Cloud. For example on Windows you could do the following:
- Set up Steam Auto-Cloud to sync the root WinMyDocuments, path mygame/{64BitSteamId}
- Use File System to read/write to picker tag "<documents>", folder path "mygame/" & Steam.StaticAccountKey & "/file.json"
Now file.json is in the Steam Auto-Cloud folder and so Steam should sync that across different devices when closing/launching your game.