Getting Started¶
There are three ways to play Kingdom:
- Play in your browser. There's nothing to install; the game runs on GitHub Pages.
- Download a prebuilt binary. Grab a self-contained executable for Windows, macOS, or Linux from the Releases page, then run it. Each archive holds a single binary with the textures baked in.
- Build from source, as a native binary or a WebAssembly bundle you serve yourself, using the steps below.
Prerequisites¶
(Only needed to build from source.)
- rustup. The repository pins a nightly toolchain
in
rust-toolchain.toml, and rustup fetches it (with the Cranelift backend and the wasm target) the first time you runcargoin the project. - A GPU and drivers that support one of wgpu's backends (Vulkan, Metal, DX12, or WebGL in the browser). Most machines from the last decade qualify.
Clone the repository first:
Git LFS
The texture PNGs are stored with Git LFS. If you don't
have it installed, the art will come down as small pointer files and the game
won't render correctly. Install git-lfs, then run git lfs pull.
Native¶
The first build downloads and compiles dependencies, so it takes a while; subsequent runs are fast. A window opens on the main menu.
Faster debug builds
A plain cargo run (no --release) compiles with
Cranelift instead of
LLVM, which turns out unoptimized code much faster. Release builds always
use LLVM. The crates egui uses to draw text (vello_cpu and its SIMD
helpers) stay on LLVM even in debug builds, since Cranelift doesn't support
their NEON intrinsics yet.
Web¶
The web build targets WebAssembly and uses Trunk as the bundler. The wasm target comes with the pinned toolchain; install Trunk once:
Then run a dev server or produce a static bundle:
trunk serve # dev server at http://127.0.0.1:8080
# or
trunk build --release # static bundle written to dist/
Cranelift has no WebAssembly backend, so the non-release web build uses a
web-dev Cargo profile that keeps LLVM.
wgpu is compiled with the webgl feature so the game runs in browsers without
native WebGPU support. If a browser advertises WebGPU but can't actually provide
a GPU adapter, the game falls back to WebGL. The static dist/ bundle is just
plain files, so you can host it on any static web server.
Match server¶
To play with others, one machine runs the match server. The native game can host one from its menu with no extra build. To run one on its own, for example on a machine without a screen or to serve the web build:
It listens on port 7777 and, with --web dist, also serves the web build
from the step above. See Multiplayer for its options
and how to join from the game's menu.
Tests¶
The repository is a Cargo workspace: the game client at the root, the
simulation in crates/core, and the match server in crates/server. Run
every crate's tests with:
Next steps¶
- Controls & HUD: how to pan, zoom, and build.
- Gameplay: the moment-to-moment loop and how you win ground.