

中文 | English
This is a Unity MOD for the game White Knuckle , implementing basic networked player mapping (currently only maps grabbable player capsules).
Important Disclaimer :
Known Issues:
Potential Future Goals:
graph RL
%% Module 1: Player Display
subgraph Player Display
1a[Hand Sprites]
1d[Display Other Players' Held Items]
1e[Custom Hand Sprites]
end
%% Module 2: Player Interaction
subgraph Player Interaction
2b[Item Grabbing/Stealing]
2c[Add New Items]
2e[Respawn After Death]
end
%% Module 3: Data Synchronization
subgraph Data Synchronization
3a["Sync Man-made Structures (Rock Bolts, Rebars)"]
3b[Sync Inventory]
3c[Sync Pickup Items]
3e[Sync Entity Data]
end
%% Dependency Connections (cross-module and within modules)
1a --> 1e
3b --> 1d
1a --> 1d
1d --> 2b
Download the required .dll files from the Releases page and place them into the BepInEx/plugins directory within your game folder.
bash
# 1. Clone this repository locally
git clone https://github.com/Shen-X-L/WKMultiMod.git
# 2. Build the MOD
# Method A: Open and build WhiteKnuckleMod.sln in Visual Studio
# Method B: Use the command line
dotnet build -c Release
WhiteKnuckleMod.dll file into your game directory's BepInEx\plugins\ folder.LiteNetLib.dll file to the same BepInEx\plugins\ folder.text
WhiteKnuckleMod/
├── src/Core/ # Mod core logic
│ ├─ Component/ # Components that depend on game libraries, cannot be moved to Unity project
│ │ ├─ LocalPlayer.cs # Component class, responsible for local player positioning
│ │ └─ RemoteEntity.cs # Component class, responsible for dealing damage to other players
│ ├─ Core/
│ │ ├─ MPConfig.cs # Reads configuration file data
│ │ ├─ MPCore.cs # Core class, handles main events
│ │ └─ MPMain.cs # Startup class, initializes patches
│ ├─ Data/
│ │ ├─ DataReader.cs # Reads data from ArraySegment<byte>/byte[]
│ │ ├─ DataWriter.cs # Writes data to ArraySegment<byte>
│ │ ├─ MPDataSerializer.cs # Serializes/deserializes PlayerData
│ │ └─ MPEventBusNet.cs # Network data bus, facilitates communication between MPCore and MPSteamworks
│ ├─ NetWork/
│ │ ├─ MPLiteNet.cs # (Currently deprecated)
│ │ └─ MPSteamworks.cs # Separated Steam networking logic class
│ ├─ Patch/
│ │ ├─ Patch.cs # Patches for map synchronization via unlock progress + disabled flipping
│ │ ├─ Patch_ENT_Player.cs # Patches for capturing player events
│ │ └─ Patch_SteamManager.cs # Patches for initializing MPCore via SteamManager lifecycle
│ ├─ RemoteManager/
│ │ ├─ RemotePlayerContainer.cs # Handles data updates and logic for a single remote player object
│ │ └─ RemotePlayerManager.cs # Manages lifecycle of all remote player objects
│ ├─ Test/
│ │ └─ Test.cs # Non-game-impacting test functions, allows quick modifications
│ └─ Util/
│ ├─ DictionaryExtensions.cs # Dictionary suffix matching for tpto command
│ ├─ MPDataPool.cs # Thread-isolated read/write object pool
│ ├─ TickTimer.cs # Debug output frequency controller
│ └─ TypeConverter.cs # String-to-bool utility
│
├── src/Shared/ # Extracted Unity component logic for sharing with Unity project for rapid prefab construction
│ ├─ Component/ # Components usable in Unity project
│ │ ├─ LookAt.cs # Forces label to face player, scales label to maintain constant size
│ │ ├─ RemoteHand.cs # Controls hand position via network data
│ │ ├─ RemotePlayer.cs # Controls player position via network data
│ │ ├─ RemoteTag.cs # Controls label content via network data
│ │ └─ SimpleArmIK.cs # Uses IK to connect arm to hand
│ ├─ Data/
│ │ ├─ HandData.cs # Hand position data
│ │ ├─ MPEventBusGame.cs # In-game data bus
│ │ └─ PlayerData.cs # Player position data
│ └─ MK_Component/ # Game-internal components, cannot be directly assigned, handled via mapping components
│ ├─ MK_CL_Handhold.cs # Mapping for in-game CL_Handhold
│ ├─ MK_ObjectTagger.cs # Mapping for in-game ObjectTagger
│ └─ MK_RemoteEntity.cs # Mapping for mod's RemoteEntity
│
├── lib/ # External dependency directory (must be added manually)
│ └── README.md # Dependency acquisition guide
├── WhiteKnuckleMod.sln # Visual Studio solution file
├── WhiteKnuckleMod.csproj # Project configuration file
└── README.md # This document
dotnet restore in the project root directory.lib/README.md to acquire the necessary game DLL files and place them in the lib/ directory.Compiling this project requires referencing some DLL files from the game itself ( these files are copyrighted and must NOT be committed to this repository ), primarily including:
Assembly-CSharp.dllUnityEngine.dllUnityEngine.CoreModule.dlllib/README.md for details).The project file (WhiteKnuckleMod.csproj) is configured with key references and build targets, ensuring TargetFramework is set to netstandard2.1 and allowing unsafe code.
After enabling cheat mode (cheats) in-game, use the following commands:
host <lobby_name> [max_players] - Create a lobby.
host abcdegetlobbyid - Get the lobby room code.join <room_code> - Join a lobby using the room code.
join 109775241951624817talk <text> - Speak via the overhead label.
talk help metpto <steamId(suffix match)> - Teleport between players
tpto 22 (target ID: 561198279116422)getallplayer - Get all player messageAfter enabling cheat mode (cheats) in-game, use the following commands:
host <port> [max_players] - Host a server.
host 22222join <ip_address> <port> - Join an existing host server.
join 127.0.0.1 22222 or join [::1] 22222leave - Leave the current host server.shenxl.MultiPlayerMod.cfg 中
[Network]
## Sets how many times per second data is sent to other players.
# Setting type: Int32
DataSendFrequency = 20
[RemotePlayer]
## This value sets the scale size for player name tags above their heads.
# Setting type: Single
NameTagScale = 1
[RemotePlayerPvP]
##
## DAMAGE TYPE REFERENCE:
## ---------------------
## Note: ×N means deals N instances of this damage type.
##
## * Hammer - Type: Hammer, Damage: 1 (Hammer)
## * Auto Piton - Type: piton, Damage: 3 (Auto Piton)
## * Brick - Type: , Damage: 3 (Brick)
## * Flare Gun - Type: flare, Damage: 6 (Flare Gun)
## * Rebar/Bone Spears - Type: rebar, Damage: 10 (Rebar/Bone spears)
## * Rope Rebar - Type: , Damage: 10 (Rope Rebar)
## * Artifact Spear (throw/return) - Type: returnrebar, Damage: 10 (Artifact Spear)
## * Explosive Rebar - Type: explosion, Damage: 10 - Type: rebarexplosion, Damage: 10 (Explosive Rebar)
## * Cryo-Gun (uncharged/charged) - Type: ice, Damage: 10 - Type: , Damage: 0 × 2 (Cryo-Gun)
##
## The Active configuration item controls the damage multiplier dealt by players.
## The Passive configuration item controls the damage multiplier received by players.
##
## Formula:
## Final Damage = Base Damage × AllActive Multiplier × AllPassive Multiplier × Corresponding Type Active Multiplier × Corresponding Type Passive Multiplier
## Multiplier for all damage dealt by the player.
# Setting type: Single
AllActive = 0.2
## Multiplier for all damage received by the player.
# Setting type: Single
AllPassive = 1
## Multiplier for hammer damage dealt by the player.
# Setting type: Single
HammerActive = 5
## Multiplier for hammer damage received by the player.
# Setting type: Single
HammerPassive = 1
## Multiplier for rebar damage dealt by the player.
# Setting type: Single
RebarActive = 1
## Multiplier for rebar damage received by the player.
# Setting type: Single
RebarPassive = 1
## Multiplier for auto-piton damage dealt by the player.
# Setting type: Single
PitonActive = 1
## Multiplier for auto-piton damage received by the player.
# Setting type: Single
PitonPassive = 1
## Multiplier for flare gun damage dealt by the player.
# Setting type: Single
FlareActive = 1
## Multiplier for flare gun damage received by the player.
# Setting type: Single
FlarePassive = 1
## Multiplier for artifact spear (returnrebar) damage dealt by the player.
# Setting type: Single
ReturnRebarActive = 1
## Multiplier for artifact spear (returnrebar) damage received by the player.
# Setting type: Single
ReturnRebarPassive = 1
## Multiplier for explosion shrapnel (rebarexplosion) damage dealt by the player.
# Setting type: Single
RebarExplosionActive = 1
## Multiplier for explosion shrapnel (rebarexplosion) damage received by the player.
# Setting type: Single
RebarExplosionPassive = 1
## Multiplier for explosion shrapnel (explosion) damage dealt by the player.
# Setting type: Single
ExplosionActive = 1
## Multiplier for explosion shrapnel (explosion) damage received by the player.
# Setting type: Single
ExplosionPassive = 1
## Multiplier for cryo-gun ice spike damage dealt by the player.
# Setting type: Single
IceActive = 1
## Multiplier for cryo-gun ice spike damage received by the player.
# Setting type: Single
IcePassive = 1
## Multiplier for other damage dealt by the player.
# Setting type: Single
OtherActive = 1
## Multiplier for other damage received by the player.
# Setting type: Single
OtherPassive = 1
Welcome to submit Issues for bug reports or suggestions! Pull Requests are also welcome.
Reminder : The code quality in this project is inconsistent, and some is AI-generated. Please keep this in mind when contributing.
git checkout -b feature/YourAmazingFeature).git commit -m 'Add some AmazingFeature').git push origin feature/YourAmazingFeature).