> For the complete documentation index, see [llms.txt](https://docs.aethercube.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aethercube.fr/developers/building-from-source/client.md). Agents can also search and read this documentation through its [MCP server](https://docs.aethercube.fr/~gitbook/mcp).

# Client

How to build and run the game client from source. It is a Rust workspace in `game-client/`, built on Bevy 0.20.

## Requirements

* Rust 1.97.1. The `rust-toolchain.toml` in `game-client/` selects it, with `rustfmt` and `clippy`.
* Windows and macOS: nothing else.
* Linux: the ALSA and libudev development packages, for audio and gamepads.

```sh
sudo apt-get install libasound2-dev libudev-dev    # Debian and Ubuntu
```

## Build and run

```sh
cd game-client
cargo run --release -p client-app --bin aethercube
```

The menu asks for:

| Field                    | Value                                                                            |
| ------------------------ | -------------------------------------------------------------------------------- |
| Server address           | `host:port`                                                                      |
| TLS name                 | Defaults to the host.                                                            |
| Server key (SPKI BLAKE3) | The hash the server logs at start. Leave it empty to use the system trust store. |
| Offline name             | For offline-mode servers.                                                        |

The last server is remembered in `client.toml`. No ticket or secret is written there.

Useful command-line options:

| Option                                                | Meaning                                                                  |
| ----------------------------------------------------- | ------------------------------------------------------------------------ |
| `--server host:port`                                  | Connect at start. Missing options come from the last server.             |
| `--server-name`, `--spki <hex>`, `--webpki`, `--name` | Connection options.                                                      |
| `--home <dir>`                                        | Keep configuration and data under one directory. Also `AETHERCUBE_HOME`. |
| `--assets <dir>`                                      | The assets directory.                                                    |
| `--screenshot <file>`                                 | Save a picture after the world shows, then quit.                         |
| `--exit-after <s>`                                    | Quit after that time.                                                    |
| `--overlay`                                           | Show the developer overlay.                                              |

The client finds its assets through `--assets`, then `AETHERCUBE_ASSETS`, then `assets/` next to the executable, then the source directory.

Exit status: 0 normal, 1 a failed endurance run or no network runtime, 2 a bad command line, 3 the launcher hand-off failed.

When the launcher starts the client it passes `--ipc-endpoint`, `--ipc-token` and `--home`, and hands over the ticket on a local channel. See `protocol/launch.md`.

## Crates

| Crate                            | Role                                                                                                                                               |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `client-protocol`                | Protobuf bindings, the packet registry, the frame codec and the material registry.                                                                 |
| `client-network`                 | TCP and TLS 1.3, the handshake, keep-alives, and the server directory client.                                                                      |
| `client-voxel`                   | Voxel decoding, the chunk store and meshing.                                                                                                       |
| `client-physics`                 | The player step, bit-identical to the server's.                                                                                                    |
| `client-gameplay`                | Prediction, interpolation and the client's view of the world.                                                                                      |
| `client-config`                  | `client.toml` and the other settings files.                                                                                                        |
| `client-renderer`                | Mesh jobs, materials, sky and shadows.                                                                                                             |
| `client-ui`                      | Menus, HUD, inventory, settings and the loading screen.                                                                                            |
| `client-models`                  | `.vox` models and the model library.                                                                                                               |
| `client-animation`               | Procedural animation.                                                                                                                              |
| `client-content`                 | Content packs: archives, layout, shaders checks and merging. See [Content packs](https://docs.aethercube.fr/developers/content-packs/overview.md). |
| `client-audio`, `client-effects` | Sound and particles.                                                                                                                               |
| `client-launch`                  | The client side of the launcher hand-off.                                                                                                          |
| `client-app`                     | The `aethercube` binary.                                                                                                                           |
| `client-headless`                | The `aethercube-headless` binary: the same core without rendering, for tests.                                                                      |

## Tests

```sh
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
```

The tests include cross-language vectors written by the server's tests in `protocol/vectors/`: frames, terrain chunks, a movement trace and `sin` and `cos` values. If a change to the client breaks them, the client no longer agrees with the server.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aethercube.fr/developers/building-from-source/client.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
