Shared multiplayer protocol forbevy_kbve_net
A Bevy 0.20 + lightyear 0.31 networking crate defining KBVE's shared multiplayer protocol — the replicated components, inputs, messages, and channels both client and server compile against.
One protocol, both halves
It defines the lightyear protocol — replicated components, player input types, message payloads, and channels — that both the client and the server compile against, so both halves agree on the wire format.
What it gives you
Features
Shared protocol plugin
ProtocolPlugin registers the replicated components, inputs, messages, and channels once for both sides.
Rich message surface
Auth handshake, position and vitals sync, damage events, inventory and equipment updates, crafting and item deploy requests, creature capture and state events, skill XP grants, time sync, and username set flows.
lightyear backend
Replication, prediction, interpolation, native input, and netcode; the client feature adds WebSocket, WebTransport, and UDP transports (plus a wasm32 WebSocket path for browser builds).
Optional feature set
npcdb pulls creature types from bevy_npc; creatures adds a creature simulation that runs identically on client and server — behavior brains, nav grid and waypoint patrols, ambient butterflies and fireflies, and physics LOD.
Worldgen helpers
Deterministic tile hashing, loot rolls, and terrain heights (hash2d, object_at_tile, roll_loot_at, terrain) shared across client and server, plus net_config for the protocol ID and connect tokens.
Questions
Frequently asked
What does the bevy_kbve_net crate do?
It defines KBVE's shared lightyear multiplayer protocol for Bevy 0.20 — the replicated components, player inputs, message types, and channels used by both the client and the server so both halves speak the same wire format.
Which networking backend does bevy_kbve_net use?
It builds on lightyear 0.31 with replication, prediction, interpolation, native input, and netcode. The optional client feature adds WebSocket, WebTransport, and UDP transports, including a wasm32 WebSocket path for browser builds.
What optional features does the crate expose?
The npcdb feature pulls creature types from bevy_npc, the creatures feature adds the shared creature simulation (brains, nav grid, patrols, physics LOD) with off-thread work via bevy_tasker and dashmap, and the client feature enables transport selection and connection lifecycle for the client half.
Discuss on the forum
Questions, fixes and notes on this page live in the KBVE forum.