unity STEAM notes on integration __This article might have deprecated informations__ last updated : 2021-06-09 # Steam partner concepts https://partner.steamgames.com/doc/store/application This is my understanding of what you should be doing. There might be a deeper truth about them but it's a good place to start. 1. depot a depot is where you will upload the game files depot must be "published" to be usable 2. build a build is regrouping 1 or multiple depots and can be associated to a branch this is what the end user will/can download (based on what branch is targeted) ie : you can have the full game and a test build in the same build where each are linked a specific branch 3. branch a branch is what you can setup in steam in the "BETAS" tab joining a branch is by typing the related password (see troubleshoot section below if it doesn't work) # Steam features This is where most of stuff happens : https://partner.steamgames.com/apps/view/[appid] Located in Technical Tools > Edit Steamworks Settings ## app id is whatever is at the end of the url when browsing a project ## Manage Depots Steamworks settings > SteamPipe tab > Manage Depots > Creating & Adding Depots > Add new depot https://partner.steamgames.com/documentation/steampipe Let's say that my app id is 999990. All depot will then be 999991,999992,999993, ... ## Download steam SDK https://partner.steamgames.com/home (download link in the right column) - Unpack the zip and go to folder : "..\steamworks_sdk_[version]\sdk\tools\ContentBuilder\" - Check section "Manage Depots" and make sure you have a depots in the "Configuring Depots" section. edit scripts/app_build_1000.vdf "appbuild" { "appid" "{YOUR APP ID HERE}" "desc" "Initial build" // description for this build "buildoutput" "..\output\" // build output folder for .log, .csm & .csd files, relative to location of this file "contentroot" "..\content\" // root content folder, relative to location of this file "setlive" "" // branch to set live after successful build, non if empty "preview" "0" // to enable preview builds "local" "" // set to flie path of local content server "depots" { "{YOUR DEPOT ID HERE}" "depot_build_1001.vdf" } } edit scripts/depot_build_1001.vdf "DepotBuildConfig" { // Set your assigned depot ID here "DepotID" "{YOUR DEPOT ID HERE}" // Set a root for all content. // All relative paths specified below (LocalPath in FileMapping entries, and FileExclusion paths) // will be resolved relative to this root. // If you don't define ContentRoot, then it will be assumed to be // the location of this script file, which probably isn't what you want //"ContentRoot" "D:\MyGame\rel\master\" "ContentRoot" "{PATH TO YOUR UNITY BUILD FOLDER}" // include all files recursivley "FileMapping" { // This can be a full path, or a path relative to ContentRoot "LocalPath" "*" // This is a path relative to the install folder of your game "DepotPath" "." // If LocalPath contains wildcards, setting this means that all // matching files within subdirectories of LocalPath will also // be included. "recursive" "1" } // but exclude all symbol files // This can be a full path, or a path relative to ContentRoot "FileExclusion" "*.pdb" } ## setup the batch If you have some error and can't read then (closing too fast) you can always edit run_build.bat to remove the "+quit" at the end Don't forget to override your login password in the bat file before uploading builder\steamcmd.exe +login {LOGIN} {PASSWORD} +run_app_build_http ..\scripts\app_build_1000.vdf If everything works it should scan and upload content to the target depot online Then you run the run_build.bat script in the ContentBuilder/ folder ## VERIFY & PUBLISH You can see all the files uploaded on steamworks at Builds tab > "Depots Included" on the recently uploaded build Now to publish and try the game through steam you'll need to go to Builds setup the most recent build to "default" in the "Set Build life for branch" dropdown menu and click the "Preview Change" button next to it. Now if you login to steam with your account you should have the game you uploaded available to download in your game list. ## SETUP LAUNCH OPTIONS Steamworks settings > Installation tab > Configuration > Launch Options > Add New Launch Option Change exe name to whatever your game exe is # Steam DRM Steam drm wrapper doesn't work with .NET applications. Steam recommend to just call a method called `RestartAppIfNecessary`. Steamworks.SteamAPI.RestartAppIfNecessary(SteamUtils.GetAppID()); This method will terminate the app and restart it through steam if the app wasn't launched using steam in the first place. Link to more info : - http://www.aclockworkberry.com/steam-drm-for-unity-3d-games/ # Troubleshooting ## Branches If branches doesn't react to passwords you need to clear download cache https://steamcommunity.com/discussions/forum/1/4300317773571966840/#c4300317773572067760 ## Debugview Launching this tool before starting your game will show steam related log output not supported within unity (all logs coming from dlls) https://technet.microsoft.com/en-us/sysinternals/bb896647.aspx?f=255&MSPPError=-2147217396 ## Failed to init() I had the "[Steamworks.NET] SteamAPI_Init() failed" within unity and debugview told me [8984] [S_API FAIL] SteamAPI_Init() failed; no appID found. [8984] Either launch the game from Steam, or put the file steam_appid.txt containing the correct appID in your game folder. You need to have a steam_appid.txt with your app id inside for steam integration to work. ## Steam publishing notes https://www.youtube.com/watch?v=SoNH-v6aU9Q