Facepunch.Steamworks Wiki

About Facepunch.Steamworks

What Is Steamworks?

Steamworks is a set of APIs made available by Valve to allow developers to create integrations with Steam.

This ranges from the simple things like getting the local player's name, to more complicated things like server lists and UGC (Workshop Stuff).

What is Facepunch.Steamworks?

Valve's Steamwork library is written in C++. Due to the popularity of Unity a lot of game development is now done in C#.

Facepunch.Steamworks is a C# wrapper on top of Valve's steamwork library.

How does it differ from Steamworks.Net?

Steamworks.NET aims to be a faithful wrapper with the C++ version. Facepunch.Steamworks is a re-interpretation of the Api in a C# world. Here's an example

Getting Friends List on Steamworks.Net:

int friendCount = SteamFriends.GetFriendCount(EFriendFlags.k_EFriendFlagImmediate); for (int i = 0; i < friendCount; ++i) { CSteamID friendSteamId = SteamFriends.GetFriendByIndex(i, EFriendFlags.k_EFriendFlagImmediate); string friendName = SteamFriends.GetFriendPersonaName(friendSteamId); EPersonaState friendState = SteamFriends.GetFriendPersonaState(friendSteamId); Debug.Log( $"{friendName} is {friendState}"); }

Getting Friends List on Facepunch.Steamworks:

foreach ( var friend in SteamFriends.GetFriends() ) { Console.WriteLine( $"{friend.Id}: {friend.Name}" ); Console.WriteLine( $"{friend.IsOnline} / {friend.SteamLevel}" ); }

Where can I get it?

You can download a release on the Github Page.

How to build from Master branch

Download the latest Steamworks SDK that Facepunch.Steamworks is compatible with. As of right now it is version 150, available for download here

Copy the following folder and it's contents into your Unity project: \sdk\redistributable_bin

Clone the repository locally

Open the solution file (Facepunch.Steamworks.sln) in Visual Studio

In the toolbar select build > build solution

Navigate to the Face.Steamworks folder and copy the contents of: \Facepunch.Steamworks\bin\Debug\net46 to your Unity project.

The last step is to set the .dll files to have the correct settings. Follow these steps in Unity now that you've copied the files over:

  • Facepunch.Steamworks.Posix.dll:

    • Any Platform: Unchecked
    • Include Platforms: Editor, Standalone
    • Platform Settings:
      • CPU: Any
      • OS: OSX
      • Switch tabs:
        • Windows: all unchecked
        • Linux and OSX: all checked
  • Facepunch.Steamworks.Win32.dll:

    • Any Platform: Checked
    • Include Platforms: Both Unchecked
    • Platform Settings:
      • CPU: x86
      • OS: Windows
      • Switch tabs:
        • Windows: check x86
        • everything else: Unchecked
  • Facepunch.Steamworks.Win64.dll:

    • Any Platform: Checked
    • Include Platforms: Both Unchecked
    • Platform Settings:
      • CPU: x86_64
      • OS: Windows
      • Switch tabs:
        • Windows: check x86_64
        • Linux and OSX: Unchecked