Back to projects
Game DevActive

Kenshi Multiplayer

An external multiplayer module for Kenshi using DLL injection, exploring cooperative gameplay without modifying game binaries or MOD system.

C++CMakeWin32 APIminiupnp

Overview

This project explores the feasibility of adding cooperative multiplayer to the single-player game Kenshi through DLL injection and memory hooking techniques. It implements a host-client architecture for character state synchronization without modifying game binaries or the MOD system. Currently at v0.1.0 (basic framework validation).

Technical Approach

The multiplayer core is implemented in C++ with CMake build system, using miniupnp for NAT traversal:

  • KenshiMultiplayer.exe — Launcher responsible for injection and session management
  • KenshiMP_Core.dll — Injected DLL core implementing state synchronization via memory offsets

Implemented Features

FeatureDescription
Network connection & MOD verificationHost/client connection with forced MOD list consistency
Character readingrecordStatus Hook + GameWorld fallback
Character position/HP syncHost broadcasts selected character state
Gold read/writePointer chain based, depends on character selection
World time syncReads getTimeStamp, client writes to TimeManager
Reconnection90s timeout, IP-persistent, cross-day recovery
Crash protectionSEH handler + minidump

Limitations

Current implementation is a basic framework validation only. Full game world state synchronization is not yet supported.

References

Offset source priority: KenshiLib > RE_Kenshi > Cheat Engine tables. Licensed under AGPL-3.0.