Skip to content
Steamworks support for Defold using the Defold extension system
C++ C# C Other
Branch: master
Clone or download
Latest commit c7af7c2 Sep 14, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Added Restart() Sep 13, 2019
steamworks Merge branch 'overlay' Sep 14, 2019
.gitignore initial commit Dec 13, 2016 Generated script_api and moved api ref Sep 14, 2019
extension.mtl Merge branch 'overlay' Sep 14, 2019
game.project Added remote storage Sep 16, 2018 Generated script_api and moved api ref Sep 14, 2019 Update Aug 13, 2019 Moved and renamed some stuff Aug 31, 2018
run_x86_64-win32.bat Fix Windows batch file for running Feb 11, 2019
script_api.mtl Generated script_api and moved api ref Sep 14, 2019
steam_appid.txt initial commit Dec 13, 2016


Steamworks support for Defold using the Defold extension system


You can use Steamworks in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:

Or point to the ZIP file of a specific release.

Bundle resources

You need to bundle your app with the required Steam lib. Use the bundle_resources setting in game.project to specify folders to include. The libs you need to include can be found in the steamworks/bundle/ folder.

App ID

The Steamworks API will not initialize if it does not know the App ID of your game. When you launch your app from Steam itself then it will automatically have the App ID available. While developing you will need to hint this to Steam with a text file. Create the a text file called steam_appid.txt next to your executable containing just the App ID and nothing else. This overrides the value that Steam provides. You should not ship this with your builds.


Basic example

function init(self)

	steamworks.set_listener(function(self, event, data)
		if event == "UserStatsReceived_t" then
			print("Got user stats")

	local user_id = steamworks.user_get_steam_id()

Using the SteamAPI

The extension exposes most of the Steamworks functionality through an auto-generated API. Refer to the API Overview for a list of all generated functions, constants and callbacks.

NOTE: Please create a ticket if there's an unsupported API that you need!

Naming convention

Function names are converted to snake case using the following convention:

SteamMatchmaking()->GetLobbyDataByIndex() -> steamworks.matchmaking_get_lobby_data_by_index()
SteamNetworking()->IsP2PPacketAvailable() -> steamworks.networking_is_p2p_packet_available()

Generating the API

The API is generated from the steam_api.json which is part of the Steamworks SDK. The generator is written in Python using a Mustache template, and extension.mtl respectively. Some minor alterations have been made to the steam_api.json definition file.

Example app

Refer to the examples folder for an Defold application that showcases the use of many parts of the API. Build the example app from Defold and run it from the command line using one of, and run_x86_64-win32.bat.

You can’t perform that action at this time.