Finite Guild
Published in

Finite Guild

The Simple Guide to Steamworks API in Unity: Uploading Builds

So, you’re working on your Unity game and you’re getting ready to release it on Steam. But the Steamworks API can be intimidating. It’s powerful and useful but you don’t know where to start. Well in this mini series, I’m going to be going over the main features of Steamworks and how to implement them in to your game. For this series, I’ll be using the Steamworks.NET C# wrapper. To get started, all you need to do is download the latest release, import it into your assets and attach the SteamManager script to a GameObject in your starting scene. Also make sure to open the ‘steam_appid.txt’ in your Unity project root and replace the default ID with your game ID. With that, you should be ready to start.

Today I’ll be focusing on Depots and Builds and how you can upload your game builds to Steam for testing. First of all, you’ll need to change a few settings on the Steam Dashboard so Steam knows what to do when launching your game. Open up your Steamworks Dashboard and navigate to “Your Game Name -> Edit Steamworks Settings -> Installation -> General Installation”. If there isn’t a “Launch Option” there already, click the “Add new launch option” button to add one. Edit this launch option and enter the name of your game’s build executable exactly including the file extension. It should look something like “YourGameName.exe”. You can also change the “Operating System” option to your game’s target operating system.

Before continuing, you should also make sure you have a depot. Go to “Steampipe -> Depots” and make sure there is at least one. If there isn’t, click the “Add New Depot” button to add a new depot. For the most part, you can leave the default settings alone. Take note of the “Depot ID”. It should be on the far left of the depot settings. You’ll need this later.

Now that you’ve finished editing the settings on the Steamworks Dashboard, grab the latest version of the Steam SDK from here. Steam’s SDK has a variety of tools but in most cases you’ll only need one: the Content Builder. As such, I won’t really be talking about any of the other tools as my knowledge of them is limited and you more than likely won’t need them anyway. Once you’ve downloaded the ZIP, extract it, open it up and navigate to “tools -> ContentBuilder -> content”. As the txt says, this is where your game content lives. Get your game build and copy it to this folder. That’s all you need to do there for now so go back and open up the “scripts” folder.

Open both the app_build and depot_build vdf’s in any text editor you prefer. Fill out the details in the document with your game’s details. You can leave most of the fields as their defaults for now but in app_build make sure to fill out “appid” with your game’s app ID(you can find this on your Steamworks Dashboard) and replace the numbers in “depot_build_1001.vdf” with your game’s depot number. You may also want to include a simple description of the build and what it contains in the “desc” field. In “depot_build” do the same with the “DepotID” field and finally add the path to the “content” folder in the “ContentRoot” field. The path should look something like this: “C:\Users\George\Documents\sdk\tools\ContentBuilder\content”. Once that’s done, rename the vdf’s so they contain your App Id and Depot ID respectively. So replace the “1000” in “app_build_1000” with your App ID and do the same with “depot_build_1000” and your Depot ID.

Next, go back to the ContentBuilder folder and open up “run_build.bat” in a text editor by right clicking the file and selecting “Edit”. Here, you’ll need to enter your login details. Replace “account” with your username and “password” with your password. Finally, replace the “app_build_1000.vdf” at the end with your app_build vdf’s name which you edited earlier. So basically, replace the “1000” with your game’s App ID. With that done, you should be ready to upload your first build. Close the text editor and double click the bat file to run it. If you’ve done everything correctly, it should run a few commands and eventually start uploading your game files in the Content folder to Steam’s servers. If there’s an error or it isn’t able to complete the upload, it’s possible that you made a typo somewhere. Go back and check both the script files and the bat file, making sure you entered your password, App ID, content root path etc. correctly.

Once the bat finishes uploading your game files it will exit the command line automatically. Open up your Steamworks Dashboard and navigate to “Your Game Name -> Edit Steamworks Settings -> SteamPipe -> Builds”. If there were no issues, you should see the build you just uploaded there. Click the “Select an app branch” dropdown and choose the “default” branch. Then select “Preview Change” and you will be prompted to enter an optional comment before pushing. Feel free to type one before clicking the “Set Build Live Now” button. With that, you’re almost done. Finally, go to the “Publish” tab and click “Prepare for Publishing”. Once that’s done, click “Publish to Steam”, enter the confirmation code “STEAMWORKS” and any internal change notes and click “Really Publish”. Once it’s finished, the game should appear in your Steam library and will be able to be installed after a short delay. If you’ve already uploaded a build before, you will get an update after a short delay instead. Play your game to check it works fine and with that, your game build is now on Steam for you to test!

This is the bare minimum you need to set up your game’s build on Steam. If you’re planning a wider release on a range of operating systems with a range of languages, localisations etc. then you’ll almost certainly need to make some more depots and launch options. Following the same process detailed here with different builds should work just fine in most cases, but you can always refer to the Steamworks Documentation if you run into an issue. I hope this guide was helpful and you managed to get your game build on Steam without issue.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store