# Orbium Games > Orbium Games is a platform for real-time 3D multiplayer games in the browser, on WebGPU: a host opens a Hold (kept between matches), shares its link, and the crew plays in it. Its first game is One Beam, an asymmetric hunt. It is built on a native WebGPU engine and a Celld game server (one Durable Object per Hold). Orbium is going open source: a public edition of its code, generated from the private repository and updated with each release, will be published on GitHub (github.com/OrbiumGames). ## Docs > How Orbium Games works, how to play its games, and how it is built, down to the engine and its shaders. Orbium Games is a home for real-time 3D multiplayer games that run in the browser. These pages explain it at three depths: what the platform is, how to play what runs on it, and how every part of it is made. ### The platform What Orbium is, how a Hold works, what it takes to play, and where it is going. - [What Orbium Games is](https://orbium.games/docs/platform) - [How a Hold works](https://orbium.games/docs/platform/holds) - [Accounts and memberships](https://orbium.games/docs/platform/accounts) - [Requirements](https://orbium.games/docs/platform/requirements) - [Roadmap](https://orbium.games/docs/platform/roadmap) - [Open source](https://orbium.games/docs/platform/open-source) - [Credits](https://orbium.games/docs/platform/credits) - [Privacy](https://orbium.games/docs/platform/privacy) ### Games Help for each game, and what comes next. - [Introduction](https://orbium.games/docs/games) - [One Beam](https://orbium.games/docs/games/one-beam): one gun, the rest run. - [Coming soon](https://orbium.games/docs/games/coming-soon) ### Developers How Orbium is built: the client and the server, the WebGPU engine that draws every World, its shaders and its effects. These pages grow with the platform, one system at a time. - [Start here](https://orbium.games/docs/developers) - [Run Orbium locally](https://orbium.games/docs/developers/run-it) - [Architecture](https://orbium.games/docs/developers/architecture) - [The engine](https://orbium.games/docs/developers/engine) - [WebGPU in Orbium](https://orbium.games/docs/developers/webgpu-basics) - [The ocean](https://orbium.games/docs/developers/ocean) - [The camera](https://orbium.games/docs/developers/camera) ## The platform > Orbium Games is a home for real-time 3D multiplayer games in the browser, on WebGPU. Here is what that means. Orbium Games is a platform for multiplayer games that run in a browser tab. There is nothing to install: you sign in, open a **Hold** and share its link with your crew, or [try the demo](https://orbium.games/demo) with no account at all. ### What makes it different - **A Hold that stays.** A Hold is your crew's place. It keeps its tournaments, its settings and its link between matches, for as long as you keep playing in it. The matches, the Worlds and, as more games arrive, the games change inside it. Read [how a Hold works](https://orbium.games/docs/platform/holds). - **Full 3D in the page.** Every World is drawn with WebGPU, the browser's modern graphics interface: a moving sea with surf and foam, a sky with clouds and weather, light that changes with the hour. See [what it takes to play](https://orbium.games/docs/platform/requirements). - **Made for a crew.** From 2 to 16 units in one Hold, on keyboard and mouse, a gamepad or a touch screen. - **Procedural Worlds.** No model or texture files: the island, its rocks and every unit are generated from a seed, so a whole World arrives in a few megabytes. ### Our goals 1. **Games worth playing with friends**, that start from a link in seconds. 2. **A platform for many games.** One Beam is the first; the next ones open in the same Hold, with the same crew. See the [roadmap](https://orbium.games/docs/platform/roadmap). 3. **Open knowledge.** The code is public, and these Docs explain how it works, from the rules of a game to the shaders that draw its sea. See [open source](https://orbium.games/docs/platform/open-source) and the [developers' docs](https://orbium.games/docs/developers). 4. **Free to play, backed by its players.** Anyone signs in for free, opens a Hold of their own and docks in any Hold by its link or its code. Members on Patreon own more Holds and host others', and with sponsors pay for the servers and the work: see [accounts and memberships](https://orbium.games/docs/platform/accounts) and the [backers](https://orbium.games/backers). ### The words we use Orbium speaks like a dock. These words appear across the games and these pages: | Word | Meaning | | ---------- | --------------------------------------------------------- | | Hold | A host's place for its crew, kept between matches | | Tournament | A Hold's run of matches, up to 30 days, and its standings | | Owner | Who opened a Hold: it counts in their membership | | Crew | Everyone in the Hold | | Unit | A player's droid | | World | Where a match is played: Earth, Desert, Mars or Ice | | Match | In One Beam, one Hunter's round, scored on its own | | Window | A match's length | | Deploy | Start the match | | Dock | Enter a Hold (Undock: leave it) | | Signal | Ready | | Down | Out of health | | Hunter | In One Beam, the one unit that can fire | | Risk | In One Beam, the score multiplier | ## Requirements > What it takes to play Orbium's games, how the graphics adapt to your machine, and what does not work yet. Orbium's games draw with **WebGPU**. Without it there is no game: there is no WebGL version. ### Browsers | Browser | Status | | ----------------------- | ------------------------------------------------------ | | Chrome, Edge (computer) | The best choice: the games are made and tested on them | | Chrome (Android) | Works; a phone runs warm and touch aiming is harder | | Safari 26 | Has WebGPU; the games are not tuned for it yet | | Firefox | Has WebGPU; the games are not tuned for it yet | When a Hold's page opens in a browser that can't run the game, it says why and what to do for that browser (turning on the graphics card's acceleration, for example) before anything of the game is downloaded. ### Graphics There are four graphics presets: **High**, **Medium**, **Low** and **Very low**. The game picks one for your machine the first time (Auto) and you can change it in the menu (Esc, Graphics): - **High** is made for a dedicated graphics card or Apple silicon. - **Low** is where the game starts on integrated graphics (Intel's, not Arc), a phone or a tablet, a GPU without a desktop card's limits, or a machine with little memory or few cores. - **Very low** is for a GPU drawn in software. - **Medium** is the step down from High: if a World can't hold 30 frames a second, Auto steps down one preset for the next World. Lower presets switch whole systems off (clouds, haze, caustics, the surf simulation, grass, tracks, ambient occlusion), draw at a lower resolution and use smaller shadow maps. The developers' page on [the engine](https://orbium.games/docs/developers/engine) explains each system. ### Controls Keyboard and mouse play best. A standard gamepad works, and so does a touch screen: a joystick appears under the left thumb and the right half of the screen looks. The full list is in [One Beam's controls](https://orbium.games/docs/games/one-beam#controls). ### Connection A steady connection matters more than a fast one: under 150 ms to the game server plays well. Turn on fps and ping in the menu to see yours. ### Download Up to 3 MB the first time: the game, its sounds and its sky. The browser keeps them after that. ### Limitations - No WebGPU, no game. - Phones and tablets run it, but a small screen, touch aiming and a warm phone make it harder. - Your player lives in this browser. Another browser or device, or cleared site data, docks you as someone new. - Sound starts with your first click or key: browsers hold it until then. - Mouse look locks the pointer: click the game to take it, Esc to let go. - A Hold takes up to 16 units, and a match needs 2. ## How a Hold works > Open a Hold, share its link, let your crew dock and deploy. A Hold stays between matches and keeps its record. A **Hold** is your crew's place to play. You open it, share its link, and play match after match in it, today or next week. The host decides who docks and what is played. Everyone who docks signs in, for free, and every account owns a Hold of its own; a membership on Patreon owns more: see [accounts and memberships](https://orbium.games/docs/platform/accounts). ### Open, share, deploy 1. **Open a Hold.** Press [Play](https://orbium.games/play), sign in, name it and choose Open Hold. You own it and host it. Share gives you its invite: a link, or a short code, copied without showing it (safe on a stream). 2. **Let your crew dock.** Your friends sign in, open the invite (or type the code on Play) and ask to dock. You let each one in, or turn them away. Someone turned away can be let back in later. Once let in, a Hold stays on their [Play](https://orbium.games/play) page, and its address works for them: nothing to keep (Forget takes it off). The address lets nobody else in, so showing it is safe. 3. **Build your unit, deploy.** Everyone builds a unit and gives the signal. You pick the match's settings and deploy. Nothing to install. You are the same unit in every Hold, on any browser you sign in with, and your name is your account's (change it on [Play](https://orbium.games/play)). ### The host The host runs the Hold from its panel: - **Crew:** who is in and who is waiting. Let in, turn away, undock. - **Match:** the tournament it counts in (one of the running ones), the game (One Beam, for now), then the game's settings: the World (Earth, Desert, Mars or Ice), the island (a new one, or one played before, by its number), the Window's length, how the Hunter is picked and the light (sunrise, midday, sunset or random). - **Tournaments:** start one (its name), rename it, end it, or pick the one the next match counts in. Only in the Hold, between matches. - **New Code** (in Share): if the invite got out, take a new one. Everyone waiting to dock is turned away at once and the old invite stops working; your crew keep their place. If the host leaves, after 30 seconds its owner takes over when docked, otherwise the unit docked the longest. ### Owners and hosts Whoever opens a Hold owns it, and only its owner, or a member the owner invited, opens it again after its crew has gone (a Hold closes 5 minutes after the last unit undocks). In the Hold's panel, the owner's **Hosts** list invites a docked member to host: they can then open the Hold when you can't, or start it in their own region (a Hold runs on the server nearest whoever opens it). Every Hold has a **name** (say, "Friday crew": 3 to 24 characters), given when it opens, to tell your Holds apart. Its owner can change it: Rename on its tile on [Play](https://orbium.games/play), or HOLD NAME in the Hold's panel. Everyone docked sees it, and so do its invited hosts. Its link and code stay the same. ### Matches A **match** is one Hunter's round. It opens on the sky platform: the crew drop off and scatter while the Hunter waits, then the hunt runs for the **Window** (3, 5 or 10 minutes: only its length). When it closes, the camera finds the unit that took it and the results stay up until the host goes on. With the Hunter on **Rotate**, every unit hunts once, each round a match of its own (MATCH 2 OF 8), scored and kept on its own; the host goes on to the next one, then back to the Hold. ### Tournaments A Hold plays in **tournaments**: every match counts in one, its points, wins and numbers adding up in the tournament's standings. One always runs: the first opens with the Hold, and when it ends the next one starts. A tournament lasts up to 30 days; its host may end it sooner. A free Hold runs one tournament at a time; a Backer's, three; a Host's and every higher tier's, six, and its host picks which one the next match counts in. The Hold's **Tournaments** tab lists the running ones (the day, the matches, who leads), the ended ones it keeps and its years. Each one opens in the **record**: its standings, its last match and its matches still kept, or a year's totals. ### What a Hold keeps Every match's points stay in its tournament for good. Its full results (each unit's line, as the results showed them) are kept for the last matches, by its owner's tier: 30 free, 60 for a Backer, 200 for a Host and every higher tier. Past that the oldest go; their points stay in the standings. Ended tournaments are kept the same way: 10, 20 or 50 of them. Past that the oldest go, and its totals stay in the Hold's totals for the year it ended in. ### Under the hood Each Hold lives on the game server as Durable Objects (one for its address, one for its game), which hold its state and talk to its crew over WebSockets. Who owns and who may host each Hold is kept in one database with the accounts. The [architecture](https://orbium.games/docs/developers/architecture) page tells the whole story. ## Accounts and memberships > Sign in for free to open a Hold of your own or dock in any Hold. A membership on Patreon owns more Holds and hosts them. The demo needs no account. Everyone who plays with a crew signs in, on [Play](https://orbium.games/play). Docking is free: sign in, and dock in any Hold by its link or its code, and open a Hold of your own. A membership on Patreon owns more of them and keeps the servers running. ### Signing in Sign in with **Patreon** or **Google**. Your account is the same on every browser you sign in with: the same unit, the same name (change it on [your account](https://orbium.games/account)), the same place in every Hold's record. Signed in with Google and a member on Patreon? Link your Patreon account from your account, so your membership counts. A Patreon account links to one Orbium account only. A sign-in lasts 7 days on a browser, renewed each time you come back. Sign out, in the menu behind your avatar at the top of every page, forgets it on that browser; Sign out everywhere, on your account, on every browser. You're in one Hold at a time, so you play one match at a time: docking in another Hold undocks you from the one you were in (a match running there counts you as left), and its page tells you so. ### Memberships Every account owns a Hold, for free. A membership is a tier on [Patreon](https://www.patreon.com/OrbiumGames) (its price is there): Backer and Host own more Holds and run more tournaments; the tiers above them back Orbium, with a Host's Holds and a place on the [backers' page](https://orbium.games/backers). | Tier | Holds you own | Holds you host for others, a month | On the backers' page | | ------------- | ------------- | ---------------------------------- | ---------------------- | | Free | 1 | none | | | Backer | 5 | 3 | | | Host | 15 | 15 | | | Founding Host | 15 | 15 | your name | | Sponsor | 15 | 15 | your name and a link | | Gold Sponsor | 15 | 15 | your name, image, link | Each Hold you own also plays and keeps by your tier ([tournaments](https://orbium.games/docs/platform/holds#tournaments)): | Tier | Tournaments at once | Matches kept in full | Ended tournaments kept | | --------------------- | ------------------- | -------------------- | ---------------------- | | Free | 1 | 30 | 10 | | Backer | 3 | 60 | 20 | | Host and every higher | 6 | 200 | 50 | Founding Host is limited to the first 100 members. A change on Patreon reaches your account here within moments; it is checked again when you sign in, and at least once a day. Orbium can also give a membership, for a time or for good: to community members, in a promotion, for a test. Your account shows when one ends. With a membership from Patreon and one given, the higher counts. Your account id, on your account, is how we find your account when you ask. ### Owners and hosts **Owners.** Whoever opens a Hold owns it, and it counts in their tier. Only its owner opens it again once its crew has gone, unless they invited a host. An owner can delete a Hold from Play, which frees its place. **Invited hosts.** In the Hold's panel, its owner invites docked members to host it (the **Hosts** list). A host opens the Hold when its owner can't be there, or to start it in their own region: a Hold runs on the server nearest whoever opens it. Hosting takes the host's own paid membership, and counts in its month: each Hold once a calendar month (UTC), however often it is opened, starting again on the 1st. **The crew** need no membership: they sign in and dock. ### A smaller membership Nothing is deleted when a membership gets smaller or ends. Your Holds stay, and you open as many of them as your tier allows (a free account, one), the most recently opened first; the others show as locked on Play until you upgrade or delete some. The members you invited can still host any of them. ### The demo [The demo](https://orbium.games/demo) needs no account and no server: the whole Hold runs in your browser. You hold the beam, a crew of bots runs and hides, and every Hunter's tool is yours: the lasers, the zoom, the World. Sign in for a real crew. ### Your email and your account Signing in gives us your email (from the first provider you sign in with), and your account shows it: that's where we write about your account, your membership and the help you ask for. News about Orbium only if you tick it there. **Delete account**, at its foot, deletes your account and your Holds for good: you confirm it by typing `delete my account`. ### What is kept See [privacy](https://orbium.games/docs/platform/privacy): what we keep about your account, and why. ## Roadmap > What Orbium has shipped so far, and what comes next. Orbium is young and moves fast. This page keeps the big picture: what is there, and where it is going next. ### Shipped - **One Beam**, the first game: an asymmetric hunt for 2 to 16 units, with health and shields, Risk and each match's results. - **Four Worlds**: Earth, Desert, Mars and Ice, each with its own ground, sky, sea, light and sound, on a new procedural island whenever the host wants one. - **Holds** that stay: a host's place with its crew, its settings, its link and its tournaments (up to 30 days each, standings and the year's totals). - **Accounts and memberships**: sign in with Google or Patreon, open a Hold of your own and dock for free; members own more Holds and host others'. - **A sea to play in**: surf on every coast, units that wade, swim on water jets and dive for cover. - **Graphics for every machine**: four presets, picked automatically and stepped down when a World is too heavy. - **Keyboard and mouse, gamepad and touch.** - **Game feel**: a camera that answers to speed, the booster, crashes and hits, and a lens that takes dust, water and heat ([the camera](https://orbium.games/docs/developers/camera)). - **The site**: the home page, the backers' page and these Docs. ### Next > This part is a draft: the plans below are still being decided. - **More games** in the same Hold, with the same crew. - **More Worlds** and more of what lives in them. - **The developers' docs**, one engine system at a time: the terrain, the sky and clouds, shadows, the post effects, sound. - **Release notes** on these pages, game by game: see [coming soon](https://orbium.games/docs/games/coming-soon). ## Open source > Orbium is going open source, through a public edition of its code published release by release. What that means, and why we do it this way. Orbium will be open source: the platform, One Beam and the engine under them, for anyone to read, learn from, run and build on. This page explains how the code will be shared, and why. ### How the code will be shared Orbium is developed in a **private repository**. From it, we generate an **open-source edition**: a separate, public repository on GitHub, under the [OrbiumGames](https://github.com/OrbiumGames) account. It is updated **every time we ship a new release**, so what you read there is what players are running. The first edition is being prepared. It will be announced on these pages, on [Discord](https://discord.gg/2SeBJCv7vA) and on [Patreon](https://www.patreon.com/OrbiumGames), with more updates in the near future. ### Why a separate edition Keeping development private and publishing an edition with each release lets us open the code without putting the platform or its people at risk: - **Security.** The private repository holds what keeps the live service running and fair: how the servers are deployed and configured, and the safeguards around them. Those details stay out of the public edition. - **Privacy.** Day-to-day development carries things that are not meant to be public: internal notes, conversations with players and backers, work in progress. The edition contains the code, not the people around it. - **Releases you can rely on.** Every edition matches a release that has been tested and runs. No half-finished work, no history to dig through: a clean starting point for reading the code or running your own server. ### What the edition will contain | Folder | What it is | | --------- | --------------------------------------------------------------- | | `engine/` | The WebGPU engine: GPU resources, shaders, terrain, sea, sky | | `shared/` | Code the browser and the server both run: the island, the rules | | `server/` | The game server: each Hold a Durable Object | | `client/` | The site and the game in the browser | | `tools/` | Bot players and the sound pipeline | | `test/` | The tests | | `docs/` | These pages, in Markdown | The [developers' docs](https://orbium.games/docs/developers) already explain how it all works. The file names they mention are those of the edition; once it is published, they will link straight to the code. ### For our backers Backing on [Patreon](https://www.patreon.com/OrbiumGames) pays for the servers, the games to come and the time it takes to prepare each open-source edition and these Docs. Docking stays free for everyone signed in, and the demo needs no account; members own and host the Holds. See [accounts and memberships](https://orbium.games/docs/platform/accounts) and the [backers](https://orbium.games/backers). ### Where it comes from The engine started as [Tidewater](https://github.com/dgreenheck/tidewater), Daniel Greenheck's WebGPU ocean and island renderer, and Orbium keeps it in step with it. Everything else Orbium builds on (the clouds, the sounds, the fonts) is named, with its licence, in the [credits](https://orbium.games/docs/platform/credits). ## Credits > The people and projects Orbium builds on, the licences they come under, and where each one is credited. Orbium stands on other people's work. This page names it, with the licence it comes under and where it is credited in full. ### The engine The engine that draws every World started as [Tidewater](https://github.com/dgreenheck/tidewater), by Daniel Greenheck: a WebGPU ocean and island renderer. Orbium keeps it in step with Tidewater and builds its own systems on top. See [the engine](https://orbium.games/docs/developers/engine). ### Clouds The volumetric clouds, and the noise volumes they are shaped from, are adapted from DRG Software Solutions' **Sky Pro WebGPU**, published with Tidewater by its copyright holder. ### Anti-aliasing The lookup textures of the SMAA anti-aliasing come from [three.js](https://github.com/mrdoob/three.js) (MIT licence), which takes them from Jorge Jimenez et al.'s [SMAA reference implementation](https://github.com/iryoku/smaa). ### Sounds Every sound in the games is a real recording from [Freesound](https://freesound.org), under [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/) (a public domain dedication). CC0 asks for no attribution; we give it anyway, recording by recording, with its author and what it is used for: [the sound credits](https://orbium.games/audio/CREDITS.md). The booster's roar and the bolts' sizzle are synthesized. ### Fonts **General Sans** and **Satoshi** are by the Indian Type Foundry, from [Fontshare](https://www.fontshare.com), under the ITF Free Font License. We serve them from our own site, unchanged, as the licence allows. ### The stack Orbium runs on [WebGPU](https://www.w3.org/TR/webgpu/), [Deno](https://deno.com), [Vite](https://vite.dev), [Celld](https://celld.dev) and [Cloudflare](https://www.cloudflare.com). The Docs are rendered with [Marked](https://marked.js.org) and their code coloured with [Shiki](https://shiki.style). [Claude](https://www.anthropic.com), by Anthropic, writes the code with us. ### Missing someone? If something of yours is in Orbium and not credited here, tell us on [Discord](https://discord.gg/2SeBJCv7vA) and we will put it right. ## Privacy > What Orbium keeps about you, why, and where. No ads, no trackers, no selling. Orbium keeps what it takes to sign you in, run your Holds and keep the servers well, and nothing else. No ads, no third-party trackers, nothing sold. ### When you sign in - **With Google:** your Google account's id, your first name and your email address (and whether Google has confirmed it). - **With Patreon:** your Patreon user id, your first name, your email address (unless you keep it from apps on Patreon) and your membership of Orbium's campaign (its tier). We ask Patreon for nothing about your other memberships. Patreon tells us when your membership of Orbium's campaign changes (its tier, whether it is active). To check your tier again later, we keep the token Patreon gives for it, encrypted. ### Your email We write to the email of the first provider you signed in with ([your account](https://orbium.games/account) shows it): about your account, your membership, its Holds and the help you ask for. News about Orbium only if you ask for it on your account, which you can undo there any time. We never sell it or share it for anyone else's use. ### Your account One database keeps, for each account: its id, its name, its email, whether you asked for news (and when), when it was made and when it last came by, its memberships (each one's tier, where it comes from, when it ends, and for one we gave, why), the Holds it owns (and the names you gave them), the members invited to host them, the Holds whose crew let it in (and when it last docked, until you forget one on Play), the Hold you are docked in now (you're in one at a time), and the Holds each member hosted in a month (the monthly count). ### In a Hold A Hold keeps its name, its crew's names, units and scores, and its record: its tournaments' standings, the full results of its latest matches and its totals for each year, as many as its owner's membership keeps ([what a Hold keeps](https://orbium.games/docs/platform/holds#what-a-hold-keeps)), for as long as the Hold exists. Its owner can delete it. ### In your browser Your sign-in (a token the server signed) and your settings, in the browser's local storage. While you sign in, a cookie ties the sign-in to your browser for up to 10 minutes. Nothing else is stored, and nothing tracks you. ### Logs The servers log what they need to run well: when a Hold opens and in which region, and, for a share of rounds, how each one played (the round trips, the frame rate, the graphics preset), with the account's id. ### Deleting your data **Delete account**, on your account, deletes your account at once and everything kept with it: your email, your sign-ins, your memberships, your Holds and their records. Your unit's name and scores stay in the records of other crews' Holds you played in, until those Holds are deleted; for help with anything else, ask us on [X](https://x.com/OrbiumGames). What we keep of a deleted account or Hold says nothing about who it was: the day it was made, last used and deleted, its membership then, how it signed in (Google, Patreon) and how many Holds it had. No id, name, email or Hold code. It tells us how long accounts and Holds last, and why the servers hold what they do. ## Games > The games on Orbium, how to play them, and what is on its way. Every game on Orbium opens in a Hold: the host picks it, the crew plays it, and the Hold keeps the record. ### Playing now - [One Beam](https://orbium.games/docs/games/one-beam). One gun, the rest run. An asymmetric hunt across Earth, Desert, Mars and Ice, for 2 to 16 units. ### On the way New games will be announced here as they arrive. See [coming soon](https://orbium.games/docs/games/coming-soon). ## One Beam > One unit holds the beam and only it can fire. The rest run. The rules, the score, the controls and the Worlds. One unit holds the beam: the **Hunter**, and only it can fire. The rest of the crew drop off the sky platform, scatter across the World and try to last the Window. ### A match, start to finish A **match** is one Hunter's round, and the **Window** is how long it lasts. 1. **The drop.** Every match starts on the sky platform. The crew drop off, and their units' thrusters set them down (there is no boost on the drop). The Hunter waits 20 seconds on the platform, blind. 2. **The hunt.** The Window runs 3, 5 or 10 minutes (the host picks). The Hunter fires the lasers on its unit's forearms. The crew hide behind rocks, run, boost, swim and dive. 3. **The close.** When the Window runs out, or every unit is down, the camera finds the unit that took the match and the results come up. The host picks the Hunter: a random unit, a named one, or **Rotate**, where every unit holds the beam once, a match each (MATCH 2 OF 8), each scored and won on its own. Every match's points count in the Hold's current [tournament](https://orbium.games/docs/platform/holds#tournaments). ### Health and shield Every crew unit has **health** under a **shield**. Bolts wear down the shield first; it comes back a few seconds after the last hit, until a hit gets through to your health. From then on your shield is gone for the match, and health never comes back. At 0 you are **down** and watch the rest of the match. The Hunter's shield always holds. - Damage depends on the Hunter's power, the distance (full up close, half at the lasers' range) and where the bolt lands: the head takes the most, the ball and fork the least. - A laser field out at sea marks the edge of the World. It pushes everyone back. Your shield holds it off; with the shield down, a touch costs half your health. - Hitting a rock face hard throws you back: the shield takes it, or it costs health. - Badly hurt, a unit smokes, sparks and slows down, its booster first. ### Risk and score Every unit moves at the same speed. Two stats, set in the Hold, change your **Risk**, and Risk multiplies your score: - **Boost**: 2 to 3.5 seconds of rocket flight. - **Power**: your beam's damage when you hunt, your shield when you run. Less boost and less power mean a higher Risk, from x1 to x2. In the hunt it is live: it climbs near the Hunter (up to x3 within 15 m) and drops far from it, never past x5 in all. The HUD shows it under the clock. | Who | Points | | ------ | -------------------------------------------------------------------------------------------------------------- | | Crew | 1 a second you last, times your Risk; 30 more (times your Risk) if you make it to the end. Down, you keep half | | Hunter | 50 a unit downed at even Risk, times its Risk over the target's, and a bonus for clearing the World early | ### The sea The sea is part of the World. A unit wades in the shallows, swims on its pack's thrusters turned water jets (Shift bursts them, on the booster's fuel) and, out of its depth, can dive: under the surface bolts can't reach it, and the Hunter can't fire. A dive lasts as long as its air. ### Controls | Keyboard and mouse | What it does | | ------------------ | ----------------------------------------------------------------- | | W A S D | Move | | Shift | Run (held); in the sea, burst the jets | | Space | Jump; again in the air (held) to boost; in the sea (held) to dive | | Mouse | Turn and look (click the game to capture the mouse) | | Left click | Hunter: fire (held); not under water | | Right click | Zoom (held) | | Tab | When down: watch the next unit | | M | Sound on or off | | F1 | Help | | Esc | Free the mouse, menu and settings | | Gamepad | What it does | | ----------- | ---------------------------------------------- | | Left stick | Move; push it all the way (or click it) to run | | Right stick | Turn and look | | A | Jump, boost, dive | | RT | Hunter: fire (also RB or LB) | | LT | Zoom (held) | | Y | When down: watch the next unit | | Back, Start | Sound on or off, menu | On a touch screen, drag on the left half to move (to the rim to run) and on the right half to look. The buttons jump, zoom and, for the Hunter, fire. ### The Worlds - **Earth**: green hills around a tall peak, meadow grass, surf on white sand. - **Desert**: dune fields over low ridges, turbid shallows, sand on the wind. - **Mars**: a plateau cut by broad, layered canyons, dark brine, fine dust in the air. - **Ice**: a glacier over the island, slick clear ice (a unit slides on it), a fjord, icebergs offshore and a low sun all day. ### Tips - Rocks stop bolts: the big ones are cover (the grey spots on the map). - Nerve pays: keep near the Hunter and your Risk climbs. - Bolts fly fast, but not instantly: lead a moving unit. - The boost is loud and bright. It gets you away, and it shows where you are. ## Coming soon > New games and releases will be announced here as they arrive. One Beam is the first game on Orbium, and it won't be the last. Every new game will open in the same Hold, with the same crew, and be announced on this page with its rules and its controls. Until then, follow along on [Discord](https://discord.gg/2SeBJCv7vA) and [YouTube](https://www.youtube.com/@OrbiumGames), or see the [roadmap](https://orbium.games/docs/platform/roadmap). ## Developers > How Orbium is built, from the game server to the WebGPU engine, its shaders and its effects. A knowledge base that grows with the platform. These pages explain how Orbium works inside: how a Hold is run, how the browser and the server agree on a World, and how the engine draws it with WebGPU. They are for anyone curious about real-time 3D on the web, and they are our own map as the platform grows. The pages name the files they talk about, as the code is organised: the files are the source of truth, these pages explain why they are the way they are. Orbium's code will be public as an [open-source edition](https://orbium.games/docs/platform/open-source), published on GitHub with each release; once it is out, those names link straight to the code. ### Where to start 1. [Run Orbium locally](https://orbium.games/docs/developers/run-it): the game server, the client and bot players on your machine, in two commands. 2. [Architecture](https://orbium.games/docs/developers/architecture): the pieces and how they talk. The client, the server, the code they share, and who decides what. 3. [The engine](https://orbium.games/docs/developers/engine): a tour of the WebGPU engine, one folder at a time. 4. [WebGPU in Orbium](https://orbium.games/docs/developers/webgpu-basics): the device, buffers, WGSL modules, materials, and how a frame is recorded and submitted. ### Deep dives One system at a time, from the idea to the shader: - [The ocean](https://orbium.games/docs/developers/ocean): FFT waves, shore waves that bend around headlands, surf foam, caustics and the view under the sea. - [The camera](https://orbium.games/docs/developers/camera): the boom that keeps clear of rocks, the long lens, the post effects it looks through, and how speed, the booster and crashes reach it. More will follow: the terrain and its level of detail, rocks, the sky and clouds, shadows, the post effects, particles, sound. ### The stack | Piece | What it does | | ---------- | -------------------------------------------------------------- | | WebGPU | Draws every World, in the page, with compute and render passes | | WGSL | WebGPU's shading language: every shader in the engine | | Deno | The toolchain: the build, the tests, the tools | | Vite | Builds and serves the client | | Celld | Runs every Hold: self-hosted Durable Objects | | Cloudflare | Serves the site | ## 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, sign in and open a Hold. The demo is at `/demo`. Signing in takes an OAuth client of your own at Google or Patreon (its callback: `http://127.0.0.1:5190/api/auth//callback`; its id in `server/wrangler.json`, its secret in `server/.dev.vars`), or a test account (below). ### Play with bots A match needs a crew. Bots join a Hold as real players, over the same protocol: ```sh deno task bots 8 # 8 bots ask to dock (the host: "Let all in") deno task bots 8 --skill=0.8 # better aim (0 to 1) ``` To play several units yourself, use a browser profile each. ### Test accounts The dev server has one more route, which is never deployed: `POST /api/dev/account` (`server/src/dev.js`) makes a test account with a membership. The bots and the tests use it. To be one in a browser, without a Google or Patreon client: ```sh curl -s -X POST http://127.0.0.1:9876/api/dev/account \ -d '{"n": "2", "name": "Ana", "tier": "host"}' # -> { "id": ..., "session": ... }; tier: none (null), backer, host, founding, # sponsor or gold; "until": its end (unix seconds), to see one that ends ``` then, in the browser's console on `http://127.0.0.1:5190`: `localStorage.setItem("orbium.session", "")` and reload. ### 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. ## Architecture > The client, the game server and the code they share, how a Hold loads, and who decides what. Orbium is three pieces of code: a **client** in the browser, a **server** that runs every Hold, and **shared** code both of them run. The shared code is how the browser draws exactly the World the server judges, from nothing more than a seed. ``` Browser (WebGPU) Game server (Celld) site pages: home, backers, docs api/ /api, a file a route a Hold's page Hold.js one Durable Object class UI (DOM) the Hold, HUD, menu <---> HoldState.js the Hold as pure code World the engine, an island WS HuntRound the game (from shared/) Game a match on that World \ / +------ shared/: island, rocks, --+ movement, bolts, rules, protocol ``` ### The layers | Layer | Folder | Uses | Never | | ------ | ------------------------------- | --------------------------------- | ------------------- | | Engine | `engine/` | itself | game code | | Shared | `shared/` | pure engine modules (math, noise) | the DOM, the GPU | | Server | `server/src/` | shared/ | the GPU, the client | | Client | `client/src/` | everything above | server internals | The engine is a library: it knows nothing of One Beam. It comes from [Tidewater](https://github.com/dgreenheck/tidewater) and is kept in step with it. The game's wiring lives in World.js (`client/src/game/World.js`). ### The client The site's pages (the home page, the backers' page and these Docs) are prebuilt HTML with a small stylesheet: nothing of the game loads on them. A Hold's page checks WebGPU first (gpu.js (`client/src/gpu.js`)), picks a graphics preset for the machine, then loads the game. Loading a Hold runs three things at once: 1. **The socket** connects and docks; the Hold's panel renders from the server's messages. 2. **The land** is built in a worker: the island from its seed, the shore's wave field, the terrain's baked maps and the rocks as solids (land.js (`client/src/game/land.js`)). 3. **WebGPU and the World** start: the device, the pipelines, the sky and the sea, which don't need the land. Every animation frame, the client reads the input, moves the local unit (Walker.js (`client/src/game/Walker.js`)), draws the others from the server's snapshots, records the World's GPU work and submits it once. ### The server Each Hold is a Durable Object on [Celld](https://celld.dev), started near whoever opens it, and only its owner or a member it invited opens it: Hold.js (`server/src/Hold.js`) does its input and output (sockets, alarms), and HoldState.js (`shared/HoldState.js`) is the whole Hold as pure code (the crew, the host's powers, the match flow) with time passed in. That makes the rules testable without a server: the tests play full matches in memory, and the demo runs the same Hold in the browser (LocalConnection.js (`client/src/net/LocalConnection.js`)). Who signs in, and who owns and may host each Hold, live in one database (D1: accounts/ (`server/src/accounts/index.js`)). A Hold never asks it: a player's session is a token the server signed (session.js (`server/src/session.js`)), which the Hold checks alone. A player is in one Hold at a time: before each dock the client asks for a dock ticket, signed the same way and good for a minute, which the Hold checks alone too, and docking in another Hold undocks the player from the first. ### Tournaments and games A Hold plays in tournaments (tournaments.js (`shared/tournaments.js`), pure like the Hold): every match lands in the current one, its points, wins and stats added to the standings. What a Hold keeps (its latest matches' full results, its ended tournaments, its totals by year) is bounded by its owner's tier, and stored compact: a match's results are rows of numbers. Each game brings its own settings and stats (games/ (`shared/games/index.js`)), so the next game counts in the same tournaments without changing what is stored. There is no game loop on the server. Clients send input 20 times a second; every message advances the Hold to the present and sends a snapshot when 50 ms have passed. Alarms end the phases when nobody is sending. ### Who decides The server decides everything that matters, on its own clock: - **Movement**: each unit moves on its own screen, and the server bounds its speed and its height (movement.js (`shared/movement.js`)). A unit only rises with a jump or the boost, which the server simulates too. - **Shots**: a shot carries the time of the view it was aimed in. The server rewinds to that moment (as far as the round trip it measured explains) and flies the bolt against the same island and rocks (bolts.js (`shared/bolts.js`)). - **Messages**: protocol.js (`shared/protocol.js`) defines them. Snapshots are binary, 14 bytes a unit; everything else is JSON. ### Determinism The client and the server never send the island to each other. Both build it from the Hold's seed with the same code (island.js (`shared/island.js`), cover.js (`shared/cover.js`)), using seeded randomness only. So a change to that code changes the World for everyone, and is checked World by World. ## The engine > A tour of the WebGPU engine that draws every World, one folder at a time. The engine is written directly on WebGPU, with no framework in between. It started as [Tidewater](https://github.com/dgreenheck/tidewater), Daniel Greenheck's ocean and island renderer, and Orbium has grown it with what its games need: grass, wind-blown sand and snow, tracks in the ground, dust, a sky full of far things. It lives in `engine/` and knows nothing of the games. ### The folders | Folder | What it does | | -------------------------------------- | --------------------------------------------------------------------------- | | gpu/ (`engine/gpu/`) | The device, buffers and textures, WGSL modules, compute kernels | | render/ (`engine/render/`) | Materials, the mesh renderer, shadows, full-screen passes | | scene/ (`engine/scene/`) | Objects, groups, meshes and cameras | | math/ (`engine/math/`) | Vectors, matrices, quaternions, frustums (pure: the server uses it too) | | terrain/ (`engine/terrain/`) | The island's ground, its level of detail, rocks, the shore field | | ocean/ (`engine/ocean/`) | The sea: FFT waves, shore waves, surf, foam, caustics | | sky/ (`engine/sky/`) | The atmosphere, clouds and the environment light | | post/ (`engine/post/`) | Upscaling, ambient occlusion, haze, motion blur, bloom, the underwater lens | | fx/ (`engine/fx/`) | Particles: spray, dust, sand and snow on the wind, marine snow | | vegetation/ (`engine/vegetation/`) | Grass, pushed down by whatever moves through it | | materials/ (`engine/materials/`) | The scene's lighting and local lights | | audio/ (`engine/audio/`) | The mixer: placed sounds, ambience, the muffle under water | ### A frame Each frame, every system updates on the CPU, then records its GPU work into one command encoder, sent to the GPU in a single submit: 1. **Simulation**, in compute passes: the atmosphere's lookup tables, the ocean's FFT, the surf, caustics, particles, clouds, terrain and grass selection. 2. **Shadows**: cascaded maps of the sun, the far cascades updated less often. 3. **The scene**: opaque meshes and the sky, then everything under the water at half resolution (for refraction), then the water and transparent objects. 4. **Post**: ambient occlusion, haze and light shafts, temporal upscaling, motion blur, lens flare, bloom, exposure, grading and tone mapping. The graphics presets switch whole systems off and change the resolution and budgets: see [requirements](https://orbium.games/docs/platform/requirements#graphics). ### Procedural, not loaded There are no model or texture files. The terrain is generated from noise, the rocks are shaped from seeds (RockShape.js (`engine/terrain/RockShape.js`)), foam and detail textures are generated on the GPU at start. A World costs a few megabytes, most of it sound. ### Next - [WebGPU in Orbium](https://orbium.games/docs/developers/webgpu-basics): how the engine talks to the GPU. - [The ocean](https://orbium.games/docs/developers/ocean): the first system in depth. - [The camera](https://orbium.games/docs/developers/camera): how it follows a unit, and the lens it looks through. ## WebGPU in Orbium > How the engine talks to the GPU. The device and the frame's encoder, uniform blocks, WGSL modules, compute kernels and materials. WebGPU gives a web page direct access to the graphics card: buffers, textures, compute and render pipelines, and shaders written in **WGSL**. The engine wraps it in a few small pieces, each in `engine/gpu/` or `engine/render/`. ### The device and the frame GPU.js (`engine/gpu/GPU.js`) holds the device, its queue, the shared samplers and **one command encoder a frame**. Every system records its compute dispatches and render passes into that encoder, in call order, and the frame ends with a single submit: ```js await GPU.init({ canvas }); // each frame GPU.beginFrame(); ocean.update(dt); // records compute passes into the frame's encoder sceneRenderer.render(); // records render passes GPU.submit(); // one submit for the whole frame ``` One subtlety shapes much of the engine: `queue.writeBuffer` calls land before the frame's commands run. A buffer written twice in one frame keeps only the last value for every pass, so anything that changes between passes needs its own buffer, or its own offset. ### Uniform blocks A UniformBlock (`engine/gpu/Uniforms.js`) is a WGSL struct, its CPU mirror and its GPU buffer, declared once: ```js const U = new UniformBlock("OceanParams", { choppiness: ["f32", 0.9], sizes: ["vec4f", [733, 157, 33.3, 7.1]], viewProj: "mat4x4f", }); U.values.choppiness = 1.2; // uploaded on the next bind, only if it changed ``` The block lays the struct out by WGSL's alignment rules and writes the declaration for the shader, so the CPU and the GPU never disagree on an offset. ### WGSL modules The engine composes shaders from **modules**: a piece of WGSL (functions, structs, constants) together with the resources it reads (Shader.js (`engine/gpu/Shader.js`)). The terrain, for example, exports a module that defines `terrainHeightAt` and carries its height map. Any shader that lists it, directly or through another module, gets its code once and its bindings declared. Simplified, from TerrainGPU.js (`engine/terrain/TerrainGPU.js`): ```js export const terrainModule = new ShaderModule({ name: "terrain", deps: [commonModule], uniforms: terrainUniforms, bindings: { terrainHeightTex: { texture: () => heightTex }, }, code: /* wgsl */ ` fn terrainHeightAt(xz: vec2f) -> f32 { let uv = (xz - terrainParams.origin) / terrainParams.size; return textureSampleLevel(terrainHeightTex, smpLinearClamp, uv, 0.0).r; }`, }); ``` Bind groups follow one convention everywhere: | Group | Holds | | ----- | -------------------------------------------------------------- | | 0 | The frame: camera, time, sun, and the shared samplers | | 1 | The modules' and the material's resources, composed per shader | | 2 | Per-draw data (render pipelines only) | Modules can use a small preprocessor (`#if`, `#ifdef`, `#else`, `#endif`): the graphics presets switch features with defines instead of separate shaders. ### Compute kernels A ComputeKernel (`engine/gpu/Compute.js`) is a compute pipeline built from modules and a `main` body. The ocean's FFT, the surf simulation, particles and the terrain's selection all run this way: ```js const k = new ComputeKernel({ label: "fft rows", modules: [fftModule], bindings: { waveData: { storage: waveBuf, access: "read_write" } }, workgroupSize: [256, 1, 1], code: /* wgsl */ ` @compute @workgroup_size(WG_X, WG_Y, WG_Z) fn main(@builtin(global_invocation_id) gid: vec3u) { /* ... */ }`, }); k.dispatch(Math.ceil(n / 256)); // recorded into the frame's encoder ``` ### Materials A Material (`engine/render/Material.js`) is a set of WGSL snippets plugged into one mesh shader template (MeshShader.js (`engine/render/MeshShader.js`)): a `vertex` snippet that can move vertices and a `surface` snippet that sets albedo, roughness and normals. The template adds the lighting, shadows, the light under the water and the outputs every pass needs (colour, motion vectors for the temporal upscaler, the water mask): ```js const rock = new Material({ name: "rock", modules: [terrainModule], uniforms: { tint: ["vec3f", new Color(0.5, 0.45, 0.4)] }, surface: `s.albedo = mat.tint; s.roughness = 0.85;`, }); ``` The mesh renderer (`engine/render/MeshRenderer.js`) caches a pipeline per material and pass, culls and sorts the draws, and records them. ### Keeping the GPU healthy What the game builds during play is disposed when it is done with, and a test checks that GPU memory stays flat over rounds (gpu-leaks.test.mjs (`test/gpu-leaks.test.mjs`)). A lost or failing device stops the game loop and says so, instead of feeding a dead GPU. ## The ocean > How the sea is made. FFT waves in four cascades, shore waves that bend around headlands, surf foam, caustics and the view under water. The sea around every island is the engine's most involved system. It is several layers, each one doing what it is good at, summed into one surface: `engine/ocean/`. ### The open sea: FFT waves Far from the coast, the sea is a sum of thousands of waves with a realistic spectrum (the JONSWAP spectrum, after Tessendorf's classic method). Adding that many waves directly would be far too slow, so the engine does it in the frequency domain: it evolves the spectrum in time, then turns it into a height field with an inverse **Fast Fourier Transform** (OceanFFT.js (`engine/ocean/OceanFFT.js`)). *Figure: Four cascades of FFT tiles, from 733 m down to 7.1 m, summed into one surface* - **Four cascades**: tiles of 733 m, 157 m, 33.3 m and 7.1 m, each covering one band of the spectrum. The ratios between them are not whole numbers, so their repetition never lines up. - **Two dispatches a frame** for all of them: a row pass evolves the spectrum and runs a 256-point FFT per row in workgroup memory, then a column pass finishes the transform. - **Choppy waves**: besides height, the FFT gives a sideways displacement, which sharpens the crests, and the surface's derivatives, for normals without extra samples. - **Foam from the Jacobian**: where the displacement folds the surface on itself, a wave is breaking. Its Jacobian marks those places, and foam accumulates there and decays over time. ### The coast: shore waves The FFT tiles know nothing about the island. Near the coast, waves slow down in shallow water, bend around headlands, grow, and break. ShoreWaves.js (`engine/ocean/ShoreWaves.js`) models that wave by wave: - **Where waves go**: a travel-time field, solved once per island with the Fast Marching Method (ShoreField.js (`engine/terrain/ShoreField.js`)), gives each point when a wave front reaches it. Fronts bend around headlands and line up with the depth, like real swell. It is built in a worker, with the rest of the land. - **Shoaling and breaking**: a wave grows as the water gets shallower, until it is too tall for its depth. Then it plunges: the face turns into a wall, the lip is thrown (Breakers.js (`engine/ocean/Breakers.js`)), and the wave runs on as a turbulent bore. - **The swash**: the last of the wave runs up the beach as a thin sheet and drains back down. ### Surf and foam ShoreSim.js (`engine/ocean/ShoreSim.js`) keeps a simulation of the surf zone on the GPU, every frame: foam carried by the water (advected with the flow, thinned where it spreads), sand wetness that dries over half a minute, and foam stranded on the sand when the water drains. SurfFoam.js (`engine/ocean/SurfFoam.js`) shades it: dense white mats that tear into lace, then into thin bubble strands. ### Light through the water - **Refraction**: everything under the water is drawn into its own image, at half resolution, just before the water (RefractionPass.js (`engine/ocean/RefractionPass.js`)). The water follows its refracted view ray into it, so a wading unit's legs show through the surface. - **Caustics**: the bright nets on the seabed come from photon splatting (Caustics.js (`engine/ocean/Caustics.js`)): a fine grid on the real wave surface is refracted down to the floor, and where the rays focus the grid's cells shrink and add up to bright light. - **Under water**: when the camera dives, sunlight fades along its path through the water, the view fills with murk and marine snow, and the lens splits at the waterline (UnderwaterLighting.js (`engine/ocean/UnderwaterLighting.js`)). ### Asking the sea The game needs to know where the water is: to float a unit, to splash, to put the camera under. WaterQuery.js (`engine/ocean/WaterQuery.js`) evaluates the full surface on the GPU for a few points and reads the results back a frame or two later. The FFT moves points sideways, so the query solves for the point that lands where it asks, in a few iterations. ### On the lower presets The surf simulation and caustics are among the first systems the lower graphics presets switch off. The FFT always runs: the sea is part of every World. ## The camera > How the camera follows a unit, keeps clear of rocks and dives under the sea, the lens it looks through, and how speed, the booster and crashes reach it. In a third-person game the camera is half of how a unit feels. It decides what you see, how fast the World seems to move, and whether a crash lands like a blow or like a number. This page covers what Orbium's camera does, the lens it looks through, and how your unit's actions reach it. The repository's own notes on it (where each effect lives, what tunes it, what it costs) are in `CAMERA.md`. ### Over the shoulder During a match the camera rides a boom behind your unit and a little to its side, looking past its shoulder at what it faces (Walker.js (`client/src/game/Walker.js`), `placeCamera`). The boom is 6.4 m long and the vertical field of view is 62°. *Figure: The camera boom behind a unit, pulled in short of a rock that stands between the unit and where the camera wants to be* - **Keeping clear.** The boom never passes through the ground, a rock or the platform's deck. Each frame it is marched outwards from the unit's head in 0.25 m steps, and the first blocked step is bisected, so the camera slides smoothly along a slope instead of jumping a step at a time (`boomReach`). It pulls in quickly when something comes close and lets out slowly when it clears, so a rock passing behind you doesn't make the view pump. - **The shoulder.** The sideways offset is also checked, so the camera never slides into a rock beside the unit (`reach`). - **Height.** The camera follows the unit's height with a small dead zone and a short lag. Bumps and small hops don't shake the view, but the camera never falls more than 0.6 m behind. - **Looking up.** The more you look up, the shorter the boom, so the sky doesn't fill the screen with the unit as a speck. - **Under the sea.** When a unit dives, the camera goes under with it, crossing the surface in half a second, and the underwater lens takes over. Above the sea, it never drops into the waves (`seaCamera`). ### The long lens Holding zoom (right click, or LT on a gamepad) eases the field of view down to 24° and brings the camera in to the shoulder, with a heavier vignette and a little more grain, like a long lens (Game.js (`client/src/game/Game.js`), `lensTo`). The look slows by the same ratio, so a mouse movement turns the view by the same distance on screen either way. A rangefinder gives the distance to whatever the centre of the view is on. ### When you aren't driving - **Just down**: the camera stays where it was, easing back and up from the wreck while it watches it, focused on it with the rest soft, then cuts to someone still in the window. - **Watching**: it orbits the watched unit, with the same boom that keeps clear of rocks. Switching units is a cut, not a swoop across the World. - **A match's close**: the camera cranes up and over to the unit that took the match and circles it, keeping clear of the ground and the rocks around it. As the camera arrives, the lens focuses on the winner and what lies beyond softens. The last moment plays in slow motion: the World, the units and any bolt still in flight drop to a fifth of their pace as the match closes and are back to full speed within two seconds. The camera's move itself keeps real time. - **In the Hold**: choosing your unit's look, the camera flies down to it on its spot on the platform, focused on it, the deck and the others behind it soft. ### Shake and knocks Every effect on the camera goes through one small rig (CameraRig.js (`client/src/game/CameraRig.js`)). Whatever placed the camera this frame leaves its pose, the rig adds its effects on top as the last thing before the World is drawn, and takes them off again before the next frame. The crosshair's aim is taken before the effects, so they never move it. - **Layers.** An effect sets its own share of the field of view, roll, vignette and grain each frame, and the rig adds them up over the plain lens. The long lens is one of them. - **Shake.** A crash, a hard landing, leaving the deck, a bolt fired or landing nearby, or a hit raises the camera's "trauma", between 0 and 1, which then falls away in under a second. The shake is trauma squared, so small bumps barely register and big ones hit hard. It mostly turns the camera (yaw, pitch and roll) rather than moving it, and it follows smooth noise rather than a new random offset each frame: it feels the same at 60 and 240 Hz, and the motion blur and the upscaler don't smear it. Zoomed in, the turn is scaled down so it is the same size on screen. - **Knocks.** A spring that pushes the camera one way and lets it settle back, with one soft overshoot. Crashing into a wall or ramming another unit knocks the view away from what it hit and rolls it away from that side, as hard as the crash was fast. - **Camera motion**, in the menu: Full, Reduced or Off, or Auto, which is Reduced when your system asks for reduced motion. It scales the shake, the knocks and anything else that moves the view. The long lens is your own, and isn't scaled. ### The lens The camera looks through the engine's post effects (PostFX.js (`engine/post/PostFX.js`)), several of which are about the camera itself rather than the World: - **Motion blur**, light on purpose: a third of the frame's time, so fast turns stay readable (MotionBlur.js (`engine/post/MotionBlur.js`)). It can be turned off in the menu. - **Auto exposure**, adapting like an eye when you look from the shade into the sky. - **Vignette and film grain**, faint, stronger on the long lens, and on the Medium and High presets a faint colour fringe toward the edges, as a real lens has. There is no barrel distortion: the name tags and the reticle are placed over the World by its plain projection, and a warped image would slide out from under them. - **A lens flare** facing the sun, **water drops** on the lens after the camera comes out of the sea or a jet's spray hits it, and **dust**: a booster's blast or a hard landing in sand or snow close by leaves specks out of focus, in patches and more toward the bottom, and a faint film. Like dust on a real lens, the specks barely show against the sky but catch the light round the sun. It wears off in a few seconds and washes off in the sea (LensDroplets.js (`engine/post/LensDroplets.js`)). - **Heat shimmer** toward the horizon in the Desert. - **Cuts.** When the camera jumps (a cut to another unit) or turns sharply in a single frame, the post effects drop what they remember of the last frame, so the jump doesn't smear. ### Speed, the booster, crashes and hits What your unit does reaches the camera through the same rig (CameraFeel.js (`client/src/game/CameraFeel.js`)), eased so nothing snaps, and drawn on your machine alone: the server doesn't know about any of it. - **Speed.** The field of view widens with your speed, 6° wider at running speed, and less while you zoom. - **The boom.** It stretches back a little as you speed up, never into a rock behind you, closes in as you brake, and trails a little behind a sideways move, so your unit drifts off centre and settles back. - **The booster.** Its ignition punches the field of view 8° wider, fast in and slow out, and drops the view with a kick as the unit shoots up. It rumbles while it burns, and in the last of the tank it sputters, the jolts coming faster as it empties. The thrusters that bring you down from the platform do the same, much more gently: each pulse a small kick, the view a little wider. - **The water jets.** A burst surges your unit off, the view lagging behind it, and rumbles, harder under the water. At the surface it throws a rooster tail of white water, drops and mist behind you, and spatters the lens. Under it, the jets churn a milky plume of fine bubbles that billows, rises and thins away, with a stream of tiny ones and now and then a big one wobbling up, flattened into a cap. With Motion blur on, the burn opens the blur's shutter from a third of the frame to half of it. - **A speed blur.** Boosting at speed, with Motion blur on, the view streaks toward its centre at the edges, the centre kept sharp: six samples a pixel toward the middle, jittered so they don't band, and nothing while it's off. - **Heat haze.** Behind a burning booster the air wavers: what you see through the plume ripples, most just past the flame, fading toward its end. Yours and those of the units nearest you. It fades out close to the camera, so your own unit's exhaust never smears your view, and nothing in front of the plume is pulled into it. - **Banking.** In the air the view banks into your turns, up to about 4.6°. - **The ground under the wheels.** A faint, fast vibration by what you roll on and how fast: rough on rock and shingle, lighter on grass and the deck's plates, faint on sand and snow, none on ice. - **Landing.** The view dips by how far you fell, nods, and springs back. - **The Hunter's recoil.** Each bolt kicks the view up a little and narrows it by a degree, settled in about a tenth of a second, long before the next one. The bolt still goes where the crosshair was. - **Hit by a bolt.** The view is knocked away from the Hunter, and the lens pulses as it does in a crash. - **Worn down.** As your health falls, the view slowly loses its colour and closes in at the edges. - **A crash's pulse.** Besides the knock, the lens takes the blow: colour fringes toward the edges and a darker vignette for a moment, lit in the shield's light when your shield took it, washed of colour when it didn't. The hardest crashes muffle the sound for a moment too, through the same low-pass the sea uses. The fringe and the light are two uniforms in the final pass, skipped when they are zero: with them on, the pass measured the same. ### Close to the barrier The barrier is meant to look like it could hurt you, more the closer you come (Arena.js (`client/src/game/Arena.js`)): - **The field is never quiet.** Rings ripple out over it from a unit close to it, cells' outlines spark at random, more and more as it closes in, and its light flickers unevenly. Only the lines give light: the mesh holds still and you see through it between them. - **Its lines give off a shimmer.** In the final pass, each pixel's view ray is tested against the four walls of the barrier nearest the camera. Where it crosses one in front of the scene, the hex mesh is rebuilt there, and the image behind is pushed about just off the lines, fading toward the cells' middles, as if the lines were radiating. Nothing moves on a line itself, so the mesh stays put. It starts 45 m off the barrier and costs nothing further away. - **The camera picks up interference.** From 14 m in, grain and colour fringes rise and the view buzzes, finer and harder up to the touch. ### Rules the effects keep - **Your aim stays true.** Effects move the view, never where you aim, and the look is never smoothed or delayed. The Hunter's shake stays small, and a recoil settles before the next bolt can fire. - **Steady at any frame rate**, as above. - **Light on the GPU.** Most effects are a setting or a few samples in the final pass, skipped while off. Depth of field is the heaviest, a dozen samples a pixel, so it runs only on the shots where nobody aims and only on the Medium and High presets. - **Yours alone.** Everything here is drawn on your machine: the server doesn't know about any of it.