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
| Feature | Description |
|---|---|
| Network connection & MOD verification | Host/client connection with forced MOD list consistency |
| Character reading | recordStatus Hook + GameWorld fallback |
| Character position/HP sync | Host broadcasts selected character state |
| Gold read/write | Pointer chain based, depends on character selection |
| World time sync | Reads getTimeStamp, client writes to TimeManager |
| Reconnection | 90s timeout, IP-persistent, cross-day recovery |
| Crash protection | SEH 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.