6
0
Fork 1
mirror of https://github.com/HeatXD/GekkoNet.git synced 2026-07-08 10:30:28 +02:00
P2P Rollback Game Networking SDK https://heatxd.github.io/GekkoNet/
  • C++ 90.5%
  • C 6.1%
  • CMake 3.4%
Find a file
Jamie Meyer 02c447c9d6 Move internal headers out of the public include directory
Relocate the library's private headers from GekkoLib/include into
GekkoLib/include/private so that only gekkonet.h remains on the public
include path. This avoids name conflicts (e.g. net.h, input.h) for
projects that add the library include directory to their own path.

- CMake: add include/private as a PRIVATE include dir so the library
  sources still resolve the relocated headers.
- MSBuild: add include/private to the project include path and export
  only the public include dir to consumers (PublicIncludeDirectories +
  AllProjectIncludesArePublic=false); fix the stale header listings.

Fixes #47
2026-06-28 20:18:39 +02:00
.github/workflows Update release.yml 2025-08-23 20:29:50 +02:00
.vscode Redo CMakeLists.txt for FetchContent support & add VSCode configs 2025-08-21 11:11:13 +03:00
docs/images Backend rework (#34) 2025-12-01 02:48:13 +01:00
Examples Add local session example 2026-06-16 22:17:50 +02:00
GekkoLib Move internal headers out of the public include directory 2026-06-28 20:18:39 +02:00
.clang-tidy Redo CMakeLists.txt for FetchContent support & add VSCode configs 2025-08-21 11:11:13 +03:00
.cmake-format.json Redo CMakeLists.txt for FetchContent support & add VSCode configs 2025-08-21 11:11:13 +03:00
.editorconfig Redo CMakeLists.txt for FetchContent support & add VSCode configs 2025-08-21 11:11:13 +03:00
.gitattributes Add .gitattributes and .gitignore. 2024-04-22 04:00:17 +02:00
.gitignore Add local session example 2026-06-16 22:17:50 +02:00
CMakeLists.txt Redo CMakeLists.txt for FetchContent support & add VSCode configs 2025-08-21 11:11:13 +03:00
GekkoNet.sln Add local session example 2026-06-16 22:17:50 +02:00
LICENSE Stress Session. for checking local desyncs (#42) 2026-02-08 12:57:07 +01:00
README.md Add runahead support to GameSession (#45) 2026-04-15 12:22:39 +02:00

GekkoNet

C/C++ Peer To Peer Game Networking SDK

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

Why?

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.

Why not use GGPO?

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 :)

Project Goals

Done

  • Local/Couch Sessions
    • Per Player Input Delay Settings
  • Online Sessions
    • Local Player Input Delay Settings
    • Remote Player Input Prediction Settings
    • Runahead Support
      • Locally simulate ahead speculatively to hide input delay, keeping input feeling responsive regardless of network conditions.
  • Spectator Sessions
    • Spectator Delay Settings.
  • Stress Sessions
    • To help find desyncs it your local state, This is a local session which constantly rolls the simulation back over a user-specified check distance.
  • 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

Work in progress

  • Joining a session that's already in progress as a spectator (and maybe as a player later)

Maybe Later

  • Replays
  • Game engine plugins

Getting Started

Docs

Building Examples

  • The examples are built and ran using Visual Studio 2022
  • The examples require SDL3 to function

Building GekkoLib

Prerequisites

To build GekkoNet, make sure you have the following installed:

  1. CMake (version 3.15 or higher)
  2. C++ Compiler:
    • GCC or Clang (Linux/macOS)
    • MSVC (Visual Studio) for Windows
  3. Doxygen (optional, for documentation generation if BUILD_DOCS is enabled)

Step-by-Step Instructions

1. Clone the Repository

First, clone the GekkoNet repository:

git clone https://github.com/HeatXD/GekkoNet.git
cd GekkoNet/GekkoLib

2. Configure Build Options

GekkoNet includes several options to customize the build:

  • BUILD_SHARED_LIBS: Set to ON to build shared libraries, or OFF for static libraries (default).
  • NO_ASIO_BUILD: Set to ON if you do not need ASIO.
  • BUILD_DOCS: Set to ON 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

3. Generate Build Files

Run CMake to configure the build and generate files:

cmake -S . -B build

4. Build the Project

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.

5. (Optional) Build Documentation

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.

Build Output

  • Library: Located in out/, with shared/static suffixes depending on build options.
  • Documentation (if built): Available in build/docs/.

Projects using GekkoNet

If you have a project using GekkoNet please let me know!

License

GekkoNet is licensed under the BSD-2-Clause license Read about it here.

The GekkoNet logo is made by the amazing NoisyChain