Once you have your Steamworks Partner account and your application all set up you'll need to obtain the Steamworks SDK. Since the GameMaker Studio 2 runtime is built to use specific SDKs you'll need to make sure that you are using the correct version of the SDK for the correct version of the GameMaker Studio 2 runner. This information can be found on our Required SDKs page.
NOTE: If you have not yet registered as a Steamworks Partner please see the following guides: Getting Started with Steamworks
Once you know which version you need then navigate to https://partner.steamgames.com/downloads and select the correct version.
Once you have obtained the correct Steamworks SDK you'll need to extract it to a location which GameMaker Studio 2 can point to. It's advised you put it in a short path location which is easy to reach such as <drive>:\Steamworks as you'll need to access this for multiple things later in this tutorial.
Within GameMaker Studio 2, you need to open the Preferences and navigate to the Steam tab. Point the Steamworks SDK Location field to where you previously extracted the SDK:
Set Up Your Project To Work With Steam
Now that you have the Steam SDK installed, you'll need to configure your GameMaker Studio 2 project to know about Steam and communicate with the SDK. This is done by opening your Game Options on the Main window, where you'll see that it has a field for supplying the Steam ID:
Once you have added the Steam ID for the project here, you then need to open the Game Options for each of the platforms you want to target and on the General page, select the Enable Steam checkbox, as illustrated in the image below for Windows:
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 within the Steamworks SDK which we downloaded previously.
You can find more information about uploading builds to Steam and best practices to follow here.
In Game Maker Studio you'll want to compile your application for the relevant platforms. It is advised you export using the following formats:
- Windows - Compressed Applications zip
- Mac OSX - .app.zip (Note that in your Global Game Settings build for Mac App Store needs to be disabled else this will not build an App but a PKG instead)
- Linux (Ubuntu) - .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.