Debugging Steam API

Introduction

Available in the Steamworks Complete asset.
Heathen provides a powerful inspector that will show you the states and values of all Steam API artefacts configured for your project. To Access the inspector simply open the Window > Steamworks Inspector menu.

IMPORTANT

The inspector's data only populate while the simulation is running.
Steam's Documentation has a Debugging article as well ... read it ... its good

Publish Your Changes

When you make any changes in Steam Developer Portal you must publish them before they take effect and can be testing in your game
Use this page to publish all of the metadata that you've used this site to author. You'll need to publish in order to test things like your game depot configuration, new builds, or new achievements you've added. If your game is not yet set to playable, this action will not release the game, but will simply publish configuration changes you've made.
The buttons below invoke source control (Perforce) commands - if you have any trouble with these, just let us know.
The above quote is from the publish page as seen below
The publish page, make sure to publish before you try to test

Environment Checks

Having something wrong with your environment (Unity Editor, Steam.exe, Steam User, etc.) can cause odd issues with Steam API ones that are hard to pin down unless you know what to look for.
Here are some key things to check before you bother trying to debug anything.

Steamworks.NET Install

Did you ever have a manual or custom installation of Steamworks.NET or ever have any asset or tool that had such in your project?
That is at any time was there ever a Steamwork.NET in your project that was not from the Package Manager Git URL install?
If yes; then know that those custom installs would have Steamworks.NET artefacts in multiple folder locations. If that install was present or even partially present from an incomplete attempt to manually remove it then Unity will have ... on install of the proper Steamworks.NET from Package Manager ... attempted to merge the assets and made a complete mess of it.

How to fix

  1. 1.
    Remove the offending files Steamworks.NET manual installs would have installed bits in several different folders (scripts, plugins, examples, etc.) Many old assets would have buried a copy or customized version of Steamworks.NET in there asset.
  2. 2.
    Once you are positive that you fully remove Steamworks.NET and related files from your Assets folder. Remove Steamworks.NET from package manager and then reinstall it

Steam Client Login

For some reason some devs like to run Steam.exe as Admin or run Unity Editor as Admin ... Windows will mangle your callbacks if you do this.
Its important that Unity Editor and Steam.exe are running as the same user, which should also be the user that is logged into the OS in order for Steam API to work properly.
e.g. Do not run either Steam.exe or Unity Editor with elevated or any other non-standard permissions or users. If you do you will have issues.

Steam User

Valve's Steam has a concept of "limited" users ... when a new user is created it is considered limited until it has spent the equivalent of 5 USD on the Steam store or added 5 USD to the Steam wallet.
This applies to dev accounts, publishers, etc. there are no exceptions. So if your account or your test account is new and or has not spent at least 5 USD on Steam odds are its limited by Valve and it will have limited access to Steam API including but not limited to
  • Lobby limits Can join but cant really use a Steam Lobby ... this one is real odd as it will join it but it cant do anything beyond that
  • Chat limits Typically cant chat with anyone
  • Friend limits Typically cant have friends, friend chats, friend invites, etc.
In addition the Steam User your testing the game with MUST own a license to the app to initialize the Steam API. Developer accounts are "supposed" to be granted a dev license to the app ... however we have seen it such that this doesn't happen correctly.
You can test and modify ownership of the app you are a dev for using Steam's command line as outlined in
Debugging the Steamworks API (Steamworks Documentation)

Build Target

Steamworks.NET and as a result all related Steam code is only applicable to PC, Mac and Linux ... not Universal Windows or anything else ... ONLY ... Windows 32, Windows 64, Max OS and Linux 64 platforms.
If your build target is set to ANY other build target then the Steamworks.NET assembly will not compile and will not be available for use.

What about multi-platform games?

use #if DISABLESTEAMWORKS script define you can add this your self if you like to cause Steam API code to simply not compile. You can use it to strip out your Steam related code if you need.

Steamworks Inspector

The Home page of the inspector displays core values for your user and the app its self. This is the first place you should check, and you should do the following
  1. 1.
    Is the Initialization Status = Initialized?
  2. 2.
    Is the Listed App ID what I expect it to be?
  3. 3.
    Is the Reported App ID the same as the Listed App ID
  4. 4.
    Is the steam_appid.txt the same as the Listed App ID
  5. 5.
    Is the displayed user me / who I expect it to be
If you answered no to any of the above questions your issue is on step 1. That is your not configured correctly to initialize Steam and or you do not have the Steam client up and running with a valid user logged in.
If for example you find that the App ID does not match then what you most likely did was to change the App ID in the Steam Settings file but did not fully shut down Unity, Visual Studio and absolutely everything else that might have mounted it; e.g. Unity, Visual Studio or any related process.
The reason this happens is that Valve will not release app initialization until every process that mounted its handles has closed. This is the single most common issue we have reported.

Stats

You can use the Stats tab to view and update the value of all registered stats

Achievements

You can use the Achievements tab to view and unlock/reset all registered achievements

Leaderboards

You can use the Leaderboard's tab to view your score and rank on all registered leaderboards. Leaderboards while one of the simplest aspects of Steam API are also one of the more fragile aspects.
Common issues seen with Leaderboards include
  1. 1.
    You have the sort order set incorrectly
  2. 2.
    You have the leaderboard set to trusted only
  3. 3.
    You made changes in Steam Developer Portal and didn't publish them
We do on occasion see leaderboards "break", this is typically a problem when you change values on the board or delete a board and make a new one with the same name but different settings. In most cases its easiest and best to simply make a new board with a new unique API name.
If you need to repair a board that is misbehaving you will need to contact Valve's support as these are backend features Heathen can not see nor effect.

Downloadable Content

You can view the subscription status of all DLC in the DLC tab

Inventory

The inventory tab will display all the items registered to your game and provides tools for clearing and granting each item

Lobbies

The lobbies tab will populate a sub page for each detected lobby and will display the list of members and the lobby's metadata.