Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Steam Intergration

Sabien edited this page Jun 10, 2020 · 4 revisions

Steam Integration

In order to publish and integrate a game to Steam we need to follow a few important steps.

Join the Steamworks distribution program

To use Steamworks.NET you must already be a Steamworks developer. Basically we need to fill some paperwork, pay the fee (it's 100$ per game). For more details I'll have some links below.

Links:

https://partner.steamgames.com/steamdirect

Steamworks.NET

Steamworks.NET is a C# Wrapper for Valve’s Steamworks API and is completely free and open source under the permissive MIT license. Basically, what it does it enables Steam, it ensures that your games is launched from Steam and nowhere else. If it's launched from anywhere else, the application gets closed and relaunches within Steam. It also ensures that after you closed the application, Steam also registers that you closed it.

Installation

Download the Unity package from the Steamworks.NET github page.Import everything into Assets/ folder. The editor scripts included in the package, create a file called steam_appid.txt. We need to replace the default 480 number in that file, with our games AppID (it's like an original number of the game on Steam and every game has it). Relaunch Unity to update the file we changed.

Getting Started

The SteamManager is a script that makes it run easy and smooth. If we are using Steamworks.NET from the .unitypackage simply we can import it directly into our game. Otherwise if we cloned Steamworks.NET from Github we must download the SteamManager.cs script manually. Once the SteamManager script is in the project simply create a new empty GameObject in your first scene and add the SteamManager script to it.

It's pretty well explained in the Steamworks.NET documentation. Further reads in the links below.

Important notes

SteamAPI.RestartAppIfNecessary

The first Steamworks function call which the script makes is SteamAPI.RestartAppIfNecessary((AppId)480). Replace 480 with your own AppId!

private void Awake() {
	try {
		if (SteamAPI.RestartAppIfNecessary((AppId)480)) {
				Application.Quit();
				return;
			}
		}
	catch (System.DllNotFoundException e) {
		Debug.LogError("[Steamworks.NET] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + e, this);

		Application.Quit();
		return;
	}
}

Links:

https://steamworks.github.io/

https://blog.theknightsofunity.com/integrating-unity-game-steamworks/

https://github.com/rlabrecque/Steamworks.NET/releases

Before we publish our Game

It's not like super important for us since the game is going to be free and without any microtransactions (we'll probably talk about it in the future before we release it).

Store Page

The main page of our game on Steam. We can set it up earlier and update it on along the way, so that people maybe add it the their wishlist or follow it and stay up to date. The description of the game should be simple and concise, use some bulletpoints for better readability. Make some gifs!

Write down what Steam features game has for example: single player, steam achievements, steam trading cards... What languages you can choose in game, localization. Media links and so on.

Trailer

Brief video to showcase our game, it should be around 1 min to 1 min 30 seconds.

Screenshots

Around 6 good screenshots showing different aspects of the game. Remember to disable the UI!

Tags

Steam tags help Steam classify your game, which will help choose where our game will appear in the Steam store. Choose the tags appropriate to genre and playstyle. There is a section "More Like This" where our game could show up on store pages of similar games. It can also recommend similar games to the game you played.

Steam Features

  • Steam Achievments (I think it's pretty important, I myself love achievments, some people may not play the game if there are no achievments there)
  • Steam Leaderboards
  • Steam Cloud (store save files and options)
  • Steam Trading Cards
  • some more perhaps...

Workshop

Since we will have that level editor, we want players to make their own maps, score them if they are any good, upload and download them. Customizable characters, skins and so on...

How to make the level editor work with the workshop: https://api.fragsurf.com/map-editor/setting-up-the-map-editor

Developer Page

When someone likes the game, they can follow this page and get updates about this and future games.

Localization

If we want other languages to be set in our game.

Analytics Diagnostics

Cloud diagnostics is a Unity feature for tracking crashes and errors. Use Application.targetFrameRate so its the games runs smooth even on older PC

Links:

https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html