Now that you have your Steamworks Partner account and your application all set up, you'll need to obtain the Steamworks SDK.
NOTE: If you have not yet registered with Steamworks, please see the official Steamworks site
Download The Correct SDK Version
As different GameMaker Studio 2 expect specific SDK versions for all external tools, you'll need to make sure that you are using the correct version of the Steamworks SDK. This information can be found on our Required SDKs page.
Once you know which version you need, open https://partner.steamgames.com/downloads and start downloading the correct version.
Once the download has finished, you'll need to extract it to a location which GameMaker can point to. It's strongly advised you put it in a short path location which is easy to reach, as you'll need to access this for multiple things later in this tutorial.
We recommend simply C:\SteamworksSDK\ or something which perhaps reminds you which SDK version it is, but still keeping the path short.
Set Up GameMaker
Within GameMaker, open your Preferences and navigate to Platform Settings and the Steam tab. Point the Steamworks SDK Location field to where you previously extracted this to:
And that's it for "installing Steam", as you only need do this once for your GameMaker user on that machine.
Setting up your game to work with Steam
Now that you have Steam set up correctly you'll need to configure your GameMaker game to know about Steam.
This is done by opening Game Options > Main in the Asset Browser and replacing the default 0 with your own game's genuine Steam ID number. Note that if for some reason (not recommended by us or Steam) you created individual Steam apps for your Windows/Mac/Ubuntu versions, then you will need to use Configs within GMS2 to control this.
Each of the Windows, macOS and Ubuntu screens within Game Options then has a checkbox where you can say that builds for this platform need to include Steam support (or not).
For example, here is the one for Windows:
Once you've put in the correct ID and enabled the Steam checkbox you can test if your game is working correctly as a Run of your application will pop up the Steam API notification (depending on the platform you're testing).
Carry on developing your game as required, until you're ready to start sending testing builds to Steam, then carry on with this guide.
A Note On Steamworks DRM Wrapper
You may be aware of Steam's DRM Wrapper, which they offer as an optional extra tool you can use when you have sent builds to the store. There is no need to use this with GameMaker, as the runner already uses Steam's alternative/more reliable "SteamAPI_RestartAppIfNecessary" functionality (as you can see from the table lower down on that page).
Attempting to use the DRM Wrapper tool anyway may cause an error report from the tool.
Uploading Your Project To Steam
Now that you have set up Steam and GameMaker Studio 2 to both communicate with each other, it's time to upload your game. This is done using a tool which comes as part of the Steamworks SDK which we downloaded previously.
You can find more information about uploading builds to Steam and best practices to follow here.
Inside GameMaker, you'll want to compile your application for the relevant platforms. It is advised you export using the following formats:
- Windows - Compressed Application .zip
- Mac OSX - .app.zip (Note that in your Game Options > macOS the "Build for Mac App Store" setting needs to be disabled else this will not build an .app.zip, but a PKG instead. Similarly, do not pick the .dmg output type.)
- Linux (Ubuntu) - Compressed Application .zip
Once you have uploaded your build to Steam, if you run your compiled executable (from within the Content folder or anywhere else) it will now attempt to restart your application and run it under Steam or alternatively you can use the Content Server which to get the same outcome.
With all that working, your game is now integrated with the Steam API and you can begin to add in the functions you want to use (you can find out more information on the Steam API functions from the manual, here: Steam API Functions).
Note that from now on when testing the game within GameMaker Studio 2 the project will connect to the Steam API each time and behave the same as if it had been launched from Steam.
However, note that you will frequently need to submit your testing builds to Steam in order to see any changes you have made, as please remember it’s the copy off Steam which will now be launched each time.
You can see if your game is working correctly as it will pop up the Steam API notification depending on the platform:
IMPORTANT! When testing the Steam API integration in your games, you must have the Steam Client app open, otherwise it will not work.