# Run Orbium locally

> The game server, the client and bot players on your own machine, and the checks every change goes through.

## What you need

- [Deno](https://deno.com) 2: it runs everything, from the build to the tests.
- [Celld](https://celld.dev), for the game server (`celld dev`).
- A browser with WebGPU: a recent Chrome or Edge.

## Start it

You need the code first: the [open-source edition](https://orbium.games/docs/platform/open-source),
coming to GitHub with the next releases. In its folder:

```sh
deno install
deno task dev
```

`deno task dev` starts the game server (Celld, on port 9876) and the client
(Vite, on port 5190) with hot reload. Open `http://127.0.0.1:5190`, press Play,
pick a name and open a Hold.

## Play with bots

A match needs a crew. Bots join a Hold as real players, over the same protocol:

```sh
deno task bots <HOLD CODE> 8             # 8 bots ask to dock (the host: "Let all in")
deno task bots <HOLD CODE> 8 --skill=0.8 # better aim (0 to 1)
```

To play several units yourself in one browser, add `?player=2`, `?player=3` and
so on to the Hold's link: each number is a separate identity.

## The checks

```sh
deno task format   # formatting (deno fmt --check)
deno task lint     # deno lint and deno check
deno task test     # the unit tests: rules, Holds, movement, the island, the engine headless
```

Hold and server changes also run the end-to-end test, a full Hold of simulated
players against a running server:

```sh
deno task dev:server &
deno run -A test/e2e-hold.mjs
```

## Measuring the GPU

Add `?profile` to a Hold's link. A readout under the fps counter shows the
frame's GPU time and its costliest passes, grouped by system.
`PERFORMANCE.md` explains how to measure well, and what
each preset costs.

## Where things are

The [architecture](https://orbium.games/docs/developers/architecture) page maps the folders. For
contributors, `ARCHITECTURE.md` and
`AGENTS.md` in the repository hold the details and the
conventions.
