Godot game client and serverq
A Rust crate powering KBVE games — a Godot GDExtension client with a tokio runtime, a bevy + axum server flavor, an engine-agnostic rapier3d sim, and the transports that join them.
One crate, two flavors
The default build is a Godot GDExtension (cdylib) with a tokio-backed runtime manager; feature flags expose a server flavor built on bevy, axum and rapier, and every engine, server and platform integration sits behind a feature so a build takes only what it needs.
- Mutually exclusive — client and server gated by a compile_error in lib.rs.
- Shared sim — rapier3d-sim compiles without Godot or Bevy for the authoritative server.
What it gives you
Features
Client flavor
Godot GDExtension (godot 0.5) with dashmap, crossbeam, bitflags and a tokio runtime manager singleton; the default build.
Server flavor
Headless Bevy ECS driven from a tokio task (bevy-server), with Supabase HS256 JWT verification to admit players (supabase-auth).
Physics
rapier2d for spatial queries and an authoritative step, and rapier3d-sim, an off-thread fixed-tick 3D sim with a Godot bridge node on the client side.
Networking
postcard wire format with bincode snapshot framing, a Transport seam with loopback, listen-server sessions, WebSocket and UDP lanes, prediction and interpolation.
World and creatures
Worldgen with regions, drainage, biomes and landmarks; steering, locomotion, closed-chain IK and vitals for the bodies that walk it.
Platform extras
Opt-in Steamworks (steam) on desktop, and an in-game webview via wry (webview).
Questions
Frequently asked
What is the q crate?
Q is a Rust crate powering KBVE games. Its default build is a Godot GDExtension (cdylib) with a tokio-backed runtime manager, and feature flags expose a server flavor (bevy, axum, rapier), an engine-agnostic rapier3d sim, and the networking that connects them. It is also an rlib, so a server crate can pull it in as a library.
Can q be built as both a client and a server?
Yes, but not at once. The client and server features are mutually exclusive — enforced by a compile_error in lib.rs — so a build is either the Godot GDExtension client or the headless server flavor. The rapier3d-sim core builds with neither, so the same step code runs in the client and on the authoritative server.
How does q network a match?
net-transport is a vendor-agnostic Transport seam with an in-process loopback, so session logic is testable in CI. net-session drives listen-server host and client roles over it, net-ws adds a WebSocket transport (axum host, tungstenite client), net-udp an unreliable datagram lane beside it, and net-dedicated bundles all of it for a dedicated server.
Discuss on the forum
Questions, fixes and notes on this page live in the KBVE forum.