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
  • THe previous pre-compiled version seems to been made instead of the current/latest

    THe previous pre-compiled version seems to been made instead of the current/latest

    Not a GodotSteam issue itself, maybe a Github Actions one(?) but noticed and thought it should be pointed out. Under Releases g351-s155-gs3175 Assets It shows (platform)-g35-s155-gs3174.zip instead of (platform)-g351-s155-gs3175.zip Not sure if they are just mislabeled or if the previous version instead of current was remade/listed.

    bug compiling 
    opened by AnnA-Ayms 1
  • [GD4] Silent crash when using Steam.getInstalledApps(int) after init

    [GD4] Silent crash when using Steam.getInstalledApps(int) after init

    Describe the bug Godot app will silently crash without errors when calling Steam.getInstalledApps(int) after steam is initialized with Steam.steamInit()

    To Reproduce Steps to reproduce the behavior:

    1. Call Steam.steamInit()
    2. Call Steam.getInstalledApps(1)
    3. Run and crash

    Expected behavior Not crash, print an array containing int installed apps

    Screenshots image

    Desktop (please complete the following information):

    • OS: Windows 10
    • Version 10.0.19043 Build 19043

    Version of Godot: Godot 4 Beta1 - Steamworks 1.55 - GodotSteam 4.1.3 Godot Engine v4.0.beta.custom_build.4ba934bf3

    Version of GodotSteam: GodotSteam 4.1.3

    Additional context Minimal reproduction project getInstalledAppsCrash.zip

    bug 
    opened by ynot01 2
  • [Roadmap Question] Plan for integration specific multiplayer peer in godot 4 for steam sockets?

    [Roadmap Question] Plan for integration specific multiplayer peer in godot 4 for steam sockets?

    Are there plans for possible integration of a specific peer using steam sockets for godot 4? just like Unity does with its transports. Tell me if this is possible? It would be an easy integration with https://github.com/godotengine/godot/blob/master/scene/main/multiplayer_peer.h ?

    enhancement question multiplayer 
    opened by ScriptsEngineer 10
  • Avatar Loaded callback doesn't map to Steamworks description

    Avatar Loaded callback doesn't map to Steamworks description

    Currently in GodotSteam, the avatar_loaded callback gives connected methods the Steam ID of the player changed, the size of the square image, and the actual data buffer of the loaded avatar.

    This is different from the Steamworks description of how this callback works; instead, Steamworks returns the Steam ID, an index into the image cache, and the height and width as separate values. Read more here: https://partner.steamgames.com/doc/api/ISteamFriends#AvatarImageLoaded_t

    We should add a new callback to map this more accurately without breaking old code. This is low urgency.

    enhancement 
    opened by polyrain 2
  • Issues with Steam Remote Play Together

    Issues with Steam Remote Play Together

    Steam Remote Play Together "Input is temporarily disabled while the host is busy" Why is this displaying when attempting to play with a friend? I've tried different friends but the same. I'm using Godot, with GodotSteam addon. I can send invites, but once the two players connect it shows this error.

    image

    remote play 
    opened by martynbiz 4
Releases(g351-s155-gs3175)
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 77 Sep 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.1k Oct 2, 2022
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 721 Sep 27, 2022
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 Sep 20, 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 Oct 2, 2022
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 36 Sep 28, 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 56 Aug 15, 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 480 Oct 4, 2022
Flax Engine – multi-platform 3D game engine

Flax Engine – multi-platform 3D game engine

Flax Engine 3.6k Sep 30, 2022
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 11 Jan 9, 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 95 Sep 30, 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 219 Oct 1, 2022
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 8k Oct 5, 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 211 Sep 29, 2022
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 Oct 6, 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.5k Sep 29, 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 Oct 1, 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.8k Oct 2, 2022
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 104 Aug 12, 2022