Compiling The GodotSteam Server From Scratch
Set Up Tools
Follow Godot's documentation to setup the required tools for your operating system.
CI/CD
There is also a repository for scripts that are used to build GodotSteam which are mostly based on Godot's official build containers and build scripts. You can tweak these to fit your setup if you want to automate building.
Get Godot
Cloning the Source
You can clone the latest Godot source in a folder called godot like so:
git clone https://github.com/godotengine/godot.git -b 4.7.2-stable godot
git clone https://github.com/godotengine/godot.git -b 3.6.2-stable godot
You may need to change the given tag above to whatever the current version is or whatever version you need.
Branch Recommendation
Using Godot's master branch may produce weird errors due to WIP changes. It is recommended you only use stable versions to build for production.
Downloading the Source
Alternatively, you can download and unpack the Godot source from their Github into a folder called godot.
Get GodotSteam Server
Cloning the Source
Head into the godot/modules/ folder and clone the source like so:
git clone -b godot4 https://codeberg.org/godotsteam/godotsteam-server.git godotsteam_server
git clone -b godot3 https://codeberg.org/godotsteam/godotsteam-server.git godotsteam_server
Downloading the Source
Alternatively, you can download the branch you need from our repository then unpack it into a folder named godotsteam_server inside your Godot source godot/modules/ folder.
Get the Steamworks SDK
Download the Steamworks SDK from Valve's partners site. This requires a Steam developer account.
Move the public and redistributable_bin folders from the unzipped Steamworks SDK into the godot/modules/godotsteam_server/sdk/ so you have the following layout:
godot/
└─ modules/
└─ godotsteam_server/
└─ sdk/
├─ public/*
└─ redistributable_bin/*
A Windows Note
When compiling with MSVC, there is nothing special you need to do. However, if you are using MinGW to compile Windows versions, you will want to use GodotSteam Server version 4.8 or newer.
Double-Checking Folder / File Structure
Before we start compiling, let us make sure everything is in place. Your godot directory should look something like this:
godot/
└─ modules/
└─ godotsteam_server/
├─ doc_classes/
├─ godot-cpp/
├─ icons/
├─ misc/
├─ plugin/
├─ sdk/
│ ├─ public/*
│ └─ redistributable_bin/*
├─ build_profile.json
├─ config.py
├─ godotsteam_server.cpp
├─ godotsteam_server.gdextension
├─ godotsteam_server.h
├─ godotsteam_server_constants.h
├─ godotsteam_server_enums.h
├─ godotsteam_server_project_settings.cpp
├─ godotsteam_server_project_settings.h
├─ pyproject.toml
├─ register_types.cpp
├─ register_types.h
├─ SConstruct
└─ SCsub
You can also just put the godotsteam_server directory where ever you like and just point to it in SCONS when compiling:
custom_modules='../path/to/dir/godotsteam_server'
Compiling Time
To compile editors, use this SCONS line:
scons platform=<your platform> target=editor
scons platform=<your platform> production=yes tools=yes target=release_debug
To compile debug templates, use this SCONS line:
scons platform=<your platform> target=template_debug
scons platform=<your platform> production=yes tools=no target=release_debug
To compile release templates, use this SCONS line:
scons platform=<your platform> target=template_release
scons platform=<your platform> production=yes tools=no target=release
A Linux Note
If using Ubuntu 16.10 or higher and having issues with PIE security in GCC, use LINKFLAGS='-no-pie' to get an executable instead of a shared library.
All Together Now
When the compiling is finished, make sure to copy the Steam shared library, for your operating system, from godot/modules/godotsteam_server/sdk/redistributable_bin/ folder to the newly-compiled Godot binary location.
By default, it should be in the godot/bin/ folder. You can move them to a new location as long as you keep the two files together.
Missing Shared Library
A lack of the Steam API .dll/.so/.dylib for your respective OS will cause the editor or game to fail and crash when testing or running the game outside of the Steam client.
A General Note
Some people report putting the Steam API file inside their project folder fixes some issues.
A Mac Note
For MacOS, the libsteam_api.dylib must be in the Content/MacOS/ folder in your application zip or the game will crash.
A Linux 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.
Good to Go
From here you should have access to all of the Steamworks Server SDK functions and callbacks.
You should be able to read the Steamworks API documentation to see what all is available and cross-reference with GodotSteam's documentation.
Feel free to check out our tutorials if you want to learn some basics or just start tinkering!