Traditional online networking techniques account for transmission delays by adding input lag, often resulting in a slow feeling, unresponsive feel. GekkoNet leverages rollback networking with input prediction and speculative execution, allowing player inputs to be processed immediately, creating a seamless, low-latency experience. This means that players enjoy consistent timing, reaction speeds, and muscle memory both online and offline, without the impact of added network lag. Inspired by GGPO and GGRS
I built this because I wanted a SDK to plug into my C++ projects, in the past I have created a wrapper around GGRS for C++ but after having to deal with Rust FFI I decided to build a native alternative instead to more easily fit my projects. GekkoNet is heavily inspired by the GGPO Rust reimplementation GGRS.
I am personally not a big fan of the callback based approach of GGPO hence why I am more of fond of how GGRS handles its control flow. And I might be addicted to reinventing the wheel, this has mostly been a learning experience of mine to learn more about async systems and networking in general :)
- Local/Couch Sessions
- Per Player Input Delay Settings
- Online Sessions
- Local Player Input Delay Settings
- Remote Player Input Prediction Settings
- Spectator Sessions
- Spectator Delay Settings.
- The added ability to spectate spectators. This might be handy if you have a seperate spectating service which propegates the inputs to more spectators.
- Limited Saving
- Save the gamestate less often which might help games where saving the game is expensive. This is at the cost of more iterations advancing the gamestate during rollback.
- Abstracted socket manager.
- Event System for notifications for eg. specific players being done with syncing.
- Desync Detection (Only when limited saving is disabled for now)
- Automated builds
- Network Statistics
- Joining a session that's already in progress as a spectator (and maybe as a player later)
- Replays
- Game engine plugins
- Commission an artist to create a logo for GekkoNet
- Automatically generated Docs: https://heatxd.github.io/GekkoNet/
- Also look at the examples to see how GekkoNet functions!
- The examples are built and ran using Visual Studio 2022
- You will need installed SDL2 as prerequisite
To build GekkoNet, make sure you have the following installed:
- CMake (version 3.15 or higher)
- C++ Compiler:
- GCC or Clang (Linux/macOS)
- MSVC (Visual Studio) for Windows
- Doxygen (optional, for documentation generation if
BUILD_DOCS
is enabled)
First, clone the GekkoNet repository:
git clone https://github.com/HeatXD/GekkoNet.git
cd GekkoNet/GekkoLib
GekkoNet includes several options to customize the build:
BUILD_SHARED_LIBS
: Set toON
to build shared libraries, orOFF
for static libraries (default).NO_ASIO_BUILD
: Set toON
if you do not need ASIO.BUILD_DOCS
: Set toON
if you want to generate documentation using Doxygen (requires Doxygen installed).
To configure these options, use cmake
with -D
flags. For example:
cmake -S . -B build -DBUILD_SHARED_LIBS=ON -DNO_ASIO_BUILD=OFF -DBUILD_DOCS=OFF
Run CMake to configure the build and generate files:
cmake -S . -B build
Once configured, build the project using the following command:
cmake --build build
On successful completion, binaries and libraries will be located in the out
directory within the project.
If you set BUILD_DOCS=ON
, generate the documentation as follows:
cmake --build build --target docs
Documentation will be available in the build/docs
directory as HTML files.
- Library: Located in
out/
, with shared/static suffixes depending on build options. - Documentation (if built): Available in
build/docs/
.
If you have a project using GekkoNet please let me know!
GekkoNet is licensed under the BSD-2-Clause license Read about it here.