# VoxelWorld

VoxelWorld is a Java/LWJGL voxel MMO prototype with a desktop client and a
headless authoritative multiplayer server.

See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the current code map and extension notes.

## Local development

```sh
./dev play --args=--offline
```

To run a local multiplayer session, start `./dev server` in one terminal and
`./dev play` in another. The first account in a new server database is
`admin` / `admin`; read the security warning and connection options in
[docs/MULTIPLAYER.md](docs/MULTIPLAYER.md) before binding beyond localhost.

Build the current-host client, Windows x64 client, and platform-independent
server zip with:

```sh
./dev package
```

On this Apple Silicon Mac, refresh both public player downloads and verify the
website in one command:

```sh
./dev release-site
```

That command rebuilds the macOS Apple Silicon and Windows x64 archives, copies
their exact bytes into VoxelSlopSite, regenerates sizes and SHA-256 checksums,
then runs the site build and tests. See
[docs/RELEASING.md](docs/RELEASING.md) for the release checklist.

Controls:

- `W`, `A`, `S`, `D`: move
- Mouse: look
- `Left Shift`: sprint
- `Left Control`: crouch while walking; fly down while fly mode is enabled
- `Space`: jump when walking
- Mouse wheel: select hotbar slot
- `T`: open command chat
- `E`: open inventory
- `F`: toggle fly mode
- `Q`: throw one item from the selected hotbar slot
- `Space` / `Left Control`: fly up/down when fly mode is enabled
- Left mouse: hold to break the targeted block
- Right mouse: place the selected hotbar block
- `Esc`: release or recapture the mouse

Crouching lowers the camera, prevents walking off ledges, halves walking speed, and reduces jump strength.

Inventory:

- Left click picks up, places, merges, or swaps full stacks.
- Right click picks up half a stack or places one item.
- The 2x2 crafting grid supports one vertical pair of wood blocks into 10 sticks, and two cobble over two wood into one workbench.
- Broken blocks drop as small world items, then pull toward the player and enter inventory when close.

Commands:

- `/fly`: toggle fly mode

The `dev` helper prefers the Homebrew JDK 25 install on macOS without changing your global shell Java version.

Smoke capture:

```sh
./dev run -PsmokeFrames=8 -PautoStartWorld=true -PcaptureFrame=build/captures/smoke.png
```

For a deterministic opening-wizard capture, wait for all visible chunks before
starting the smoke frame clock:

```sh
./dev run -PautoStartWorld=true -PsmokeWaitForVisibleChunks=true \
  -PsmokeFrames=70 -PcaptureFrameAt=35 \
  -PcaptureFrame=build/captures/wizard-loaded.png --args=--offline
```

Chunk generation speed baseline:

```sh
./dev chunkGenerationSpeedTest
```

This headless probe measures the CPU terrain and water mesh work used by chunk
workers and writes `build/reports/chunk-generation-speed.json`. See
[docs/CHUNK_GENERATION_SPEED_TEST.md](docs/CHUNK_GENERATION_SPEED_TEST.md) for
the protocol, options, current baseline, and comparison rules.

The staged optimization and authoritative-server direction are documented in
[docs/CHUNK_PIPELINE_PLAN.md](docs/CHUNK_PIPELINE_PLAN.md).
