GodotSteam for Godot Engine

一个开源的、功能齐全的 Steamworks SDK/API 模块和插件,用于 Godot 游戏引擎。「An open-source and fully functional Steamworks SDK / API module and plug-in for the Godot Game Engine.」

Github星跟踪图

GodotSteam for Godot Engine

An open-source and fully functional Steamworks SDK / API module and plug-in for the Godot Game Engine (version 3.x). For the Windows, Linux, and Mac platforms.

Additional flavors include:

Documentation

Documentation is available 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.18.3) of this repo here.

Version 3.18.3 Changes

  • Added: networking type message constants
  • Added: more descriptions and tutorial links to in-editor docs
  • Fixed: getLobbyData not returning UTF-8 encoded string
  • Fixed: sendLobbyChatMsg truncating non-English strings
  • Removed: MarketingMessageFlags as they don't exist in the header files

Version 3.18.2 Changes

  • Changed: minor internal variable names
  • Fixed: filterText truncating input; thanks to tcoxon

Version 3.18.1 Changes

  • Added: link to SDK placeholder
  • Added: more descriptions to in-editor docs
  • Fixed: some regressions that made their way into 3.18

Version 3.18 Changes

  • Added: avatar_image_loaded callback to get raw response from Steamworks
  • Changed: project layout to be Git clone friendly
  • Fixed: getSessionConnectionInfo using old networking struct
  • Fixed: incorrectly named io_failure for steamworks_error signal, thanks to raulsntos
  • Removed: unused networking stricts

You can read more change-logs here.

Known Issues

  • Using MinGW causes crashes. I strongly recommend you do not use MinGW to compile at this time.
  • As of Steamworks SDK 1.53, you cannot compile with previous version of GodotSteam (3.11.1 or earlier) due to a code change in the SDK.
    • Using Steamworks SDK 1.53 or newer, you must use GodotSteam 3.12 or newer.
    • Using Steamworks SDK 1.53 or earlier, you must use GodotSteam 3.11.1 or earlier.

"Quick" How-To

1a. Downloading

By far the easiest way to use GodotSteam is to download our pre-compiled editors and templates; especially good for folks who don't want to set up the tools for compiling and just want to get going.

At this point you can skip all the following steps and check our our tutorials to learn more about integrating Steamworks or just explore the SDK!

1b. Compile Yourself

For those of you who are comfortable compiling or want to give it a shot, here are some steps to follow.

  • Set your system up for compiling based on Godot's recommendations / required tools.
  • Download and unpack the Godot source 3.x.
  • Acquire the GodotSteam source either by downloading it here or cloning the repo:
    • Download this repository then unpack it into a folder called godotsteam inside your Godot Engine source code /modules folder.
      • You will have to create the godotsteam folder and it must be named exactly this.
    • Alternatively, clone this repository into your Godot Engine source code /modules folder
      • Use git clone https://github.com/Gramps/GodotSteam.git godotsteam
  • Download and unpack the Steamworks SDK 1.55.
    • This requires a Steam developer account.
    • Please see "Known Issues" above about versions.

2. Setting Up the SDK

Move the following from the unzipped Steamworks SDK to the /modules/godotsteam/sdk/ folder:

    sdk/public/
    sdk/redistributable_bin/

3. Double-Checking Folder / File Structure

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

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 the godotsteam folder is located.

4. Compiling Time

Recompile for your platform:

  • For editors: scons platform=<your platform> production=yes tools=yes target=release_debug
  • For debug templates: scons platform=<your platform> production=yes tools=no target=release_debug
  • For release templates: scons platform=<your platform> production=yes tools=no target=release

Some things to be aware of:

5. Altogether Now

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).
    • These files are called steam_api.dll, steam_api64.dll, libsteam_api.so, or libsteam_api.dylib; no other files are needed.
  • 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 the editor or game fail and crash when testing or running the game outside of the Steam client.

  • NOTE: Some people report putting the Steam API file inside their project folder fixes some issues.
  • 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. You can read more about it in our Linux Caveats doc.

6. Good To Go

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's documentation.

7. Shipping Your Game

When uploading your game to Steam, you must upload your game's executable and Steam API .dll/.so/.dylb (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; however, they won't hurt anything.

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

License

MIT license

主要指标

概览
名称与所有者GodotSteam/GodotSteam
主编程语言C++
编程语言Python (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2016-04-29 21:11:54
推送于2025-04-01 20:05:58
最后一次提交
发布数158
最新版本名称v4.14 (发布于 )
第一版名称g302-s142-gdn200 (发布于 )
用户参与
星数3.2k
关注者数51
派生数209
提交数205
已启用问题?
问题数0
打开的问题数0
拉请求数193
打开的拉请求数2
关闭的拉请求数18
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?