Using The Steamworks SDK With GMS2

Now that you have your Steamworks Partner account and your application all set up you'll need to obtain the Steamworks SDK. As GameMaker: Studio 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 GameMaker: Studio. 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 article:

Once you know which SDK version you need, you need to go to the Steamworks page and select it for downloading:


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 location which is easy to reach such as "C:\Steamworks" as you'll need to access this for multiple things later in this tutorial.

Now, within GameMaker Studio 2, open your Preferences and navigate to the Platform SettingsSteam section. Point the Steamworks SDK Location field to where you previously extracted this to:


Setting up your game to work with Steam

Once you have your Steamworks SDK set up correctly you'll need to now configure your GameMaker Studio 2 game to use it. This is done by first opening the Game Options and then navigating to the Main Options > General section. Here you need to input the unique App ID that was given to your game when registered through the Steamworks dashboard:


This will tell GameMaker Studio 2 which Steam app you will be targeting when using the STeam API functions. However, it does not enable Steam. For that you now need to navigate to the PLatform Settings in the Game Options, and select the Steam platforms that you will want to target (Windows, macOS, Ubuntu) and check the Enable Steam checkbox for each one that you will want to compile for:


Once you've put in the correct ID and enabled the Steam check box for each target, 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.


IMPORTANT! When testing the Steam API integration in your games, you must have the Steam Client app open, otherwise it will not work.


Uploading your application to Steam

Now that you have set up Steam and GameMaker Studio 2 to both understand each other it's time to upload your game. This is done using a tool within the Steamworks SDK which we downloaded previously.

Navigate to the Steamworks SDK folder and open the Tools folder. This contains the two sub folders Content Builder and Content Server. Content Builder is what we use to upload our applications to Steam whereas Content Server allows us to emulate the Steam Servers but run our content locally before uploading. As we only care about the Content Builder for now, open this folder and you'll see three further folders which are important: builder (Choose the builder folder relevant for your operating system), content and scripts.

First open the relevant builder folder and then run steamcmd, this will build the steam content builder upon first run which we need for future use, although we won't need to run it specifically as we have a batch file which runs this for us. Navigate up a folder and open the scripts folder, you'll see two .vdf files, one is relevant for your game and the other is for a specific Depot. It's highly advised that you rename each script to contain the relevant AppID or DepotID.

Open your app_build_AppID.vdf script first in a text editor, and change the AppID to your AppID as it is shown on the Steamworks site. In the depots section change the DepotID to to the relevant DepotID shown on the Steamworks site as well, and make sure that the depot script is named correctly. If you plan to upload more than one Depot then add in more lines with the correct DepotID as well as script names. Once you've finished editing this script save it, and it should look something like the following:


Open one of your depot_build_DepotID.vdf scripts and change the DepotID to your DepotID shown on the Steamworks site. Then change the ContentRoot folder location to the content folder within your Steamworks folder such as C:\Steamworks\tools\ContentBuilder\scripts. Next change the LocalPath to be a relevant folder such as ".\Windows_Content\*" as per the above example of a Depot. Once you've filled out all your Depot scripts correctly save them.


Navigate up a folder and now open the content folder. This is where your game content goes, based on what you put as the LocalPath in the Depot Scripts. These folders should exist here as this is where we will export our game. Open up GameMaker Studio 2 now and 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 - (Note that in your Game Options > Packaging setting "build for Mac App Store" needs to be disabled else this will not build an App but a PKG instead)
  • Linux (Ubuntu)  - .zip

When you have built all your relevant compiled applications check that the contents of the .zip files are extracted within the correct content folders as this is what is uploaded to Steam. Your folders should look something like this for each platform (the exact contents may differ depending on whether you have compiled with the VM or the YYC):


Once you have the content folders ready, navigate up to the ContentBuilder folder and edit the run_build.bat file. This will run steamcmd, login with your account and run the app_build_AppID script to upload our build to Steam. First though, you'll need to edit the information within this file to match your user name, password as well as the correct app_build script:


Once the batch file has been run it will upload your build to Steamworks and you will receive a message stating whether this was successful or a failure and information about why it failed.

Assuming it was successful, navigate back to the Steamworks site and open the landing page for your application. Click on Edit the Steamworks Settings of your application and click the Builds tab. This will show you what was uploaded as well as the Depots Included. You will then need to set the app branch which allows your app to become "live":


The final task is to set up the Launch Options within the Steamworks developer console. This is found under App Admin[YourAppName]InstallationGeneral section:


In the following image you can see how this should look for the three main platforms:


Once all of this has been completed, if you run the compiled executable that you just uploaded to Steam (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 was previously mentioned 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 too and behave the same as if it had been launched from Steam.





Have more questions? Submit a request


Article is closed for comments.