Compiling The GodotSteam Server GDExtension 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 GodotSteam Server GDExtension
This is a little different from the modules as we get GodotSteam Server's source first and then Godot's.
Cloning the Source
You can clone the source into a folder called gdextension like so:
git clone -b godot4 https://codeberg.org/godotsteam/godotsteam-server.git gdextension
git clone -b gdextension https://codeberg.org/godotsteam/godotsteam-server.git gdextension
Downloading the Source
Alternatively, you can download the GDExtension source from our repository then unpack it into a folder named gdextension.
Get Godot CPP
Cloning the Source
In most cases, you will want to use the version of godot-cpp that the GodotSteam version defaults to. All you have do is run the following command inside the gdextension folder:
git submodule update --init --recursive
If you instead want to use a different godot-cpp version, you can head into the gdextension folder and clone it like so:
git clone https://github.com/godotengine/godot-cpp.git -b 4.4 godot-cpp
Suggested Minimum Version - 4.3
You will probably want to stick to, at least, godot-cpp version 4.3 since that is when they added the ability to include in-editor documentation. Officially, GodotSteam Server targets 4.4 to keep the widest backwards compatibility.
Downloading the Source
Alternatively, you can download and unpack the Godot CPP source from their Github in a folder called godot-cpp.
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 gdextension/godotsteam_server/sdk/ so you have the following layout:
gdextension/
├─ doc_classes
├─ icons
└─ 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, you will not want to use any GodotSteam version earlier than 4.17.
Double-Checking Folder / File Structure
Before we start compiling, let us make sure everything is in place. Your gdextension directory should look something like this:
gdextension/
│─ bin/
├─ doc_classes/
├─ godot-cpp/
├─ icons/
├─ misc/
├─ plugin/
├─ sdk/
│ ├─ public/*
│ └─ redistributable_bin/*
├─ build_profile.json
├─ config.py
├─ godotsteam.cpp
├─ godotseam.gdextension
├─ godotsteam.h
├─ godotsteam_constants.h
├─ godotsteam_enums.h
├─ godotsteam_multiplayer_peer.cpp
├─ godotsteam_multiplayer_peer.h
├─ godotsteam_project_settings.cpp
├─ godotsteam_project_settings.h
├─ pyproject.toml
├─ register_types.cpp
├─ register_types.h
├─ SConstruct
├─ SCsub
├─ steam_packet_peer.cpp
└─ steam_packet_peer.h
Compiling Time
Just run the following command for your operating system from the gdextension folder root:
GodotSteam Server 4.11 or Newer
The GodotSteam Server 4.11 or newer snippets have a target version which refers to the godot-cpp version you are targeting. For reference, the current official builds target godot-cpp 4.4 so we use api_version=4.4.
scons platform=windows target=template_release api_version=<target version>
scons platform=windows target=template_debug api_version=<target version>
scons platform=linuxbsd target=template_release api_version=<target version>
scons platform=linuxbsd target=template_debug api_version=<target version>
scons platform=macos target=template_release api_version=<target version>
scons platform=macos target=template_debug api_version=<target version>
GodotSteam Server 4.10 or Older
scons platform=windows target=template_release
scons platform=windows target=template_debug
scons platform=linuxbsd target=template_release
scons platform=linuxbsd target=template_debug
scons platform=macos target=template_release
scons platform=macos target=template_debug
All Together Now
When compiling is finished, create a brand new folder somewhere called addons and, inside that, create a folder called godotsteam_server.
Now copy the whole win64/, linuxbsd/, or osx/ folder(s) from within the gdextension/bin/ folder into addons/godotsteam_server/. We will want to rename that linuxbsd folder to linux64 or linux32 depending on what you created.
You will also want to copy the matching Steamworks API file(s) from gdextension/sdk/redistributable_bin/ and put them in with the corresponding platform's folder.
This all sound a little confusing? It should look a little something like this:
addons
└─ godotsteam_server
└─ win64
│─ libgodotsteam_server.windows.template_debug.x86_64.dll
│─ libgodotsteam_server.windows.template_release.x86_64.dll
└─ steam_api64.dll
addons
└─ godotsteam_server
└─ win32
│─ libgodotsteam_server.windows.template_debug.x86_32.dll
│─ libgodotsteam_server.windows.template_release.x86_32.dll
└─ steam_api.dll
addons
└─ godotsteam_server
└─ linux64
│─ libgodotsteam_server.linuxbsd.template_debug.x86_64.so
│─ libgodotsteam_server.linuxbsd.template_release.x86_64.so
└─ libsteam_api.so
addons
└─ godotsteam_server
└─ linux32
│─ libgodotsteam_server.linuxbsd.template_debug.x86_32.so
│─ libgodotsteam_server.linuxbsd.template_release.x86_32.so
└─ libsteam_api.so
addons
└─ godotsteam_server
└─ osx
│─ libgodotsteam_server.macos.template_debug.universal.dylib
│─ libgodotsteam_server.macos.template_release.universal.dylib
└─ libsteam_api.dylib
Lastly, copy the godotsteam_server.gdextension file and the contents of the plugin folder from the gdextension folder and place them into the addons/godotsteam_server/ folder.
This can now be added to any project you have; just pop it into the root of the project and go!
Good to Go
This GDExtension does not have to be enabled as it is always present if the addon is there.
From here you should have access to all of the Steamworks 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!