Experimental multiplayer for Kingdom Come: Deliverance II.
Warning
KCD2MP v0.0.9 is a prototype, not a production-ready multiplayer mod. Expect breaking changes, incomplete world simulation, compatibility limits, and loss of multiplayer-world data while development continues. Use test saves and keep backups of anything important.
| Current version | 0.0.9 |
| Development stage | Prototype / technical preview |
| Networking | Direct IP, dedicated authoritative server |
| Platform | Windows x64 |
| Supported game | Steam build 23914554, game version 1.5 |
| Supported WHGame | 1308617_856 |
KCD2MP uses one project version across the client, server, build metadata, and network handshake. During the prototype phase, clients and servers must run the exact same KCD2MP version. There is no separate user-facing "protocol version". See CHANGELOG.md for version history.
- Direct-IP client/server connection with authentication and reconnect support
- Persistent server sessions and player profiles
- Remote-player spawning, movement, appearance, equipment, and weapon state
- Native inventory and equipment reconciliation with rollback
- Server-authoritative doors and loot containers
- Supported containers: regular chests, cart chests, stash corpses, bird nests, and destructible stashes
- Server-authoritative dropped items, pickup ownership, and restart persistence
- Shared time-of-day, time scale, and weather
- Independent human- and animal-NPC isolation controls
- Signature and Address Library validation before native hooks are enabled
NPC world synchronization, quests, dialogue state, combat AI, and complete cooperative world progression are not implemented yet. Native NPCs can be isolated, but they are not currently replicated as shared server entities.
The detailed implementation status and current limits are documented in docs/multiplayer.md.
KCD2MP keeps its two runtime boundaries separate:
d3d12.dllprovides the mod-loader and ImGui frontend.dinput8.dllhosts KCSE.KCD2MPKCSEClient.dllowns the in-game multiplayer client and native game integration.KCD2MPServer.exeis a standalone dedicated server and does not load KCD2.
The project is based on KCD2ModLoader and ReturnOfModdingBase. It pins F02K/libKCD2 and F02K/Address-Library-For-KCSE as vendor dependencies.
Native engine access is capability-gated. A client join verifies the game build, KCSE/libKCD2 runtime, Address Library identity, required native features, content fingerprint, and KCD2MP version before entering the world. Runtime objects never cross the frontend/client ABI boundary.
Requirements:
- Windows 10 or Windows 11
- Python 3.9 or newer
- CMake
- Visual Studio with the MSVC x64 C++ workload
Initialize the pinned vendor repositories after cloning:
powershell -ExecutionPolicy Bypass -File tools/init_vendor.ps1Run build.bat from the repository root. On first launch, the build tool
creates an isolated .venv-build environment and installs its pinned Python
dependencies.
The terminal UI can:
- build Debug or optimized Release artifacts with symbols;
- run native, protocol, server, networking, and deployment tests;
- discover the Steam installation or remember a manual game path;
- audit the installed
WHGame.dllbefore deployment; - validate and deploy the pinned Steam/GOG/Epic Address Library tables; and
- deploy both loaders and the KCSE client plugin.
Every successful build also creates a clean package tree under
out/package/<debug|release>/:
client/ install-ready game tree and KCD2MP-Client-v0.0.9.zip
server/ dedicated server, configuration, data, symbols, and audit tool
tests/ test executables and their symbols only
SHA256SUMS.txt
The client ZIP starts with KingdomComeDeliverance2/ and mirrors the same
relative paths used by Build & Deploy. It can therefore be extracted directly
into the Steam steamapps/common directory. See
Build and release packaging for the exact layout and
standalone packaging command.
Build & Deploy never starts or stops the game. Close KCD2 before deployment so
Windows can replace the runtime DLLs.
Copy server.toml.example to server.toml, select the sandbox level_id, and
start the server:
KCD2MPServer.exe server.tomlThe common retail world IDs are:
2— Trosky region (trosecko)3— Kuttenberg region (kutnohorsko)4— Monastery (klaster)
The server listens on UDP port 27020 by default. Allow and forward that port
only when hosting outside the LAN.
Persistent session data, player profiles, synchronized world objects, and
dropped items are stored below world_directory. Writes use temporary sibling
files followed by atomic replacement. Native save files are never uploaded to
or read by the dedicated server.
Available server commands include status, players, kick, say,
profile claim, dummy spawn, dummy remove, entities, time, timescale,
weather, stop, and help.
dummy spawn [name] creates a non-persistent simulated player from the current
starter profile. Equipped starter items use the normal remote-equipment path.
After a two-second spawn warm-up and short input buffers, the server sends brief
walk and turn inputs through ordinary transform snapshots. Translation stays at
the authoritative spawn point: the native client locomotion controller must move
and animate the actor, and every stop re-anchors it. This safely exercises the
same animation path as real player input without letting a test dummy wander off
terrain. Native weapon actions are excluded until their runtime path is verified.
- Start KCD2 and choose Multiplayer in the main menu or pause menu.
- Select Server, Name, or Password to edit the value. Confirm with Enter, cancel with Escape, and paste with Ctrl+V.
- Choose Connect. No savegame is required: from the title screen the server bootstrap starts KCD2's native New Game path directly in the configured level. From the pause menu, an already loaded matching level is adopted.
The in-game UI follows KCD2's current g_language setting. Editable UTF-8
translations are installed in <game-root>\mods\KCD2MP\Lang\; English is the
fallback when no file exists for the selected game language.
The client waits for NewGame, PreDataLoaded, DataLoaded, the target
wh_sys_BaseLevelId, the local actor, and the native capability probe before it
applies the multiplayer profile and sends WorldReady. A different active level
is rejected until synchronized live travel is enabled. Failed native prerequisites
time out with a concrete loading phase instead of forcing the loading screen away.
For manual deployment:
- Copy
d3d12_.dllbesideKingdomCome.exeand rename it tod3d12.dll. - Copy KCSE's
dinput8.dllbesideKingdomCome.exe. - Copy
KCD2MPKCSEClient.dllto<game-root>\mods\KCD2MP\KCSE\Plugins\. - Copy the matching Address Library table to
<game-root>\KCSE\addresslib\. - Copy
data\lang\*.langto<game-root>\mods\KCD2MP\Lang\.
The default Steam binary directory is:
KingdomComeDeliverance2\Bin\Win64MasterMasterSteamPGO
To uninstall the runtime, remove or rename d3d12.dll, dinput8.dll, and
mods\KCD2MP\KCSE\Plugins\KCD2MPKCSEClient.dll.
Debug and Release builds expose an output-only diagnostic console. Successful startup reports the detected PE fingerprint, signature validation, and enabled hooks. The build tool can run the same signature audit without starting KCD2.
Automated coverage includes protocol validation, server lifecycle and persistence, player profiles, identity storage, remote avatars, container and door conflicts, dropped-item ownership, environment state, native capability gates, deployment behavior, and Address Library coverage.
In-game multi-client soak tests, save-directory comparison, fault injection, and full NPC/quest simulation remain manual or future work.
- Multiplayer architecture and status
- Version history
- libKCD2/KCSE migration audit
- Vendor integration
- Build and release packaging
The inherited modding layer also provides Lua plugin loading and hot reload,
Dear ImGui Lua bindings, FMOD integration, ASI loading, XML merging, and debug
inspection tools. The example plugin is in
examples/plugins/KCD2MP-TestMod.