Steam API for the Godot game engine

GodotSteam for Godot Engine

Steam API for the Godot game engine (version 3.x). For the Windows, Linux, and Mac platforms.

Additional flavors include:

Documentation

Documentation is available here and there is the project's Wiki page here.

You can also check out the Search Help section inside Godot Engine after compiling it with GodotSteam.

Feel free to chat with us about GodotSteam on the CoaguCo Discord server.

Current Build

You can download pre-compiled versions (currently v3.11) of this repo here.

Version 3.11 Changes

  • Added: server branch merged into master
  • Changed: spacing in default arguments in godotsteam.h
  • Changed: renamed STEAM_GAMESERVER_CALLBACK as STEAM_CALLBACK
  • Removed: SteamGameServer_RunCallbacks function

Version 3.10.5 Changes:

  • Added: more helper functions for newer networking classes, translations for steamnetworkingtypes
  • Fixed: lots of compiler warnings on Linux, thanks to gregcsokas

Version 3.10.4 Changes

  • Added: new helper functions for newer networking classes, translations for steamnetworkingtypes
  • Fixed: default argument inputInit function, thanks to hhyyrylainen

Version 3.10.3 Changes

  • Changed: various internal variable / arguments names for clarity, will affect signal-returned dictionaries

Version 3.10.2 Changes

  • Removed: not logged in as error condition in steamInit function

Version 3.10.1 Changes

  • Changed: various compilation errors for OSX, thanks to SapphireMH
  • Removed: receiveRelayAuthTicket, findRelayAuthTicketForServer, getHostedDedicatedServerAddress, and getGameCoordinatorServerLogin as they rely on datagram header that was removed from base SDK

Version 3.10 Changes

  • Added: various Steam Deck specific functions, thanks to EIREXE
  • Added: new AppLists class of functions and callbacks
  • Added: new or missing App functions, callbacks, and enums
  • Added: OverlayToWebPageMode enum and unread_chat_messages_changed callback for Friends class
  • Added: new Input functions and callbacks
  • Added: new Parental Settings fuctions, callback, and enums
  • Added: new Remote Storage functions, callback, and enums
  • Added: new UGC functions, callbacks, and enum
  • Added: memory allocation corrections
  • Changed: updated various Input class functions
  • Changed: lots of argument names internally, has no effect on usage
  • Fixed: some enum names
  • Fixed: various server list filter functions in Matchmaking Servers class
  • Fixed: receivedRelayAuthTicket, getGameCoordinatorServerLogin, FindRelayAuthTicketForServer in Networking Sockets class
  • Removed: second call for steam_api.h in godotsteam.cpp

Known Issues

  • Using MinGW causes crashes. I strongly recommend you do not use MinGW to compile at this time.

Quick How-To

  • Download this repository and unpack it.
  • Download and unpack the Steamworks SDK 1.52; this requires a Steam developer account.
  • Download and unpack the Godot source 3.x.
  • Move the following to godotsteam/sdk/ folder:
    sdk/public/
    sdk/redistributable_bin/
  • The repo's directory contents should now look like this:
    godotsteam/sdk/public/*
    godotsteam/sdk/redistributable_bin/*
    godotsteam/SCsub
    godotsteam/config.py
    godotsteam/godotsteam.cpp
    godotsteam/godotsteam.h
    godotsteam/register_types.cpp
    godotsteam/register_types.h
  • Now move the "godotsteam" directory into the "modules" directory of the unpacked Godot Engine source.

    • You can also just put the godotsteam directory where ever you like and just apply the custom_modules=.../path/to/dir/godotsteam flag in SCONS when compiling. Make sure the custom_modules= flag points to where godotsteam is located.
  • Recompile for your platform:

  • When recompiling the engine is finished do the following before running it the first time:

    • Copy the shared library (steam_api), for your OS, from sdk/redistributable_bin/ folders to the Godot binary location (by default in the godot source /bin/ file but you can move them to a new folder).
    • Create a steam_appid.txt file with your game's app ID or 480 in this folder. Necessary if the editor or game is run outside of Steam.
  • The finished hierarchy should look like this (if you downloaded the pre-compiles, the editor files go in place of these tools files, which are the same thing):

    • Linux 32/64-bit
    libsteam_api.so
    steam_appid.txt
    ./godot.linux.tools.32 or ./godot.linux.tools.64
    
    • MacOS
    libsteam_api.dylib
    steam_appid.txt
    ./godot.osx.tools.32 or ./godot.osx.tools.64
    
    • Windows 32-bit
    steam_api.dll
    steam_appid.txt
    ./godot.windows.tools.32.exe
    
    • Windows 64-bit
    steam_api64.dll
    steam_appid.txt
    ./godot.windows.tools.64.exe
    
  • Lack of the Steam API DLL/SO/DyLib (for your respective OS) or the steam_appid.txt will cause it fail and crash when testing or running the game outside of the Steam client.

    • NOTE: For MacOS, the libsteam_api.dylib and steam_appid.txt must be in the Content/MacOS/ folder in your application zip or the game will crash.
    • NOTE: For Linux, you may have to load the overlay library for Steam overlay to work:
    export LD_PRELOAD=~/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so;~/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so
    
    or 
    
    export LD_PRELOAD=~/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so;
    export LD_PRELOAD=~/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so;
    

    This can be done in an .sh file that runs these before running your executable. This issue may not arise for all users and can also just be done by the user in a terminal separately.

From here you should be able to call various functions of Steamworks. You should be able to look up the functions in Godot itself under the search section. In addition, you should be able to read the Steamworks API documentation to see what all is available and cross-reference with GodotSteam.

  • When uploading your game to Steam, you must upload your game's executable and Steam API DLL/SO/DyLIB (steam_api.dll, steam_api64.dll, libsteam_api.dylib, and/or libsteam_api.so). Do not include the steam_appid.txt or any .lib files as they are unnecessary.

Donate

Pull-requests are the best way to help the project out but you can also donate through Patreon or Paypal!

License

MIT license

Owner
GP Garcia
I like to make stuff and games.
GP Garcia
Comments
  • Cross-compiled game from linux to windows crashes on startup

    Cross-compiled game from linux to windows crashes on startup

    Versions of the engine compiled with MinGW seem to crash on windows after initialization, steamworks initializes properly and the game just quits, nothing in the logs.

    This is my output:

    Godot Engine v3.2.beta.custom_build.12482bf88 - https://godotengine.org
    OpenGL ES 3.0 Renderer: Radeon RX Vega
    
    WARNING: set_native_icon: No small icon found, reusing 128x128 @32768 icon!
         At: platform/windows/os_windows.cpp:2845
    Setting breakpad minidump AppID = 1216230
    Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198041958539 [API loaded no]
    [INFO] SteamServiceProvider: Steamworks active.
    

    Compiling this natively on windows with MSVC works.

  • Game crashes when Steam overlay is enabled

    Game crashes when Steam overlay is enabled

    I had this issue on two games (Ex-Zodiac and satryn deluxe): Before the game finishes initializing, it crashes. But only if Steam Overlay is enabled. I can get the game to start with the wrapper suggested in "Known Issues":

    #!/bin/bash
    export LD_PRELOAD=~/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so;~/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so
    ./satryn\ deluxe.x86_64_real
    

    This prevents the crash but the overlay still doesn't work. This is on openSUSE Tumbleweed. I'm attaching an strace and the Steam system info. If there's anything more I can help try, I'd be happy to.

    satryn2.trace.gz satryn2.trace.zip steaminfo.txt

  • Game crash on Steam.steamInit() in editor only

    Game crash on Steam.steamInit() in editor only

    Using both the pre-compiled version of the 3.1.1 editor and a version I compiled myself when I try to run any code with just the line: Steam.steamInit() in my _ready() function, the game itself will crash, but not with an error the Godot editor can handle.

    Using VS 2015 to debug it returns the following error:

    `Unhandled exception at 0x00007FF6457C16C0 in windows-311-min-editor-64bit.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

    Exception thrown at 0x0000000000000000 in windows-311-min-editor-64bit.exe: 0xC0000005: Access violation executing location 0x0000000000000000.

    Unhandled exception at 0x0000000000000000 in windows-311-min-editor-64bit.exe: 0xC0000005: Access violation executing location 0x0000000000000000.`

    Then it repeats the last two errors

    OS Version: Windows 8.1 Processor: i7-4720HQ GPU: GTX 960M Ram: 16GB

    This error occurs regardless if Steam is running or not.

    This error DOES NOT occur if I export the game and run it separately from the editor.

    This error DOES NOT occur using the same compiled versions of Steam Godot editor on my Windows 7 Pro PC with similar specs (i7, GTX 980, 32GB ram)

    Edit 1:

    In addition, I can still run individual scenes even if they have SteamAPI related functions in them, although they obviously don't function due to steamInit() never being called.

  • GodotSteam with Godot 3.1 RC

    GodotSteam with Godot 3.1 RC

    So, was just compiling Godot 3.1 RC with GodotSteam module and it's not working correctly and i'm also not quite sure what to change in GodotSteam actually. The engine itself is running and the Steam singleton is found but it crashes without any information or does nothing when calling Steam functions. Any ideas?

  • Large performance drops compared to official Godot 3.2.3

    Large performance drops compared to official Godot 3.2.3

    I am experiencing very large performance drop comparing the latest 3.2.3 GodotSteam build to the official 3.2.3 Godot build. 215ms pr frame compared to 16.666 ms pr frame. official build: image steam build: image

    Looking at the profiler the Physics seem to have gained time. But the overall frame time is a lot grater than the physics time.

  • Physics Time Spikes in GodotSteam-3.4.4-stable-editor-win64

    Physics Time Spikes in GodotSteam-3.4.4-stable-editor-win64

    Hi! In the normal Godot 3.4.4 stable my project runs pretty well, without any real problems. In the GodotSteam-3.4.4-stable-editor-win64 version though, without me even using any Steam class methods the project gets weird Physics Time spikes according to the profiler, like every second it has a spike up to 70 ms. So the project stutters. Edit: some further testing shows bad performance around the globe. Editor is hanging, other maps/levels, if not spiking in physics time, spike in idle time etc. Any idea?

    Windows 10 latest version

  • FromSource

    FromSource

    Not an important issue, or an issue at all really.

    Just wondered if there was a way to get the sourceID of a game server, iterate and check whom is on the game server.

    Using,

    Steam::getFriendCountFromSource(uint64_t clanID)
    Steam::getFriendFromSourceByIndex(uint64_t sourceID, int friendNum)
    

    If it's possible to be in the main menu of the game and access game servers remotely iterating through who's on one of the specific game server. Or if there is another way of doing it.

    Thank you!

  • "Cannot open shared object file" but it's there!

    I've just followed the "How to" up to the point of including the shared object file in "5. Copy Steamworks Redistributables"

    I'm in Ubuntu and compiling Godot 2 with GodotSteam 2. The SteamWorks shared object file is right there in the folder with the executable but I still get the error about not being able to find the shared object. Here's the output of the terminal (I've clipped the path name for brevity);

    domarius@Domarius-Ubuntu ~/godot-2.1/bin $ ls godot.x11.opt.64.llvm godot.x11.tools.64.llvm libsteam_api.so domarius@Domarius-Ubuntu ~/godot-2.1/bin $ ./godot.x11.opt.64.llvm ./godot.x11.opt.64.llvm: error while loading shared libraries: libsteam_api.so: cannot open shared object file: No such file or directory

  • Overlay not working on OSX Catalina ( 10.15 )

    Overlay not working on OSX Catalina ( 10.15 )

    I have an issue with the overlay for my project, and I believe it has something to do with this: Skärmavbild 2020-11-16 kl  17 18 36 This is from the overlay documentation on Steam's website : https://partner.steamgames.com/doc/features/overlay How would you solve this? Where can you access the build configuration?

  • steamworks p2p

    steamworks p2p

    Hey, if im correct the whole steam networking part is not yet supported. Are there any plans to implement it in the near future? I realy like godot but i also need the p2p networking from steam and i dont think there is any other way of achieving this in a reasonable easy way, without switching the game engine (Unity, Unreal)

  • Content Querying omits returning FileID, needed for getting the file

    Content Querying omits returning FileID, needed for getting the file

    I want to make use of User Generated Content, but can't because the function

    https://github.com/Gramps/GodotSteam/blob/e3acb6b783644102f61609a6d658ae9716eca211/godotsteam/godotsteam.cpp#L4768

    skips returning the most important piece of information from the Steam structure: m_nPublishedFileId


    In other words, this line:

    ugcResult["fileID"] = (uint64_t)pDetails.m_nPublishedFileId;
    

    is missing from the linked code and makes UGC querying useless.

  • Add a `flag` parameter to `getFriendCount()` to match Steamworks features

    Add a `flag` parameter to `getFriendCount()` to match Steamworks features

    See steamworks doc : https://partner.steamgames.com/doc/api/ISteamFriends#GetFriendCount

    This would allow to get for exemple personas that requested current account as friend.

    Maybe leave the currently used flag by default if no flag parameter is provided to avoid making this a breaking change ?

  • setReturnOnlyIDs and setReturnMetadata don't work yet return true

    setReturnOnlyIDs and setReturnMetadata don't work yet return true

    Describe the bug the UGC setReturnOnlyIDs and setReturnMetadata have no effect on the ugc request. I suspect it is the same for the similar functions described in https://partner.steamgames.com/doc/api/ISteamUGC#SendQueryUGCRequest

    To Reproduce Steps to reproduce the behavior:

    1. Have an app with a workshop to test
    2. Call createQueryUserUGCRequest with the following parameters: USER_UGC_LIST_PUBLISHED WORKSHOP_FILE_TYPE_COMMUNITY and USERUGCLISTSORTORDER_CREATIONORDERDESC
    3. Call setReturnOnlyIDs(handler, true) or setReturnMetadata(handler, true)
    4. Call sendQueryUGCRequest(handler)
    5. Call getQueryUGCResult(handler)
    6. Print the content and compare the result after changing the parameters on step 6

    Expected behavior By calling setReturnOnlyIDs(true) it should return IDs instead of all the details on the pending UGC Query. By calling setReturnMetadata(true) it should return the metadata with the rest of the query.

    Desktop (please complete the following information): Linux pop-os 6.0.6-76060006-generic #202210290932~1667401208~22.04~d2df702 SMP PREEMPT_DYNAMIC Wed N x86_64 x86_64 x86_64 GNU/Linux

    Version of Godot: 3.5.1

    Version of GodotSteam: Steamworks 1.55 - GodotSteam 3.18.3 (Pre-compiled version)

    Additional context The bool returned by setReturnOnlyIDs and setReturnMetadata is true though.

  • setItemTags leads to unexpected results

    setItemTags leads to unexpected results

    Describe the bug I try to use setItemTags to define multiple tags at the same time. Sometimes it works as expected, sometimes it doesn't.

    To Reproduce Steps to reproduce the behavior:

    1. Have an app with a workshop to test (this might be a difficult part for you, except if you have some app for testing purpose)
    2. Update an item with startItemUpdate
    3. Call setItemTags and gives him the following tags ["scenario", "dark", "lorebook-included"]
    4. Submit update with submitItemUpdate

    Expected behavior The item should have the following tags: scenario, dark, lorebook-included on every execution.

    Screenshots By repeating the execution, I managed to have the correct result: correct_result

    But then, for testing, I executed the testing code once again and got this Failed_Run

    The Scenario tag disappeared

    Moreover, I executed the code 3 more times and the 5th time I managed to get the expected result 5th run

    Desktop (please complete the following information):

    Linux pop-os 6.0.6-76060006-generic #202210290932~1667401208~22.04~d2df702 SMP PREEMPT_DYNAMIC Wed N x86_64 x86_64 x86_64 GNU/Linux
    

    Version of Godot: 3.5.1

    Version of GodotSteam: Steamworks 1.55 - GodotSteam 3.18.3 (Pre-compiled version)

    Additional context I upgraded from the 3.5.0 to 3.5.1 and the behavior is the same.

    Thank you for your help.

Kakoune syntax highlighting for the Godot Engine / Godot Scripting Language gdscript
Kakoune syntax highlighting for the Godot Engine / Godot Scripting Language gdscript

gdscript-kak Kakoune syntax highlighting for the Godot Engine / Godot Scripting Language gdscript. Adds basic syntax highlighting to your .gd files fo

Mar 2, 2021
Lobby - A Nox game lobby which exposes a simple HTTP API for both listing and registering Nox game servers

Nox lobby server This project provides a Nox game lobby which exposes a simple H

Mar 6, 2022
Powered by Matterbridge, MatterAMXX is a plugin for AMXX that allows simple bridging between your game servers, Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, and more.
Powered by Matterbridge, MatterAMXX is a plugin for AMXX that allows simple bridging between your game servers, Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, and more.

Powered by Matterbridge, MatterAMXX is a plugin for AMXX that allows simple bridging between your game servers, Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, and more.

Dec 27, 2022
Tool for extract NSP file from fitgirl-repacks switch emulated game

FITGIRL-REPACKS-NSP This is a tool/executable for Windows to extract Fitgirl Repack switch emulated package game into its own NSP. You may need to get

Dec 25, 2022
a go mini version TCP top on UDP for game connections or others.

sanhua sanhua(三花猫) is kind of cat with black, red and white color. This is a mini version TCP top on UDP, but with out resend lost packet. As we know.

May 31, 2022
Implementing SPEEDEX price computation engine in Golang as a standalone binary that exchanges can call

speedex-standalone Implementing SPEEDEX price computation engine in Golang as a standalone binary that exchanges can call. Notes from Geoff About Tato

Dec 1, 2021
Simple Nginx Load Balancing Use Docker Engine
Simple Nginx Load Balancing Use Docker Engine

Load Balancing Menggunakan Nginx Load Balancing adalah sebuah mekanisme untuk membagi atau mendistribusikan trafik ke beberapa server. Nginx selain be

Dec 14, 2021
Core is the next-generation digital data engine.
Core is the next-generation digital data engine.

tKeel-Core The digital engine of world ?? Core is the data centre of the tKeel IoT Open Platform, a high-performance, scalable and lightweight next-ge

Mar 28, 2022
An implementation of the Information Concealment Engine cipher in Go
An implementation of the Information Concealment Engine cipher in Go

An implementation of the Information Concealment Engine cipher in Go

Jan 26, 2022
Grcon - Lib for Source Engine's RCON protocol in Go

grcon A basic Golang library for the RCON Protocol. Features Max control over th

Mar 5, 2022
The Akita CLI for watching network traffic, automatically generating API specs, and diffing API specs.

Catch breaking changes faster Akita builds models of your APIs to help you: Catch breaking changes on every pull request, including added/removed endp

Jan 2, 2023
An API Client package for Studyplus for School SYNC API

Studyplus for School SYNC API Client This project is currently alpha, possibility having breaking changes. studyplus_for_school_sync_go is a API clien

Aug 2, 2021
Go API Client for Metasploit RPC API

go-msf-rpc Golang based RPC client to communicate with Metasploit. Based on code initially developed by Wyatt Dahlenburg repo. Extended to include oth

Nov 18, 2022
iceportal-api is a Golang client implementation to interact with the REST API of iceportal.de when connected to the WiFi-Network offered in German ICE Trains.
iceportal-api is a Golang client implementation to interact with the REST API of iceportal.de when connected to the WiFi-Network offered in German ICE Trains.

iceportal-api is a Golang client implementation to interact with the REST API of iceportal.de when connected to the WiFi-Network offered in German ICE Trains.

Aug 20, 2022
Go-db-connection-api - API REST in Go that connect to SQL DB and manage task of projects

Go Todo REST API Example A RESTful API example for simple application with Go It

Jan 26, 2022
Go PowerDNS 4.x API Client

PowerDNS 4.x API bindings for Golang This community project provides bindings for the currently latest version of PowerDNS Authoritative Server. Featu

Dec 12, 2022
Pure Go implementation of the WebRTC API
Pure Go implementation of the WebRTC API

Pion WebRTC A pure Go implementation of the WebRTC API New Release Pion WebRTC v3.0.0 has been released! See the release notes to learn about new feat

Jan 1, 2023
Go language interface to the Libcircle distributed-queue API

Circle Description The Circle package provides a Go interface to the Libcircle distributed-queue API. Despite the name, Circle has nothing to do with

Oct 24, 2022
Pusher Channels HTTP API library for Go

Pusher Channels HTTP Go Library The Golang library for interacting with the Pusher Channels HTTP API. This package lets you trigger events to your cli

Dec 19, 2022