nalchi is a C++23 library that provides utilities for efficient message sending over ValveSoftware/GameNetworkingSockets.
- Efficient multicast support with reference counted
nalchi::shared_payload
. - Bit-level serialization support with
nalchi::bit_stream_writer
&nalchi::bit_stream_reader
See https://nalchi-net.github.io/nalchi/ for the full API reference.
If you want to use nalchi with C#, you can with NalchiSharp, the C# binding of nalchi.
Don't forget to bring the C++ shared libraries too, without it the binding won't work.
nalchi supports either building with the stand-alone version of GameNetworkingSockets or Steamworks SDK version of it.
If you don't need the Steamworks SDK integration because you're building your game for platforms other than Steam,
you can build the stand-alone GameNetworkingSockets which is licensed under the BSD 3-Clause "New" or "Revised" License.
- Recursively clone this repo to get GameNetworkingSockets/ submodule.
- Prepare the dependencies of the GameNetworkingSockets.
- Refer to the
BUILDING.md
on GameNetworkingSockets.- If you're using Developer Powershell for VS 2022 on Windows, do note that it defaults to x86 environment, which obviously doesn't work when building for the AMD64.
You need to switch to AMD64 environment manually with following:Enter-VsDevShell -DevCmdArguments "-arch=x64 -host_arch=x64" -VsInstallPath "C:/Program Files/Microsoft Visual Studio/2022/Community" -SkipAutomaticLocation
- If you're using Developer Powershell for VS 2022 on Windows, do note that it defaults to x86 environment, which obviously doesn't work when building for the AMD64.
- Refer to the
- Run
cmake --preset nalchi-gns
to configure.- If you're on Windows, you need to specify the vcpkg toolchain file location with
CMAKE_TOOLCHAIN_FILE
variable.
You could create a seperateCMakeUserPresets.json
which inherits thenalchi-msvc-gns
preset to do this. e.g:And then you can run{ "version": 6, "configurePresets": [ { "name": "my-preset", "inherits": "nalchi-msvc-gns", "cacheVariables": { "CMAKE_TOOLCHAIN_FILE": "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" } } ] }
cmake --preset my-preset
instead.
- If you're on Windows, you need to specify the vcpkg toolchain file location with
- Depending on the preset, different build directory must have been created.
Runcmake --build <build directory>
to build.
If you need to integrate with Steamworks SDK to make use of other Steamworks API functionality, you can build with Steamworks SDK.
- Download the Steamworks SDK from the Steamworks partner site.
- Unzip it, and copy the
public/
andredistributable_bin/
into the sdk/ directory. - Run
cmake --preset nalchi-steamworks
to configure.- If you're on Windows, you might want to run
cmake --preset nalchi-msvc-steamworks
instead. - If you're using Developer Powershell for VS 2022 on Windows, do note that it defaults to x86 environment, which obviously doesn't work when building for the AMD64.
You need to switch to AMD64 environment manually with following:Enter-VsDevShell -DevCmdArguments "-arch=x64 -host_arch=x64" -VsInstallPath "C:/Program Files/Microsoft Visual Studio/2022/Community" -SkipAutomaticLocation
- If you're on Windows, you might want to run
- Depending on the preset, different build directory must have been created.
Runcmake --build <build directory>
to build.
nalchi is licensed under the MIT License.
This project depends on either the stand-alone GameNetworkingSockets or the Steamworks SDK.
- Stand-alone GameNetworkingSockets is licensed under the BSD 3-Clause "New" or "Revised" License.
- Refer to the GameNetworkingSockets' GitHub repo for other dependencies' licenses.
- Steamworks SDK is licensed under the STEAMWORKS SDK license.