Steam API for the Godot game engine

Overview

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.10.4) 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

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.

    linux windows compiling 
    opened by EIREXE 96
  • 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

    linux overlay 
    opened by psy-q 56
  • 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.

    bug windows 
    opened by Yomic 47
  • 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?

    windows exporting 
    opened by Fischer96 47
  • 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.

    bug 
    opened by pracedru 45
  • 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

    bug 
    opened by Reapetitive 35
  • 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!

    question windows 
    opened by KevBRR 35
  • "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);

    [email protected] ~/godot-2.1/bin $ ls godot.x11.opt.64.llvm godot.x11.tools.64.llvm libsteam_api.so [email protected] ~/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

    linux shared library 
    opened by Domarius 35
  • 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?

    macos 
    opened by Zeolow 32
  • 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)

    enhancement 
    opened by ghost 31
  • 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.

    bug ugc / workshop 
    opened by rokasv 29
  • 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 ?

    enhancement 
    opened by simcolin 1
  • 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.

    bug ugc / workshop 
    opened by Lyaaaaaaaaaaaaaaa 2
  • 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.

    bug ugc / workshop 
    opened by Lyaaaaaaaaaaaaaaa 6
Releases(g351-s155-gdn351)
Owner
GP Garcia
I like to make stuff and games.
GP Garcia
Stealthy way to hijack the existing game process handle within the game launcher (currently supports Steam and Battle.net). Achieve external game process read/write with minimum footprint.

Launcher Abuser Stealthy way to hijack the existing game process handle within the game launcher (currently supports Steam and Battle.net). Achieve ex

Ricardo Nacif 80 Nov 25, 2022
Improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World.

OpenXRay OpenXRay is an improved version of the X-Ray Engine, the game engine used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World. S

null 2.2k Jan 1, 2023
Godex is a Godot Engine ECS library.

Godex Godex is a Godot Engine ecs library. Disclaimer: this module is still in development, open an issues to report any problem or a new discussion i

GodotECS 767 Jan 9, 2023
Godot bindings for the Rapier3D physics engine

Godot bindings for the Rapier3D physics library How to use There are two parts: A Godot module which must be compiled with the engine.

David Hoppenbrouwers 28 Dec 26, 2022
The Atomic Game Engine is a multi-platform 2D and 3D engine with a consistent API in C++, C#, JavaScript, and TypeScript

The Atomic Game Engine is a multi-platform 2D and 3D engine with a consistent API in C++, C#, JavaScript, and TypeScript

null 2.8k Dec 29, 2022
Legit DLC Unlocker for Steam, Epic, Origin, EA Desktop & Uplay (R1)

?? Koalageddon ?? Legit DLC Unlocker for Steam, Epic, Origin, EA Desktop & Uplay (R1) Welcome to the Koalageddon repository. For user-friendly introdu

null 586 Jan 6, 2023
CLUSEK-RT is a complex game engine written in C++ and the successor of the CLUSEK game engine

CLUSEK-RT is a complex game engine written in C++ and the successor of the CLUSEK game engine. This engine has been designed with a cross-platform design in mind. Thanks to Vulkan API it delivers a next-gen experience with ray tracing to both Linux and Windows platforms

Jakub Biliński 48 Dec 29, 2022
Ground Engine is an easy to use Game Engine for 3D Game Development written in C++

Ground Engine is an easy to use Game Engine Framework for 3D Game Development written in C++. It's currently under development and its creation will b

 PardCode 61 Dec 14, 2022
Flax Engine – multi-platform 3D game engine

Flax Engine – multi-platform 3D game engine

Flax Engine 3.7k Jan 7, 2023
MAZE (My AmaZing Engine) - 🎮 Personal open-source cross-platform game engine

MAZE (My AmaZing Engine) is the self-written open-source cross-platform game engine in the active development stage. At the moment it is my main pet project, developed for the purpose of learning and preserving different game dev technologies.

Dmitriy Nosov 13 Dec 14, 2022
Rogy-Engine- - My 3D game engine source code.

Rogy-Engine Development My 3D game engine. (NOT THE FINAL VERSION- Windows only) Features: PBR shading and reflection probes with parallax correction.

AlaX 97 Dec 28, 2022
Hyperion Engine is a 3D game engine written in C++

Hyperion Engine About Hyperion Engine is a 3D game engine written in C++. We aim to make Hyperion be easy to understand and use, while still enabling

null 293 Jan 1, 2023
Minetest is an open source voxel game engine with easy modding and game creation

Minetest is an open source voxel game engine with easy modding and game creation

Minetest 8.3k Dec 29, 2022
Game Boy, Game Boy Color, and Game Boy Advanced Emulator

SkyEmu SkyEmu is low level cycle accurate GameBoy, GameBoy Color and Game Boy Advance emulator that I have been developing in my spare time. Its prima

Sky 321 Jan 4, 2023
A high speed C++17 Vulkan game engine

Acid is an open-source, cross-platform game engine written in modern C++17 and structured to be fast, simple, and extremely modular. Vulkan is the sol

Equilibrium Games 1.4k Dec 30, 2022
Pure C Game Engine

Corange game engine Version 0.8.0 Written in Pure C, SDL and OpenGL. Running Corange is a library, but to take a quick look at some of the things it d

Daniel Holden 1.6k Dec 27, 2022
The flexible game engine.

The flexible game engine. Crown is a general purpose and data-driven game engine, written in orthodox C++ with a minimalistic and data-oriented design

Daniele Bartolini 1.7k Dec 28, 2022
Open-source, cross-platform, C++ game engine for creating 2D/3D games.

GamePlay v3.0.0 GamePlay is an open-source, cross-platform, C++ game framework/engine for creating 2D/3D mobile and desktop games. Website Wiki API De

gameplay3d 3.9k Jan 8, 2023
Grit Game Engine

Grit Engine This is the central repository for the Grit Game Engine project. From here can be built the engine executable itself, the launcher, and va

Grit Game Engine 103 Dec 7, 2022