Docs/Development.md

Development

Prerequisites

  • .NET 10 SDK (the Godot projects target net8.0; the .NET 10 SDK builds them)
  • Docker Desktop
  • Godot 4.7 .NET edition: winget install GodotEngine.GodotEngine.Mono. Put the _console.exe on the PATH as godot, or set GODOT.
  • Git LFS (git lfs install once): the 3D models (*.glb) are stored with it. A clone without it gets small pointer files instead of the models, and the game shows no buildings (Cannot load ...glb in the log): run git lfs pull.
  • Optional: an OpenXR headset (Quest Link / Air Link, SteamVR, WMR...)

Build and test

dotnet build NexusOfFates.sln
dotnet test

How the tests are organised

Three xUnit projects in Tests/, all in NexusOfFates.sln (so dotnet test NexusOfFates.sln, and the CI, run them all):

Project What
Tests/Shared.Tests The libraries: protocol, world generation, rules, the simulation (WorldSimulation and its systems), the client's core (GameConnection, ApiClient, UI texts), the 3D models against their colliders, the replay hash, the allocations
Tests/Orchestrator.Tests The Orchestrator (cluster rules, Redis store, leadership) and the Telemetry service
Tests/Api.Tests The ApiServer's routes, in memory (WebApplicationFactory): tokens, register / login checks, the forge's checks, client downloads, flights. Its DbWorker, Telemetry and Orchestrator are stubs (ApiFactory: the named HttpClients db, telemetry, orchestrator get a stub handler; no Redis: the raid board's in-memory store), so it needs no running service. DbWorkerRouteTests: the DbWorker's bag routes reached by the URLs its callers build (a test server, no database), no service mapping a {0} format string as its route, and the retry of a serializable transaction

Tests/Benchmarks is not a test project (BenchmarkDotNet, below).

Helpers shared by Shared.Tests (TestUtil.cs), instead of a copy in each file:

  • RecordingOutbox: an ISimulationOutbox that keeps everything a simulation sends (corrections, handoffs and the handed-off states, stats, notices, arena fights, game events, fights, camp sites, raids; Log has the stats / corrections / handoffs in order). NullOutbox sends nothing and allocates nothing (for AllocationTests). ReplayTests keeps its own recorder: it hashes the calls.
  • TestUtil.RepoRoot(): the repository's root (to read a .glb, a script, a doc).
  • TestUtil.RoundTrip(msg): writes a message and reads it back, every byte read.

ProtocolReflectionTests round-trips every INetSerializable struct of Shared.Protocol, found by reflection: once filled with values that are not the default (numbers, bools, strings, enums, nested structs, arrays; the snapshot's entities within their cell or on a platform, compared with the wire's precision) and once empty. A new message is covered without writing anything; its own test in ProtocolTests.cs still checks what its fields mean. A field that is written but not read (or read but not written) fails it.

The docs quote the code by name, and DocNamesTests checks those names: a quoted CombatSystem (one word of several capitalised humps) or Rules.PlayerHeight (a dotted name) in Docs/*.md, README.md or AGENTS.md must be an identifier of the sources (C#, projects, scripts, configs, or a file's name), and a member after a type the code declares must be in that type's files. Rename or remove something: fix the docs that quote it (the test lists each place). A name quoted on purpose though not in the code (the protocol's history, a table's column, Kubernetes, a plan) goes in its Allowed list with its reason. File names, paths, commands and plain words are not checked.

Test hooks in the code, kept minimal and internal (InternalsVisibleTo Shared.Tests): GameConnection.ApplySnapshot and the WorldTime setter (a client at a chosen world time: the moving platform's end-to-end test, server snapshot to client entity), ApiClient(baseUrl, handler) (the client's HTTP calls against a stub handler) and ApiClient(baseUrl, http) (several clients on one HttpClient, as all the game's share one connection pool).

Validate a change (before every PR)

./Tools/Dev/Validate.ps1                    # build, tests, doc site export, local backend + 30 bots for 60 s
./Tools/Dev/Validate.ps1 -Godot -Bots 50    # same with Godot headless GameServers
./Tools/Dev/Validate.ps1 -Screens after     # + client screenshots in BuildOutput/screens/after/ (one client at a time; -ScreenJobs 3 is faster, but the clients then start at the same spawn and show each other)

It fails if a test fails, if a bot does not reach the game, if the bots kill no slime, or if an exception shows in .dev-logs/ (except PostgreSQL's serialization failures, 40001 / 40P01: a serializable transaction of the DbWorker that lost to another one, answered 409 for the caller to retry). The CI runs the same on main (and on a branch with Run workflow): see Continuous integration below.

Replay hash (Tests/Shared.Tests/ReplayTests.cs): a fixed scenario (seeded simulation, six scripted players: bitten, attacked from afar, shooting, leaving the owned cells, cheating a move then flying, teleporting) is played for 60 simulated seconds, and every snapshot (as sent on the wire) and every outbox event is hashed. A refactoring or a performance change must keep the hash. A change that alters the game on purpose updates Expected and says why in its PR. To see what changed, run the test with NEXUSOFFATES_REPLAY_DUMP=<file> before and after, then diff the two files. The hash depends on float results: it is the x64 one.

Screenshots: -Screens before on the base branch, -Screens after on yours, then compare BuildOutput/screens/before and after (spawn, game, aerial view over slimes, combat, map tab, VR menu preview). Slimes and clouds move, so compare by eye.

Continuous integration

.gitea/workflows/ci.yml (Gitea Actions) runs on the dev PC's runner: act_runner in C:\gitea-runner, label windows, host mode (no container: it runs as the PC's user, with its .NET SDK, Docker, Godot and Git LFS), started at logon by the scheduled task GiteaRunner. One job at a time. The steps run with a portable PowerShell 7 in C:\nfc\tools\pwsh (the zip of github.com/PowerShell/PowerShell, updated by hand): the Microsoft Store one, an app alias, sometimes cannot be started by the runner ("Access is denied").

When Job What
every push, any branch except queue/* and failed/* build-test Tools/Ci/Invoke-CachedTests.ps1: dotnet build NexusOfFates.sln, dotnet test (with the replay hash), unless this content already passed them (below); on failure the .trx results as the test-results artifact
push to queue/<branch> (merge-queue.yml) merge the merge queue (below): each queued branch merged into main, built, tested and validated, then pushed to main
push on main, or Actions > CI > Run workflow validate (after build-test) Tools/Ci/Invoke-CachedValidate.ps1: Validate.ps1 -Screens ci -Seconds 30 (doc site export, local backend + 30 bots for 30 s, telemetry, client screenshots: screens artifact, always), unless this content was already validated (below); on failure .dev-logs as dev-logs

Kept workspace (for speed): no fresh checkout. Both jobs work in one clone kept between runs, C:\nfc\ci\nexusoffates (C:\nfc is excluded from Windows Defender, which otherwise scans every DLL the build writes). Each job moves it to the pushed commit (git fetch of the ref, checkout --force) and cleans it with git clean -ffdx except bin/, obj/ (incremental build) and .godot/ (Godot's imported assets, for the screenshots); the Git LFS files stay; NuGet packages go to C:\nfc\nuget (NUGET_PACKAGES). It works because the runner takes one job at a time: with a higher capacity, give each job its own folder. The clone is anonymous (public repository): a private repository would need the job's token. If the workspace ever looks broken (a stale build), delete C:\nfc\ci\nexusoffates: the next run clones it again.

Already passed (Tools/Ci/ContentKeys.ps1): the checked-out content gets two keys from git ls-tree (the files' hashes, not the commit id): full (every file) and code (every file except Docs/ and *.md). So a merge commit on main has the same keys as its branch when main had not moved, and other keys when the merge mixes in other changes (then everything runs: that combination was never tested).

Build and tests (Invoke-CachedTests.ps1): same full key as a passed run, they are skipped (~18 s saved) with a ::notice:: naming that run. Kept in C:\nfc\ci\tested (the 50 newest keys).

Validation (Invoke-CachedValidate.ps1): same full key as a passed validation: nothing runs (a few seconds instead of ~3 min), the job says which run it was (::notice::) and attaches that run's screenshots; that is the merge of an already validated branch, whose merge commit has the same content. Same code key (only the docs changed): Validate.ps1 -SkipLive (build, tests, doc site export, ~30 s) and the screenshots of that code. Otherwise the full validation, recorded only when it passes. Kept in C:\nfc\ci\validated (the 30 newest keys). Run workflow has a force box that runs the build, the tests and the full validation anyway (e.g. after changing the PC: .NET SDK, Godot, drivers, Docker images).

The validate job uses the usual local ports and Stop-Dev.ps1 (which stops every dev process by name): when a local session runs on the dev PC (ports 8080, 8085, 8090, 8091, 8095 in use) it fails at once and says so, instead of cutting the session. Stop it, then Run workflow. A session on another PC does not matter.

Agents on other PCs. Several agents work on this repository, each on its own PC (the dev PC, other PCs of the local network). Only the dev PC has the runner: an agent elsewhere pushes its branch to the merge queue (below) to merge it, or starts a validation of its branch, and reads the results through Gitea (Actions, or the API: tea actions workflows dispatch ci.yml --ref <branch> for Run workflow, tea api /repos/nexusoffates/nexusoffates/actions/runs?limit=5 for each run's branch, commit, status and conclusion). Its own Start-Dev.ps1 / Validate.ps1 run on its PC and never block the CI.

Merging to main: the merge queue. The CI of main runs only after a merge: if it fails, main is already broken for everyone (several agents merge there). So the exact content that will land on main is tested before, by the runner, one branch at a time: the merge queue (.gitea/workflows/merge-queue.yml, Tools/Ci/Merge-Queue.ps1).

  1. git fetch, merge origin/main into the branch and fix the conflicts there (the queue never resolves one).
  2. Push it to the queue: git push origin HEAD:queue/<branch> (e.g. queue/feat/house-look). That is all: no CI to watch, no "main moved, start again".
  3. The runner takes the queued branches oldest first. For each: main with the branch merged in (--no-ff, message Merge <branch> (merge queue): <its last own commit> (not a merge of main into it)), build + tests, then the full validation (skipped when the same content already passed them), then main is pushed (only if it has not moved meanwhile: otherwise merged again on the new main) and queue/<branch> deleted. Your own branch stays as it is.
  4. A conflict with main (another branch went first and touched the same lines) or a red test: nothing reaches main, the branch moves to failed/<branch>, the run ends red with the reason (the conflicting files, or the failed step, its screens / dev-logs artifacts). Merge origin/main into your branch again, fix, push to queue/<branch> again. The other branches go on meanwhile.

Follow it in Actions > Merge queue (or tea api /repos/nexusoffates/nexusoffates/actions/runs?limit=5); a branch is merged once queue/<branch> is gone and failed/<branch> does not exist (git ls-remote origin 'refs/heads/queue/*' 'refs/heads/failed/*'). Pushes to queue/* and failed/* do not start ci.yml (the queue tests them itself). The queue runs with the runner's git credentials (the dev PC user's, as the release tags) and uses its script from main: a branch cannot change how it is merged. A local session on the dev PC (its ports in use) stops it as it stops validate: stop the session, then Actions > Merge queue > Run workflow. failed/* branches are deleted by hand once they are pushed again (or abandoned).

Merging by hand (git merge --no-ff into main after Actions > CI > Run workflow on the branch, main not moved meanwhile) still works, but the queue is the rule. No local retest is needed on top: the CI already runs that test. Validate.ps1 locally stays useful while working on the branch, before pushing.

There is no pull_request trigger: a PR from a branch of this repository shows the status of that branch's push run (a second run would repeat it), and the runner is the dev PC, so a fork's code must never run there (Gitea is on the local network only and closed to sign-ups, so there are no forks today).

The task runs whether the user is logged on or not (session 0): Godot still renders the screenshots there (checked on 2026-11-20, every picture complete).

The CI never publishes nor deploys: versions and deploys are by hand, with the Release and Deploy workflows (they use the CI's results: only a commit that passed it is published). See Deploy, How to.

Benchmarks and allocations

dotnet run -c Release --project Tests/Benchmarks -- --filter '*'      # BenchmarkDotNet, with allocated bytes

SimulationBenchmarks (a busy GameServer: 25 cells, 100 players): one 30 Hz tick, one snapshot round of every cell. ClientBenchmarks: reading a snapshot into the client's entities.

The hot paths must not allocate in the steady state (no garbage collector pauses on the servers, no frame hitches in VR). Tests/Shared.Tests/AllocationTests.cs checks it: collision queries, snapshot writing, weapon lookup, client snapshot reading, stale entity removal, and a tick allocates only the balls and zones it creates. Common traps found here: a yield iterator or LINQ in a per-frame loop, a lambda capturing a parameter anywhere in a method (the closure is allocated on entry, even on the early-return path), foreach over an interface (IEnumerable, IReadOnlyList, IReadOnlyDictionary.Values: the enumerator is boxed).

Run the backend

The dungeons' tests are paused (2026-11-30, the owner: the dungeons are out of the game, no gate in the town, Plan.md Dungeons; nothing deleted). They are marked [DungeonFact] / [DungeonTheory] (Tests/Shared.Tests/DungeonsPaused.cs, linked into Orchestrator.Tests): skipped with "Dungeons paused 2026-11-30: no gate in town, see Docs/Plan.md". Paused: all of Shared.Tests/DungeonTests (the caves' generation, their mobs, the paths), all of Shared.Tests/DungeonInstanceTests (spaces, the gate's crossing, the instance's mobs, the hall's fight, the champion, saving in the city), Orchestrator.Tests/DungeonInstanceTests (an instance's start and stop), three of SpaceSetTests (the space switch through a dungeon, in, out, late, refused), GameMenuTests.The_dungeon_tab_shows_in_a_dungeon_only_with_its_state, and in SafeZoneBuildingsTests the gate's model and its arch and pillars. Active still: what the world shares (SpaceSet's other rules, the menu's tabs, the protocol's messages, The_town_keeps_only_what_the_newcomers_game_uses). Validate.ps1 and the quest bot never went into a dungeon, so they stay as they are; only the hooks --forward and --dungeon-cycles (which went through the gate) lead nowhere.

Turn them back on in one place: DungeonsPaused.Paused = false; or run them once as they are: $env:NOF_DUNGEON_TESTS = 1; dotnet test (only theirs: --filter "FullyQualifiedName~Dungeon|FullyQualifiedName~SpaceSetTests").

Everything in Docker (closest to production)

cp .env.example .env            # then change the keys
docker compose --profile images build
docker compose up -d
docker compose logs -f orchestrator

The Orchestrator creates nexusoffates-gw-1 and nexusoffates-gs-2. They are not compose services: docker compose down leaves them running. Its state is in Redis (redis service, volume redisdata): the next Orchestrator start keeps them if they run the current images, else replaces them. Remove them by hand with:

docker rm -f $(docker ps -aq --filter label=nexusoffates.managed=true)

Leader + standby Orchestrator: docker compose --profile ha up -d adds orchestrator-standby. Check the roles with curl localhost:8090/api/health (role), then docker kill nexusoffates-orchestrator-1 with bots running: the standby leads within ~5 s, the bots stay in game. A fresh cluster state: docker compose down -v (also drops the database).

Local processes (fast iteration)

./Tools/Dev/Start-Dev.ps1          # GameServers = Tools/HeadlessGameServer (.NET, same core)
./Tools/Dev/Start-Dev.ps1 -Godot   # GameServers = Godot headless
./Tools/Dev/Start-Dev.ps1 -Release # GameServers with optimized code, as on the servers (performance measures)
./Tools/Dev/Stop-Dev.ps1

Without -Release the GameServers run the Debug build, which the JIT does not optimize: fine to develop, not to measure. The servers' image builds the Godot GameServer's C# with -c Debug -p:Optimize=true (Godot, run from the project folder, loads bin/Debug; the property makes it, and the libraries, optimized).

PostgreSQL runs in the nexusoffates-pg-dev container, Redis in nexusoffates-redis-dev and ClickHouse in nexusoffates-ch-dev (http://localhost:8123, for the Telemetry service on 8095: see Telemetry.md); the services run with dotnet run; the Orchestrator uses the Process provider. Logs: .dev-logs/. Stop-Dev.ps1 -Database also stops the PostgreSQL and ClickHouse containers.

You can also start a GameServer or a Gateway by hand (Manual provider), e.g. PORT=7300 godot --headless --path Apps/GameServer: it registers itself.

Play

godot --path Apps/Client                         # VR if an OpenXR runtime and headset are there, else desktop
godot --path Apps/Client --xr-mode off           # force desktop
godot --path Apps/Client -- --new-account        # a new test account (admin key: see Accounts for agents and bots), straight into the game
godot --path Apps/Client -- --api http://192.168.1.10:8080 --user alice --password secret

The desktop mode is for the source and the dev builds only: a store build (build.json channel Steam or Meta) is VR only. Without a headset (OpenXR not started) it shows Nexus of Fates is a VR game: no VR headset was found… (start.headset_needed) and quits (ClientBuild.NeedsHeadset, Main._Ready).

Desktop: ZQSD/WASD (physical keys, works in AZERTY and QWERTY), mouse to look and aim, Space (or left click) held to charge the blaster and released to fire where the crosshair points, J to jump (J again in the air: a wing S takes off), M for the menu, Esc to free the mouse. In deep water you swim (half speed, no shooting); look down and walk forward to dive. One blaster, always in hand. With the menu open you keep walking and shooting (Space); the mouse is for the menu: it is the VR one (3D screens in front of you), you point at a button and click it, the wheel scrolls. VR: left stick to walk, right stick to turn (30° snaps, or smooth at 120°/s: the mode, the snap's angle and the smooth speed in Options > Movement), A to jump (in the air, spread your arms to glide: controllers pointing down dive faster, up climb slower; the left hand higher than the right one turns right, like a plane's wings, the view turning with it (no stick turning while gliding); Options: the distance between the hands that counts as spread, the turn speed, the bank under which it flies straight (1°) and the one that turns the most (5°); the Options rows scroll with ▲ / ▼, the right stick or the wheel), in deep water you swim and dive (look down, push forward), B for the in-game menu (with hand tracking: a short pinch of a free hand, left or right, palm towards your eyes). The menu does not stop you: only turning stops while the right laser points at it, and it closes by itself when you walk more than 10 m away from it. Two blasters on the belt (left and right hip): grip near one to take it, release the grip to put it back; trigger held to charge, released to fire. Menus are clicked with either hand's laser (trigger, or pinch with hand tracking), which only shows while it touches a menu and stops on it; a pointed button lights up, a pressed one goes down.

Blaster: a slow ball (12 m/s, twice a walker), 3 s for a full charge; an instant shot has 10 % of the power, 2 s ≈ 50 %, 3 s = 100 % (exponential curve). 5 shots per blaster, one back every 1.5 s. Balls stop on the ground, trees and rocks; they go through players. Weapons are data (Libs/Shared.Gameplay/Weapons.cs): power, charge time and curve, ammo, reload, ball speed/size/range, colour, effect (damage now, healing later), magic cost, shot shape. The forge's blasters are computed from their level, rank, kind and seed (Blasters.cs, see Blaster forge in World.md).

Trees and rocks block walking (and mobs) on the client; the server stops balls on them.

DEV tab (only for an account with the DEV role, told to the client at login: AuthResultMsg.Dev; its settings in sections on the left of a wider screen, like the Options tab: Movement, Glide, World, Character, see Settings screens in UiKit.md): Dev locomotion (remembered in user://settings.cfg): no gravity, fly up/down with 8 / 2 (number row or keypad, desktop) or the right stick up/down (VR), at the walking speed (up / down at half), straight away.

  • Walk (− / +, 0.5 to 100 m/s, by 0.5 up to 10 then by 2): the character's speed, a stat the server keeps and checks (StatsMsg.Speed, DevAction.SetSpeed, default 5 m/s; equipment will raise it later): you walk a little under it and swim at half.
  • Run (the same steps, default 8 m/s; StatsMsg.RunSpeed, DevAction.SetRunSpeed): the speed with the left stick clicked (VR: until the stick is let go) or Shift held (desktop); the server accepts the faster of the two on the ground.
  • They go with the player from one server to the next (PlayerStateMsg.Speed, RunSpeed), but are not saved yet: the client remembers them (walk_speed, run_speed) and sends them again at login.
  • Under it, Jump (3.6 m by default, 0.5 to 50 m: the character's jump height, DevAction.SetJump; the server then accepts the feet that high + 2.4 m), Glide max speed (30 m/s by default, 2 to 300: where a vertical dive settles, the glide's own stat, not tied to the walk, to be improved later; there is no gliding speed: a glide starts with the speed it has), Glide accel (x1.5, 0.5 to 4: times the glide's gravity, a dive gains its speed sooner, a climb wins less height for the same speed; this client's), Glide hover (3 m/s, 0.5 to 20: how fast it comes down with the hands fully up, the airbrake; this client's, the server does not check it) and Swim (x0.5 the walk), kept by the server like the speed (DevAction.SetGlideSpeed, SetSwim, StatsMsg and PlayerStateMsg), sent again at login; the rows scroll (▲ / ▼, stick, wheel).
  • Two buttons set the speed straight away: Speed 5 (the default) and Speed 100 (the most); switching Dev locomotion on sets the most, off the default.
  • Biomes… opens the list of the biomes on the right (like the keypad; the biomes' names through Loc, GameMenu.BiomeName): one takes you to the nearest dry spot of that biome within 20 km (DevAction.GotoBiome, WorldGen.FindBiome: 30 m around it of that biome, off the water, the cliffs' walls and the safe zone).
  • Dungeons… lists the dungeons' ranges and floors: one takes you into that range's instance, at that floor's entrance (DevAction.GotoDungeon; Dungeons in World.md).
  • Flying does not shake off the mobs: in their zone they keep after you (their shots reach you, not their blows); switch Mob aggro off in the DEV tab to fly around undisturbed.
  • The GameServer accepts dev moves (flying, any speed: only with dev locomotion on) only from an account with the DEV or the Bot role (PlayerStateMsg.Dev / Bot, set by the Gateway at login, Server.Core.DevRights); others get a correction.
  • The test hooks' accounts (--new-account's) have the Bot role everywhere, so --fly / --goto work on staging too (Accounts for agents and bots below); on the local backend only (Start-Dev.ps1, Gateway env DEV_ROLE_FOR_GUESTS=true) they also have the DEV role (the DEV tab).

DEV tab → Speed (remembered in user://settings.cfg, DevSpeed): the speed with keys or stick pushed fully, walking and flying with dev locomotion: 0.5 to 10 m/s by 0.5, then 12 to 100 m/s by 2, with the − / + buttons (the same steps as Walk and Run above, DevSpeed.Values). Below normal, to try the walk and the run on a keyboard (the body runs from 2.4 m/s, walks again under 1.9 m/s); above normal, the client sends its moves as dev moves. Without the DEV role the normal speed applies.

DEV tab → Set level / Set gold / Go to camp: each asks a number (VR keypad, desktop dialog). They need the DEV role on the account: Monitor (http://localhost:8091) > Players > Grant DEV while the player is online, then log out and in again. Without it the game answers "Developer commands need the DEV role". Go to camp puts you at the entry of the nearest camp of that boss level (10 to 200), 15 m outside its edge; the GameServer needs a camp seed. The Monitor reaches the DbWorker with DbWorker__Url and DbWorker__Key (the worker key).

DEV tab → Items… (2026-12-01, Character section; it replaces the old Give items, gone with the DEV tab's help screen; the DEV tab's texts go through Loc like the rest): a list on the right of the centre screen (the menu's list of choices), one step at a time: Wings (every type, then its rank E to S), Pets (every kind, then its coat: PetLook.Coats), Blasters (every kind, then its rank) or Armour (every piece, then its role or sub-role, then its rank); < Back goes up.

  • The last click puts that item in the bag (DevAction.GiveItem, the value Shared.Gameplay.DevItem.Code), and the list stays to give another.
  • Blasters and armour are made at the character's level (a role or sub-role its level does not allow yet: at the lowest level that allows it, DevItems.ArmorLevel).
  • The Gateway refuses it to an account without the DEV role and to a bot's account even with it (Server.Core.DevRights, the one check of the developer commands: GiveItem is an admin command and IsDevOnly, refused to the Bot role and to a bot's account even with the DEV role, even for an admin's test session: the bots get no items), then the DbWorker (POST /db/characters/{id}/dev-item) puts it in the bag, or answers Your bag is full (BagRules); each item given is logged by the Gateway (who, which item, its id) and the DbWorker.
  • The item carries a hidden mark, InventoryItem.Dev (never shown to the players); every pet (a DEV one or a player's own, since 2026-12-01) may be thrown away from the bag like any item (the multi-select and the bin; out beside the player: put back first), the bin asking plainly first when a pet is among the picks (InventoryScreen.TrashConfirm, see Pets in Docs/World.md).
  • The bin says why it refuses an item (InventoryScreen.TrashRefusal: worn or held, a pet out too), the line staying under the bag until the next press; a refused pick among several no longer stops the others (RaidBoardController.DestroyMany: the count, then the first refusal).
  • The DbWorker's rule is ForgeEndpoints.Destroy (pure, tested with the owner's sequence: give, destroy, destroy two, give again).
  • Once an item is given, the Gateway sends the GameServer the bag's status (PlayerBagMsg, as a quest's ask), the session's name and ids read before the await.
  • The gold keeps its own commands (Set gold); to empty the bag, the inventory's multi-select and the bin.
  • Test hooks: --menu Dev/items (in the game, the list open at a wing's ranks; Dev/Character/items: beside the Character section); offline, without a server: --dev-items-preview [clicks] --login-shot out.png --wait 4 (the menu on the login's balcony, a sample level 30 developer; the clicks comma separated, 0,2 by default: the falcon wing's ranks; 3,3: the gloves' roles).
  • The list, like Dungeons…, takes the help screen's place while it is open. The list, like Dungeons…, stands on the right of the centre screen while it is open (the DEV tab has no right screen of its own since 2026-12-01).

A DEV account (needed to teleport with --fly / --goto, the DEV tab, level and speed commands): on the local backend, ./Tools/Dev/New-DevAccount.ps1 creates devtester if it is missing (a drawn password), gives its account the DEV role through the DbWorker (PUT /db/characters/{id}/roles, key WORKER_KEY or dev-worker-key) and keeps the credentials in BuildOutput/dev-account.json (git-ignored; run it again any time: it keeps the account and gives the role again). Then play it with -- --user devtester --password <printed> (a screenshot run with --user keeps your own settings untouched). Without the script, or on the shared dev server (its DbWorker is not open): create the account in the game, then Monitor > Players > Grant DEV on it and log in again. The DEV tab has Mob aggro: OFF, the mobs neither notice nor attack you (never saved, kept across servers), to look at them in peace.

Test hooks (screenshots, scripted runs, previews): every one is listed in Test hooks of the client below.

Texts (see Long labels in UiKit.md): --report-cuts prints each text the client still cuts with "…" (its box's size), e.g. with --lang de on every screen the hooks open; --accept-terms accepts the terms of use without their screen (with --new-account --new-character --login-shot PATH: the new character's page and its keyboard); --font-metrics PATH writes the UI font's widths for the tests (Tests/Shared.Tests/UiFontMetrics.json), then quits.

The login flow

The login flow (2026-11-29; the tokens: Device sessions in Security.md; its test hooks: The login and loading screens in Test hooks of the client below):

  • An account remembered on this device (its device session, Settings.DeviceToken) goes straight to the character screen at start, never into the world (the server not reached: the login screen says so and goes on as soon as it answers).
  • None: the login screen has only two choices, Log in and Create an account, with Credits and Quit game. No guest accounts any more.
    • Credits (beside Quit game): "A game made by" AKWA, the name in Client.Core/Credits.cs and the same in every language, and Back; in VR a UI kit UiScreen over the menu.
    • Each choice opens its form. Log in: username and password. Create an account: username, password and the password again (Client.Core.AccountForm: they must match, said in red under the form, the two passwords typed again). Back goes to the two choices.
    • In VR the fields are typed on a keyboard of 3D keys clicked with the laser (TextEntry in Client.Core, ⇧ once for a capital, twice to lock them, ← to erase; the username field keeps the last one).
  • Ways out of the account: only the character screen's Switch account (forgets the device's session and revokes it on the server, back to the two choices) and Quit (quits the game).
  • The balcony: the login screen stands on a balcony over a sea of clouds (LoginBalcony, VR and desktop, in a space of its own with its own sky: ClientSpaces, see Spaces in Architecture.md), made against vertigo.
    • A disc of pale stone under the feet with a railing at the waist and a column going down, the clouds 2 m below, dense and opaque (no height to guess), drifting very slowly: heaped clouds of the sky's own shapes (Clouds.Puffs), small beside the balcony and big towards the horizon, over a deeper floor in their shade (the gaps read as depth, not as a flat white).
    • In VR it shows only the menu, a blue block for each hand (no body yet), the balcony and the sky: no belt nor blasters (nor the desktop's blaster), no moving platforms (VrRig.InWorld, DesktopRig.InWorld, Main).
    • The menu stays where it is (one looks around at the clouds), put in front of the eyes when it opens and again when the headset is recentred (the system button of the right controller held: OpenXR's pose_recentered), each time once the headset is tracked (VrRig.HeadUsable: for its first frames it reports (0, 0, 0), and a menu placed then was in the floor; HeadAnchor), and never lower than 1 m above the feet.
    • Walking in the room, the balcony's deck slides along once the feet are 1.75 m from its centre, so one never walks off it (LoginPlacement in Client.Core).
  • The login check (LoginCheck, --login-check): the game's space out of the scene, nothing of the game shown, the eyes on the balcony, the VR menu in front of them and not in the floor. Validate.ps1 -Screens (so the CI) runs it on a desktop and with the VR menu, and after a game 3 km away, since things of the game leaked into the login screen several times when it was the game's scene with the world hidden (now a space of its own, ClientSpaces).
  • The session bar: the menu has it over its centre screen, on every tab (GameMenuVr.Session.cs): who plays (name, level, gold: SessionBar.Who) and Leave, which asks in the bar itself: Log out (back to the character screen: only the game session ends, the account stays signed in; another account: Switch account there), Quit game, or Cancel (closing the menu drops the question). Level, health, XP, kills and the last messages are in the Character tab (VR has no wrist panel).
  • The Map tab shows 1 km around you (no zoom); you are an arrow over its image (a mesh turned where you look, MapFrame.Fraction / ArrowAngle: sharp, where a few pixels of the 200 × 200 image made steps). The quest's Help target (Help: where to go in Quests.md) is an icon over it while within its range, else on the compass's edge with the distance, its explanation under the position.

The splash and loading screen

The splash and loading screen (2026-11-29; its own space, Spaces in Architecture.md): the game starts on black with its name, "Made with" and the Godot logo, for 1.5 s at least, until the characters are listed (or the login's two choices), then a fade; entering the world shows it again if that takes more than half a second.

  • The logo: Apps/Client/Assets/Splash/godot_logo.svg, the logo with its name for dark backgrounds of the press kit https://godotengine.org/press/, CC BY 4.0, https://github.com/godotengine/godot/blob/master/misc/logo/LICENSE.txt; the kit has no separate "Made with Godot" badge, so the mention is the text loading.made_with over the logo.
  • --new-account, --user, --login-shot, --login-check, --screenshot and --doc-shots leave the splash out (their timings are the screens'); --splash-min S asks for it, e.g. -- --new-account --splash-min 1 --screenshot out.png goes through both the start's and the world's.

The language is chosen on the login's first screen too (a list under Log in / Create an account, LanguageList, the same as the character screen's and the story's): every text changes at once (the menu is built again), kept in Settings.Language like the others (SessionController.ChooseLanguage; Loc.Changed refreshes what is already shown): one setting. The Options tab has it too, on its right screen above the controls (GameMenuVr.LanguageChosen, GameMenuController.RebuildInLanguage: the same setting, the menu built again in the new language on the same tab).

Item icons (ItemIconStudio): --icon-dump DIR saves every icon as a PNG and the log says how many were drawn and how long it took ([icons] 202 icons drawn in 900 ms: it was 5 100 ms when they were drawn one at a time, 3 frames each; measured on the dev PC, an AMD iGPU).

Accounts for agents and bots

No guest accounts (2026-11-29): the test hooks and the bots use accounts made with the admin key (the ADMIN_KEY secret, header X-Admin-Key; see Test and bot accounts in Security.md), never registered from the game, hidden from the players, shown with their kind in the Monitor's Players page:

  • Test accounts (test_ and 8 digits, kind test): --new-account (also --new-guest, --guest) asks POST /api/admin/test-accounts for one (ApiClient.CreateTestAccountAsync): its name, a random password and a session ready, the terms accepted. Deleted with their characters 3 days after they were made (the ApiServer's clean-up every hour, TestAccounts:LifetimeDays).
  • Bot accounts (bot_001..bot_5000, kind bot): a fixed pool, made the first time (POST /api/admin/bot-accounts/{index}), reused after (their password renewed each time, their characters kept), never deleted. Tools/BotClient takes them by index: --first N (default 1) for the first bot, --count; Load-Test.ps1 from bot_1001, Crowd-Test.ps1 from bot_2001 (new ones at each step), Perf-Test.ps1 from bot_3001 and bot_3501 in turn, Test-Session.ps1's team from bot_4001; --dev-test uses bot_900, --raid-test bot_901 to bot_903, --reconnect-test bot_904, --quest-test a fresh test account (a new character each run). --prefix only names them in the logs. The telemetry and the Monitor tell them by their name (bot_). A bot character too dirty to shoot (a new one comes as dirty as can be: no magic before its first bath, startDirt in upkeep.json) first walks into the fountain until clean, then steps out over its rim and goes to fight (the summary's washed first); without it a fresh pool, as on a new database, kills nothing (Validate.ps1's live run). The summary's kills total counts this run's kills only (a pool bot's character keeps its count from the runs before).
  • The key (Client.Core.AdminKey): the environment variable NOF_ADMIN_KEY, else the file ~/.nexusoffates/admin-key (one line, on the worker or the PC, never in the repository), else the development key dev-admin-key, which only a local backend takes (Start-Dev.ps1: no ADMIN_KEY set, the services fall back to it; a real server refuses development secrets). So nothing to set for a local backend; for staging or the dev server, put that server's ADMIN_KEY in NOF_ADMIN_KEY (or the file) on the machine that runs the hooks or the bots. Without the right key the hook says "Test account refused: no admin key".
  • The Bot role (2026-12-01, Roles in Security.md): every test and bot account gets it when it is made or reused, on every environment (local, staging, prod): the developer moves and commands (--fly, --goto, level, speeds, mob aggro off) work for the bots, the quest bot, the test hooks' --new-account and the headset's test account, without the DEV tab nor the admin commands (gold, items: refused). Other players see [bot] over their name; their fights are kept out of the players' numbers. A bot account by hand (e.g. the Quest headset on staging): ./Tools/Dev/New-BotAccount.ps1 [-Api https://staging.sushivr.ovh -AdminKeyFile ~/.nexusoffates/admin-key-staging] [-Index 900] (the pool's bot_<index>, its character Bot<index> made if missing, the terms accepted, the credentials in BuildOutput/bot-account-<index>.json, a new password each run), then -- --user bot_900 --password <printed>. Or Monitor > Players > Grant Bot on any account (from its next login).
  • On the local backend the test accounts also have the DEV role (DEV_ROLE_FOR_GUESTS, kind test, and the guest_ accounts of before), as before: the DEV tab and its admin commands too.

Test hooks of the client

Command-line hooks for scripted runs, screenshots and measures, given after -- (e.g. godot --path Apps/Client --xr-mode off -- --new-account --screenshot out.png). They are read by Apps/Client/Scripts/TestHooks.cs; this list is the reference: every hook the client reads is named here (a test checks it, DocLinksTests), the topic docs say more about the hooks of their subject. Unless said otherwise, a "preview" is local only: the server is not told.

The run

  • --api URL: the ApiServer to use (default: the settings').
  • --new-account: a normal account registered for the run (random name and password), default settings, nothing saved: your own settings and account are left alone, and a screenshot never depends on an earlier run (Validate.ps1 -Screens uses it). Old names: --new-guest, --guest. See Accounts for agents and bots.
  • --user NAME --password PASS: play that account without touching your settings.
  • --character-screen: stop at the character screen instead of playing the first character; --new-character: on its new character's page.
  • --accept-terms: the terms of use accepted without their screen (with --new-account --new-character --login-shot PATH: the new character's page and its keyboard).
  • --lang CODE: the texts in that language (en, fr, de, nl, pseudo), whatever the settings say.
  • --quality NAME: that profile of Config/quality.json (pc, quest3, quest2) whatever the device; --quality-set KEY=VALUE,...: some of its settings changed for the run (Quest performance below).
  • --seed N: the world's seed for the offline previews and --doc-shots (1234 by default).
  • --net-sim LATENCY,JITTER,LOSS: a bad network, every packet delayed LATENCY ± JITTER ms, LOSS % lost (with --perf, the interpolation's counters).
  • --auto-update: presses Update on the login screen when an update can be installed.

Pictures and timing

  • --screenshot PATH: saves the view --wait seconds after entering the world (5 by default; --wait 8), then quits.
  • --login-shot PATH: the login screen (never this PC's remembered account) saved --wait seconds after the start, then quits; the offline previews below use it too.
  • --on-hazard: the screenshot 0.6 s after the first mob's zone appears.
  • --shoot: charges and fires the blaster just before the screenshot.
  • --stream MODE: the stream camera out (follow, free, selfie, firstperson; not saved), its window's image saved too as PATH-stream.png; --stream-reopen: put away and taken out again before; --stream-names off: Show players' names off.

Where and how the player stands

  • --fly H: starts H metres up with dev locomotion (not saved; a DEV account); --goto X,Z (with --fly): somewhere else.
  • --walk 1 (with them): on foot there 1.5 s later (falls, or swims in a lake); --forward S (with --walk): straight ahead S seconds.
  • --dive S (with --walk in deep water): dives S seconds, then looks at --pitch (e.g. --fly 20 --goto -326,-892 --walk 1 --dive 4 --pitch -10: 17 m under the water with the seed 1234).
  • --yaw DEG, --pitch DEG: the desktop camera's heading (0 along +Z, 90 along +X) and its look up or down (e.g. --fly 2 --goto 20.14,23.40 --walk 1 --yaw 40 faces the forge's screen).
  • --glide (with --fly and --walk): level glide as soon as it falls, whatever the wing and the arms (gliding measured without moving the controllers: Tools/Dev/Quest-Perf.ps1).
  • --wing TYPE,RANK: the own VR body wears that wing (the glide's wind measured on a headset).
  • --body-eyes [stand|walk|crouch|tiptoe|stick]: the VR player's own body under the desktop camera, as from the headset (hung from the neck, BodyTracking.PlaceOwn; --pitch -45, -70, -90 show the chest then the legs; walk: forward 30 s, crouch: Ctrl held, tiptoe: the head 15 cm above standing after 2 s, stick: crouched then stood up with the stick).
  • --belt-hold H,S,F: Options' Blasters for the run, not saved: the VR belt's blasters moved up, apart and forward by these metres (with --body-eyes stand --pitch -60: that belt seen from the eyes; Client.Core.BeltHold).
  • --origin-test: moves the floating origin by ±1 024 m every second: the picture must not change (Floating origin in Architecture.md).

The menus

  • --menu TAB[/WHAT]: the in-game menu opened on a tab 4.5 s before the screenshot. Options/Audio: a section. Players/pick, report, friends, party, ask: the nearest player picked, its report, the friends' list, the party (the nearest player invited first), a friend request's and a party invitation's panels. Character/banner: an error's banner and the server's announcement. Inventory/pouch, name, trash, sort, drag, tip (with --inventory-preview): a pouch made, a pouch's name typed, the bin asking, the bag sorted, an item carried, a picture's explanation (GameMenuVr.PreviewInventory). Map/help-near, help-far, help-champion, help-water: a sample Help target on the map. Quests/sample, done, abandon, notice, envoy, rags, flight, flight2, take:ID (local quest states, GameMenuController.PreviewQuests).
  • --press A,B: presses the menu's buttons 2.5 s after it opens, 0.3 s apart (MenuAction names, e.g. --menu Forge --press ForgeRank,ForgeKind,ForgeMake, --menu Inventory --press EquipLeft, DevSetLevel, HoldPair).
  • --click X,Y[;X,Y...]: desktop mouse clicks at these points of the window after the presses, 0.5 s apart (a menu's switch); --click forge|barber|dummy|board|chief|master: 3 s before the screenshot, a click on that station or NPC (stand near it with --goto).
  • --station-keypad: a station's keypad (the forge's, the arena's level) opens with its screen.
  • --vr-menu-preview: the VR menu and status panel on a desktop, where the headset shows them.
  • --menu-tour (with --new-account --quality quest3 --wait 8): the menu opened, each tab visited and closed, twice, each step's cost printed ([menu-tour]); exit code 1 when the first opening costs 250 ms more than the second (Docs/perf/2026-12-01-menu-first-open.md).
  • --inventory-preview: a sample bag (27 items, three pieces worn; two worn pieces and two in the bag worn down, for the forge's Repair) instead of the character's, and a sample collection; --inventory-wing Albatross:E: the sample character wears that wing.
  • --dev-items-preview [clicks]: the DEV tab's Items… list on the login's balcony, offline (clicks: the list's rows, default 0,2).
  • --card-preview [wings|items|tip|scroll]: item cards on the login's balcony, offline (see UiItemCard in UiKit.md).
  • --feedback-preview [open|caret|reopen|sent|failed|bar]: the menu's Bug report without a server (see Client in Feedback.md).
  • --session-who NAME,LEVEL,GOLD: the menu's session bar shows that name, level and gold (a long name and a big gold beside Update and Bug, with --game-update-preview and --feedback-preview bar); look only.
  • --barber part=choice,...: once the barber's screen is open, those parts of the look chosen (skin=12,eyes=9, LookPart names); tab=1: the face group; apply: Change my look 4 s later.
  • --report-cuts: prints each text the client still cuts with "…" (see Long labels in UiKit.md).
  • --font-metrics PATH: writes the UI font's widths for the tests (Tests/Shared.Tests/UiFontMetrics.json), then quits.

The login and loading screens

  • --login-form create|login: a form open; --login-mismatch (with create): two passwords that differ, and the message.
  • --login-credits: the login screen on its credits.
  • --login-check: checks the login screen (LoginCheck), exit code 1 on a failure; --logout-after S: S seconds in the world first, --relogin: then plays again 2 s later.
  • --vr-login-preview: the VR login menu on a desktop too.
  • --update-preview: the login screen as when a newer version is there (only Update, Credits, Quit game); --game-update-preview: in the game, as when a newer version was found.
  • --terms-preview [end] (with --login-shot and --api): the terms of use's screen, scrolled to its end with end.
  • --splash-preview [entering]: the splash space alone, held; --splash-min S: the splash at the start stays S seconds at least.
  • --intro-preview [seconds]: the opening story without a server, played or held at that moment; --intro-language: its language list (The opening story in Characters.md).

The player's situations

  • --ghost-preview: the ghost look (grey world, hint, the others as ghosts).
  • --point-preview [ring]: the first hand points at the nearest player and holds, the menu opens on it 3 s later (ring: stops half full).
  • --npc-talk [S]: S seconds before the screenshot (3), talks to the village chief (stand near him, e.g. --fly 2 --goto 0,7.4 --walk 1 --yaw 180); --npc-say NPC:LINE: that NPC's panel shows that line (e.g. Blacksmith:dress_rags).
  • --quest-done ID: that quest counted as handed in, on the client only (dress opens Borin's forge: --click forge near him).
  • --forge-item N[,LEVEL]: the forge's screen opens on that item (0 blasters, 1 to 5 armour, 6 wing) and level; its four screens (Plan, Forge with its price detail, Chances, Repair), e.g. --quest-done dress --fly 2 --goto 20.6,24.0 --walk 1 --yaw 15 --inventory-preview --click forge --lang fr.
  • --training-state running|result|countdown: the training screen by a dummy in that state (stand by one with --goto).
  • --race-start: 2.5 s before the screenshot, the board's Start a race (asks the server).
  • --tracker-preview race|envoy|hunt|flight|ready: the quest log as if the server said that step; --tracker-always: the objective tracker always shown; --watch-preview looked|reminder: the quest watch held up (The quest watch in Quests.md).
  • --status-preview: the poison and slow badges; --rest-preview: the bars' resting glow; --stamina-preview F: the stamina bar at that share (0 to 1); --takeoff-preview F: a wing S's take-off icon, its cooldown done that share (1: ready).
  • --dictation-test WAV: the local dictation engine writes what a 16-bit WAV file says and the time it took, then quits.

Models and effects in front of you

  • --mob-preview [species]: the biomes' mobs (every species, or ten of one); --aura: each in its aura's bubble; --rarity: normal, elite, champion in turn.
  • --goblin-preview [M]: goblins M metres away (7); --character-preview [M]: five players' characters (6) and a ghost under its beam; --look-preview [ROW]: six looks side by side (another ROW, other looks).
  • --armor-preview [M]: a row of bodies (3.5): bare, a set of each role, mixed pieces; --armor-kind back|eyes|ghost.
  • --blaster-preview [M]: every kind and rank of blaster (6), levels 1 to 1000, and the shots' shapes; --blaster-kind wear: each worn 0 to 100 %; --blaster-views DIR: six views of each kind (ranks S and E) saved, then quits.
  • --body-preview [M]: a body with a VR tracking (2.5), a blaster held, and a body gliding.
  • --pet-preview [raccoon|dog|cat|falcon|looks|shoulder-KIND[-wing]|glide-falcon]: the pets' poses on the login's balcony, offline (Pets in World.md).
  • --icon-preview [M]: every item icon on a board (2.2); --loot-preview: a row of loot orbs (gold, then E to S).
  • --cloud-preview [M]: a cloud around the eyes, or M metres away; --wave-preview [M]: a golem's shockwave again every 4 s (9).
  • --shots-preview N: N shots hanging 5 to 25 m away (their cost with --perf); --shots-nolight: without their lights.
  • --doc-shots DIR: the doc site's images of the mobs, blasters and biomes, offline, then quits (--only GROUP: one group; ./Tools/Dev/Build-DocImages.ps1).
  • --icon-dump DIR: the items' icons saved as PNG once drawn; --no-icon-cache: drawn at the start, the disk cache unused.

Dungeons (the city's gate is retired: the offline preview or the DEV tab's way in, Dungeons in World.md)

  • --dungeon-preview [range]: a range's caves (0 to 3) walked offline; --dungeon-champion: in the champion's cavern; --dungeon-at stairs|chasm|lava|floorN: where to start; --dungeon-cleared: the champion's portal shown; --dungeon-rally: every mob fighting in the champion's cavern; --dungeon-off glow,fog,lights,lantern,crystals: parts of the look off.
  • --dev-dungeon RANGE,FLOOR (online, a DEV account): 3 s into the world, the DEV tab's way into that dungeon; --dev-level N: the character's level set first.
  • --back-after S: S seconds into a dungeon, the menu's teleport home; --dungeon-menu TAB, --dungeon-turn DEG: 6 s into a dungeon, the menu on that tab, turned round.
  • --dungeon-cycles N --cycle-shots PREFIX: in and out of the dungeon N times, a picture 5 s after each arrival (PREFIX-inK.png, PREFIX-backK.png); --leave-delay S: the teleport asked S seconds after its loading screen (a slow server).

Measures

  • --perf (with --screenshot): prints the frame's rendering counters and times, averaged over 1.5 s, just before it.
  • --perf-run S --perf-out FILE: after --wait seconds of warm-up, S seconds of frames measured, a JSON report, then quits; --perf-spin DEG: the camera turns meanwhile (Tools/Dev/Perf-Test.ps1); --perf-steps base,near,props,...: one step per hidden group (PerfBreakdown, Tools/Dev/Quest-Perf.ps1).
  • --budget FILE (--budget-shots DIR: a picture of each view): the Quest budget's fixed scene measured offline, then quits (Quest budget below).
  • --no-shadows, --no-mesh-merge, --mob-lod near|mid|far: shadows off, static pieces not merged, every mob at one level of detail: to measure what each costs.

Load and scaling test

dotnet run --project Tools/BotClient -- --count 50 --radius 500 --seconds 120

A crowd on the dev server (its servers watched): Tools/Dev/Crowd-Test.ps1 runs waves of bots from this PC against https://sushivr.ovh while the node is sampled every ~3 s over SSH (each instance's tick time, messages per second, players and mobs from the Orchestrator; each Gateway / GameServer container's CPU and network). -Center X,Z -MinRadius 1 -Radius 100 puts them round a player to look at them in VR; the logs and CSVs go to BuildOutput/crowd/.

./Tools/Dev/Crowd-Test.ps1 -Steps 25,50,100 -Seconds 60                                  # everyone on the plaza, headset bodies firing
./Tools/Dev/Crowd-Test.ps1 -Steps 10,20,50,100 -Seconds 30 -Center 32,-275 -MinRadius 1 -Radius 100

Performance test (run again, compare)

Tools/Dev/Perf-Test.ps1 measures what the game costs, the same way every time, and writes one JSON report and a short markdown summary per run in BuildOutput/perf/<date>-<target>.json (the bots' CSVs and logs, the client's reports beside it, in a folder of the same name). Two runs compare: -Compare old.json new.json prints each scenario's numbers that changed, and by how much. The reports worth keeping go in Docs/perf/ (BuildOutput/ is not committed).

./Tools/Dev/Perf-Test.ps1 -Api https://staging.sushivr.ovh -AdminKeyFile ~/.nexusoffates/admin-key-staging -Target staging -Client
./Tools/Dev/Perf-Test.ps1 -Bots 25,50 -Moves walk,fly -Window 30 -Client -ClientBots 25   # the local backend (Start-Dev.ps1)
./Tools/Dev/Perf-Test.ps1 -Compare BuildOutput/perf/2026-11-30-1200-staging.json,BuildOutput/perf/2026-12-02-0900-staging.json
  • Scenarios: -Bots (50, 100, 200) × -Pets (off, on: each bot's pet out, BotClient --pet) × -Moves (walk: the bots fight round the spawn; fly: BotClient --fly, below). Each one: the bots log in (over a few seconds), -Warmup seconds (45), then -Window seconds (60) measured, then every bot stopped. Two pools of bot accounts in turn (bot_3001…, bot_3501…: -First).
  • The servers: every 2 s, GET /api/admin/server-metrics (the ApiServer, admin key: the Orchestrator's state, each instance's last heartbeat, the numbers Telemetry writes to server_metrics for the Monitor). Each GameServer and Gateway measures its own loop (Server.Core.LoadMeter): the tick's moving average, its p95 and longest of each second, its process's CPU (100 % = one core), its memory and what it sends (kB/s). The report keeps the busiest GameServer's tick (mean, p95, max), the CPU of all GameServers and of all Gateways, and the Gateways' kB/s per player. A target without the route (an older version) still runs: its server part says unavailable.
  • The bots' side (their --csv, every 5 s): kB/s each receives (what its Gateway sends it), packets, entities seen, how many wear a wing and their share of time in the air; and the bots' own CPU (they run on the same machine).
  • The client (-Client, at -ClientBots bots only): the Godot client in desktop mode (-Resolution, 1280×720), a test account, in each of -ClientPlaces: town (by the fountain) and outside (150 m east, among the walking bots' fights; --fly/--goto: the Bot role, which every test account has). --wait 15 to settle, then --perf-run 30 --perf-spin 18 (the camera turns 18° a second, the same path each time) and its JSON: fps, frame time mean / p95 / p99 / max, GPU and render CPU, draw calls, objects, primitives, the particles emitting (systems and amount), nodes, video memory, the entities in sight (players, pets, mobs), the players wearing a wing and gliding. Only comparisons count: the machine's GPU decides the absolute fps.

Where a slow tick went (2026-11-30): a GameServer tick over 20 ms is logged (Slow tick 43.9 ms (on a CPU 6.6 ms, waiting for one 37.2 ms): net …, sim …, snapshots …, saves …; GC gen0 +0, gen2 +0 | sim: mobs 33.7, regen 0.6, …; chunks built 0; alloc 0 kB): the thread's own time on a CPU and waiting for one (Linux, /proc/thread-self/schedstat: Server.Core.ThreadSchedule), the host's parts, whether the GC ran, then each system of the simulation (Server.Core.Simulation.TickProfile: the per-player systems summed), the obstacle chunks built (cache misses) and the bytes allocated. With NOF_TICK_PROFILE=1 in the GameServer's environment (Start-Dev.ps1 passes it on), also each mob's steps (its fight's record, respawn, target and aggro search, affixes, act), its moves' time and the slowest mob. A tick that mostly waited was not slow code: the machine was busy elsewhere (bots, builds, other containers). The server also does its first times before the players come (Server.Core.Hosting.Warmup, ~1.3 s on a background thread at the start: the static constructors, every method compiled, a save's JSON), else the first shot, fight or save of a fresh server cost a tick 30 to 200 ms. Measures in Docs/perf/README.md.

Bots that fly (BotClient --fly): each bot wears a wing (its bag's, else a free one: POST /api/admin/service-wing with the admin key and the bot's character token, test and bot accounts only, never a player's; bot i the i-th type, ranks in turn), then again and again: to the flight tower's ramp (along its line from outside the supports' ring, then its foot: 2026-11-30, aiming under the upper turns they stuck on a support and never climbed), up its four turns (a step short of the top: SafeZoneTower.StandOn gave the turn below at its very end; fixed with a flat landing, RampLanding), across the deck to the board's tip, crouched there until its stamina is back (resting: ten times faster), a jump and a glide with the game's own Glider (hands level, a heading of its own within ±35° of the hoop's axis, a slight turn), the landing, and back on foot. The server checks it as a player (speed, height, stamina): the summary's corrected stays at 0; about 15 % of its time is in the air. Others see the wings worn and in flight.

Arena bots (balance, no backend but the Telemetry service): dotnet run --project Tools/BotClient -- --arena fights a grid of levels, gaps, rarities and behaviours inside the server's simulation, about a thousand fights a second, and prints them against Config/balance.json (see Arena bots in Telemetry.md).

Waves with metrics (Start-Dev.ps1 running): Tools/Dev/Load-Test.ps1 starts waves of bots and reads the Orchestrator's state every 5 s (players, each GameServer's tick time, messages per second, memory, mobs, each Gateway's messages per second), then prints the worst values of each wave and writes a CSV in BuildOutput/. The tick budget is 33 ms (30 Hz). -Radius 300 keeps everyone in a few cells (one GameServer's limit), -Radius 1300 spreads them (more active cells: more mobs). Add GameServers from the Monitor (or POST /api/instances {"kind":1}) to see the load split.

./Tools/Dev/Load-Test.ps1 -Steps 50,150,300,450 -Seconds 60 -Radius 300

Measured on a 12-core Ryzen AI 9 HX 470 (bots, servers and Gateway on the same machine, .NET headless GameServers):

Players Spread GameServers Tick (worst)
300 300 m 1 19 ms
450 300 m 1 33 ms (the limit)
600 300 m 1 48 ms (≈ 21 Hz instead of 30)
300 1 300 m 1 38 ms
450 1 300 m 3 13 ms

Simulation capacity (no network): dotnet run -c Release --project Tests/Benchmarks -- capacity plays scenarios on one GameServer's simulation (owned cells, players next to the mobs, forged blasters fired at a rate) and prints the tick time and the snapshots' bytes per second. CAPACITY_ONLY=side,players,shots_per_s[,1] runs one (,1: players anywhere in the square, most mobs see no one), CAPACITY_TOUGH=1 makes the mobs immortal (homing shots keep finding them), CAPACITY_PRIMS=1 times a terrain height and an obstacle query. Measured on main (2026-11-18, Ryzen AI 9 HX 470): 3 000 players next to the mobs of 25 cells 0.4 ms; 11 000 shots in flight (1 000 players, 4 shots/s, immortal mobs) 5.3 ms; 1 000 players spread over 400 cells (780 mobs) 1.2 ms. That last one was 57 ms while every mob without a target looked at every player of the server each tick: a mob now looks only at the players of its cell and the 8 around (PlayerGrid, rebuilt each tick; its ranges are shorter than a cell), the distance before the terrain height.

A spread crowd costs more than a dense one (every player wakes the 5 × 5 cells around it, with their mobs). The simulation itself is cheap (SimulationBenchmarks: 19 µs per tick for 100 players in 25 cells): most of the tick is network work. With 700 players and a single Gateway (12 000 messages/s), the clients missed entity metas for about 40 s: add Gateways before that.

Client rendering counters: --perf with --screenshot prints one line before the screenshot (frames per second and frame time, Godot's worst process and physics steps of the last second, the renderer's CPU time, the GPU's time, the worst frame, the view size, the players, mobs, corpses and others' shots in sight, draw calls, triangles, objects, video memory), e.g. -- --new-account --perf --screenshot out.png --fly 45 --goto 0,70 --pitch -30 --wait 14. The client uses the mobile renderer (as on a Quest), so the draw calls and triangles carry over to a headset; the frame rate does not. To measure one cost, compare two runs: --no-shadows (the sun casts no shadow), --shots-preview N (N shots hanging in front, --shots-nolight without their lights), --mob-preview, bots around the spawn (dotnet run --project Tools/BotClient -- --count 50 --radius 50). Measured on main (2026-11-18, Radeon 890M, 1832 × 1061, MSAA 4×): the safe zone alone 590 draw calls, 380 k triangles, 2.1 ms of GPU (the sun's shadows 0.5 ms); a player in sight about 3 draw calls and 12.6 k triangles; a mob about 10 draw calls and 4 k triangles; a shot 2 draw calls (its own materials) and 0.001 ms of GPU for its light. Meta's targets: under 200 draw calls and 1.5 M triangles on a Quest 3, under 100 and 750 k on a Quest 2. The line ends with the terrain's work on the main thread: terrain_longest_frame_ms (the worst frame, including the first frames' code warm-up), terrain_longest_after_warmup_ms (after 30 frames) and terrain_ready_s (time until everything around was first built).

A crowd of VR players (the realistic worst case: everyone on the plaza, headsets on, firing): BotClient --radius 15 --vr --shoot keeps the bots within 15 m of the spawn (--center X,Z: around that point instead of the spawn, e.g. around a player to watch them, the bots walking there from the spawn, between --min-radius and --radius metres of it; --ramp S: logging in over S seconds; --gateways host:port,…: bot i on the i-th Gateway, the API not asked), each sending a VR body with each position (15 Hz): the head looking around, a blaster in each hand held as a player holds it (BlasterGrip), aimed where its next shot goes while it charges, the index pulling, the charge shown; between shots the hands down and firing both hands as fast as they charge; every 5 s it prints what a bot receives from its Gateway (kB/s, packets/s, mean and worst) and sends (--csv file keeps those lines). Measured on the dev server (2026-11-21, one RK1: 8 ARM cores, one Gateway and one GameServer in Docker; the bots on the dev PC, over the LAN):

Players on the plaza Received per player GameServer tick Gateway CPU
25 55 kB/s, 70 packets/s 1–5 ms 14 % of a core
50 100 kB/s, 120 packets/s 2–3 ms 35 %
100 200 kB/s, 215 packets/s 3–16 ms 80 %
150 280 kB/s, 290 packets/s 5–13 ms 125 % the Gateway's limit
200 210 kB/s (half of what it should) 8–14 ms 125 % (saturated) players shown without their meta

About 2 kB/s per other player in sight (position, VR body, shots), so a crowd costs the square of its size: 150 players there send ~340 Mbit/s out of the Gateway. The GameServer is not the limit (a third of its budget at 200); the single Gateway is, then the bandwidth.

More Gateways absorb it: with three on the same RK1 (the players spread over them), 150 players get their full 300 kB/s with each Gateway at ~50 % of a core, and 200 players their full 430 kB/s (no entity without meta) with each at 70–90 %, the GameServer at 9–12 ms. Gateways scale by adding more (one per few cores of a machine, or more machines), not by threads inside one. And before both, the client: on the dev PC (Radeon 890M, flat screen 1280 × 720) the plaza alone draws in 3.0 ms (332 fps), with 50 players in sight 6.2 ms (160 fps, 1 095 draw calls, 1.7 M triangles), with 100 players 14.7 ms (68 fps, worst frame 22 ms, 1 478 draw calls, 2.7 M triangles; 5.3 ms of render CPU): far over a VR headset's 11 ms at 90 Hz and Meta's 200 draw calls. A player in sight costs about 9 draw calls and 18 k triangles (body, hands, name plate, shadows).

Since then (protocol 34): the avatars' rings (AvatarLod, see Players' bodies in Architecture.md) and the Gateway sending each client only its 12 nearest VR bodies (PoseInterest). Measured locally (backend and bots on the dev PC): 100 VR bots on the plaza, not firing: 3.8 ms a frame, 682 draw calls (the plaza alone: 3.0 ms, 614), 34 kB/s received per player (56 before); firing both hands: 6.5 ms, ~1 200 draw calls, 159 kB/s (180): the shots were then most of it.

Then (protocol 35) the shots' events (sent once, flown by the clients, only the near ones or those coming at a player) and the others' shots drawn together: 100 VR bots firing both hands, 41 kB/s received per player (159), 4.7 ms a frame, 688 draw calls (1 202).

A crowd logging in at once (everyone back after a restart): each login checks a password in the DbWorker, a deliberately slow computation. The DbWorker checks at most one a core at once (AuthGate: the others wait their turn without holding the web server's threads; past 10 s, a 503); the ApiServer gives a login 15 s (its auth client) and answers a busy or silent account service with 503 and Retry-After: 1, never a bare 500; the game client tries again after a growing pause with some randomness (0.5, 1, 2, 4 s: the crowd spreads out), and creates an account only when the login says the name or password is wrong (401), not when the server is busy. A timeout is tried again only for what is harmless twice (a login, the Gateway's address), never a forge. Test: BotClient --count 200 --radius 15 without --ramp, against the dev server.

Network tests (smoothness, protocol 36: see Smoothness in Architecture.md). InterpolationTests sends a player walking a circle (stopping now and then) at 10 Hz through a simulated network and shows it at 90 frames a second: on a good network nothing is extrapolated and the error stays under 1 cm (95 %); at 100 ± 30 ms with 5 % lost, 1.5 % of the frames are extrapolated, the error under 2 cm (95 %), no step bigger than a walk's; at 20 % lost, 13 % extrapolated, still no jump. Live: --net-sim LATENCY,JITTER,LOSS on the client (with --perf: interp_delay_ms, lag_ms, jitter_ms, extrapolating_pct) or the bots (their report's interpolation: line), e.g. BotClient --count 100 --radius 15 --vr --shoot --net-sim 100,30,5. While the bots play, add a game server and move cells from the Monitor (Servers, World), or remove a game server: the bots must stay in game (the tool prints in game counts every 5 s and exits with 1 if a bot never reached the game).

Ghosts: a dead bot stands still, waits 8 s for an ally, then accepts its respawn (5 s of beam); a living bot walks to a ghost within 25 m and holds the raise key. --pairs makes odd bots follow the bot before them, so deaths get raised; the report counts deaths, raised, respawned and current ghosts:

dotnet run --project Tools/BotClient -- --count 24 --radius 1300 --pairs --seconds 200

Raid board end to end (Start-Dev.ps1 running, it also starts a Redis container): a level-12 scout flies (dev locomotion) to the nearest camp of the dev seed, scouts it, posts a bounty in the safe zone, two bots join, then the countdown, the group teleport and the raid's 3 respawns are checked. A second run with other bots (--first) must be refused ("Another scout found this camp first") while the lock lasts:

dotnet run --project Tools/BotClient -- --raid-test --first 911

Developer commands end to end: without a role a command is refused; with the Bot role the level is set and the gold refused; the DEV role is given through the DbWorker (as the Monitor's Grant DEV), the bot logs in again, sets its level to 30 and its gold to 4321 (checked in the character sheet), then goes to the entry of the nearest level-12 camp:

dotnet run --project Tools/BotClient -- --dev-test

A lost connection end to end (Connection lifecycle in Architecture.md): the bot walks 4 m, its socket is cut without a word (a cable pulled), it connects again with the same token after the Gateway's timeout and must be back where it stood (its entity kept by its GameServer, not a new arrival in the safe zone); then cut and back at once (its old connection taken over, never "Already connected"). Exits with 1 when a step fails:

dotnet run --project Tools/BotClient -- --reconnect-test

Blocks: --block-test (with --voice 2 or more) makes the first bot block the second 25 s in (and report it, "Bot block test: please ignore."); from 2 s later neither may hear the other, and the first must get its list back (block test: ... OK, else the tool exits with 1); it unblocks it at the end, so the next run starts clean.

dotnet run --project Tools/BotClient -- --count 3 --radius 4 --voice 3 --block-test --seconds 50

Anti-spam: --spam-test makes the first bot ask the second to be friends 4 times (the 4th must be refused, the second must see "3 times" and get the instant notice), then the second blocks the first, whose party invitation must be refused; all undone at the end (spam test: OK). The counts last an hour in Redis: to run it again sooner, delete nexusoffates:asks*.

A bot to hear alone in a headset: --still (it stands where it enters, by the fountain, and never fights) with --voice 1 --talk (a little tune without a pause; --tune 1 another one, to tell two bots apart) and --accept (it accepts every friend request and party invitation, every 3 s), e.g. --api https://sushivr.ovh --count 1 --prefix Melodie --voice 1 --talk --still --accept; it accepts the terms of the server it plays on (an older one has its own version).

Bots with their raccoons: --pet (each summons it on entering and leaves its orbs to it; the end counts the orbs carried by pets; with --still, a raccoon on its shoulder by the fountain to look at).

Party: --party-test (with --voice 1) makes the first bot invite the second 20 s in; the second accepts, must hear the first's voice through the party and never through the proximity too, then joins it (a teleport) and both leave (party test: OK, else the tool exits with 1).

dotnet run --project Tools/BotClient -- --count 3 --radius 4 --voice 1 --party-test --seconds 60

Friends: --friend-test makes the first bot ask the second to be friends 20 s in; the second accepts; both must see the other in the game, then the friendship ends (friend test: OK, else the tool exits with 1).

Quests: --quest-test plays the whole newcomer chain (the main story of quests.json) with one bot, a new character each run (quest1234, 25 min at most, about 10; a bot that dies on the way respawns, as a player does; Tools/BotClient/QuestRun.cs): run (the chief, the race at a run, back to him), envoy (a kilometre from the plaza and back), wash (into the fountain; the chief then has nothing more: the smith comes next), dress (Borin's armour set from the bag, every piece worn, the rags thrown away with the bag's bin), training (Kael's blasters held, a session at the middle dummy, again until one reaches 80 %: each hand charged in full and fired at the dummy as soon as its ammo and magic allow), hunt (5 mobs near the village: the bots' fight, round the plaza), flight (Borin's wing worn, up the ramp to the low landing and a jump and glide into the ring on the grass, then up the tower's ramp and glides straight off the board until one goes through both hoops). At each hand-in the NPC's words, the quest's state, its XP and its gold (saved by the DbWorker) are checked; quest test: OK, else the tool exits with 1 at the first step that fails (see Quests in World.md). Validate.ps1's live run plays it (the merge queue's validation; -SkipQuest to leave it out).

Voices: --voice 3 makes the first 3 bots speak (a wobbling tone through the game's encoder, 3 s every 6 s); the report's voice: line gives the slices sent and received and how many bots heard someone. A game client near them (--radius 6, the spawn) plays them from their heads (its log: [voice] hearing ...).

dotnet run --project Tools/BotClient -- --count 4 --radius 6 --voice 3 --seconds 120

Rate limits: --flood 3 makes the first 3 bots send ~1500 shots per second. The Gateway must disconnect them ("Too many messages") while the others keep playing; the tool exits with 1 otherwise.

dotnet run --project Tools/BotClient -- --count 20 --flood 3 --seconds 30

Quest performance

The game on a Meta Quest (the Android Quest preset), measured on the headset itself: Tools/Dev/Quest-Perf.ps1 exports the preset with a perf run on its command line (command_line/extra_args, after a leading --: GodotAppLauncher drops the extras of am start; export_presets.cfg restored afterwards), installs it over adb (-Device, the Quest 3 at 10.0.1.139:5555 over Wi-Fi, on mains power), runs it, and writes BuildOutput/quest-perf/<tag>.json: the game's report (--perf-run) and the headset's own figures (VrApi, a line a second: fps, GPU %, GPU MHz, CPU %, temperature), streamed from logcat while it runs. The account: never in git, read at run time from -AccountFile (%USERPROFILE%\nof-android\quest-test-account.json, a staging test account); the Android SDK, JDK and keystore in %USERPROFILE%\nof-android (chopper). The APK must speak the server's protocol: to measure a branch against staging, merge it into a worktree of origin/staging and run the script from there.

./Tools/Dev/Quest-Perf.ps1 -Tag town                                              # 25 s to settle, 60 s measured, in town
./Tools/Dev/Quest-Perf.ps1 -Tag parts -Seconds 10 -Steps base,buildings,shadows,props,far,near,world
./Tools/Dev/Quest-Perf.ps1 -Tag q2 -Extra '--quality quest2'                      # another quality profile on this headset
./Tools/Dev/Quest-Perf.ps1 -Tag t -NoExport -Device 10.0.1.108:5555 -Extra '--quality-set farQuads=16,renderScale=0.8'   # a setting tried, no new export
./Tools/Dev/Quest-Places.ps1 -Device 10.0.1.108:5555 -Prefix q2                   # every place below, one table, the worst first

Several places (Tools/Dev/Quest-Places.ps1, the Quest 2 at 10.0.1.108:5555, the Quest 3 at 10.0.1.139:5555): one run a place, 25-30 s to settle and 45 s measured, the headset's battery and temperature read before each (it stops under 25 % or above 45 °C). The staging test account needs the DEV role (--fly / --goto / --walk); its character is saved where the last run left it, so every place is a --goto. The places (staging's world, seed 1234, found with WorldGen): town --fly 2 --goto 0,12 --walk 1 (by the fountain); meadow 150,40; forest -320,1080 (a dense forest, 1.1 km from the spawn, with over a hundred mobs round it); mountains 1960,0 flown 60 m over the summit (196 m up, --pitch -5; no --walk); lake -350,-925 (the lake of crystals, 21 m deep, swum in); glide 150,40 from 300 m up with --glide (a test hook of VrRig: the player falls, then glides level at a wing's speed whatever the arms and the wing worn, and the server takes it for a DEV move, so nothing corrects it: the terrain streams in at 30 m/s as in a real flight); --wing TYPE,RANK (e.g. --wing Arrow,S) puts that wing on the own body whatever the account wears, to measure the glide's wind (The glide's wind in World.md). Quest-Perf.ps1 sends a run's flags in a file the debug build reads at start (<user data>/perf-args.txt: the whole run, the export's own flags are not kept): a new place or setting is a run, not an export (~1.5 min). An "Allow USB debugging?" alert left on a headset blocks every launch (a Reprojected OS dialog is showing in logcat): the script closes it.

The GPU's clock moves on a Quest 2 (441 to 587 MHz, the OS follows the load): the same frame reads 76 % at 490 MHz and 62 % at 587. Quest-Perf.ps1 reports gpu_full_pct, the busy share at the top clock (each VrApi line's GPU % × its clock / 587; a Quest 3 holds 599 MHz, so it is its GPU %): compare that, not GPU %. --perf-run's report also has process_ms (Godot's scripts a frame) and probes_ms (PerfProbe: where the main thread's time goes: the network poll, the terrain, the entities, the rest of Main).

What costs what: --perf-steps a,b,c (PerfBreakdown) measures --perf-run seconds per step, each with one group hidden: near, props, far, water, buildings (plaza, houses, fountain), npcs, safezone, training, tower, platforms, sky (the clouds), entities, shadows, world (everything of the game), or a setting tried: msaa, scale, fov, skybg, fog, split1 / split2 / split4 (the sun's cascades), cullback; several at once with + (buildings+shadows). On the Quest 3 (Adreno 740, a tiled GPU) a group hidden alone often saves little while several together save a lot: the GPU's geometry work (every draw and triangle, for every tile) and its pixel work overlap, the slower one sets the frame. Read the cumulated steps too. Reports: Docs/perf/ (2026-11-30, the Quest 3 in town).

The quality profile (Libs/Client.Core/Config/quality.json, QualitySettings): data, picked at start from the device (OS.GetName(), OS.GetModelName(): a Quest 3 or 3S quest3, any other Android headset quest2, else pc). No profile hides mobs any more (the Quest 2's mobRadius of 40 m, 2026-12-01, let a ranged mob shoot from out of sight): every device draws them all, at the level of detail of Client.Core.MobLod (The mobs' level of detail in Architecture.md), printed in the log (Quality profile: ...); --quality NAME forces one. It holds the near terrain's radius, how far props go (fine meshes, coarse ones, the small blobs), the sun's shadows (distance, cascades, from the terrain or not, from the props of which blocks; a distance of 0: no shadows at all, no light and no object casts any, ShadowQuality: the Quests), the plaza's light paving (plaza_lite.glb), the buildings' back faces, MSAA, the headset's render scale (OpenXR's render target size multiplier) and foveation, the clouds' detail and farQuads (quads on a side of a far ring's tile: 32, or 16 for a quarter of the triangles), the glide's particles (wingParticles, wingFxRange: The glide's wind in World.md). --quality-set KEY=VALUE,KEY=VALUE changes some of them for a run (QualitySettings.Override). The PC keeps the look it had; a test checks it. The stream camera exists only where streamCamera is true (not on a Quest: no window to stream to). No specular on a Quest (specular: false, 2026-12-01): the Quests' Adreno GPU drew the specular term (the lights' and the sun's highlights) pure black in places: the caves' rock in panels round the view's middle, a thin line along the clouds' lower edge (bug report #23). There every lit material is drawn without it: SpecularQuality (client) turns it off on each BaseMaterial3D of what enters the scene (the code's materials and the models' own, imported from Blender) and on the materials the code puts on a node already there (SpecularQuality.Apply / Lit, Palette.Flat); a custom lit shader goes through Client.Core.ShaderModes.ForDevice (adds specular_disabled to its render_mode). A new material: made before its node enters the scene, nothing to do; put on a node already in it, through SpecularQuality.Apply; a new lit shader_type spatial shader, through ShaderModes.ForDevice (or specular_disabled everywhere when it never shines). The water keeps its sun glint (checked on both headsets). --quality-set specular=true brings the specular back on a Quest (to compare). The caves' rock has none on any device (it never shone). The audit of every material: Docs/perf/2026-12-01-quest-shading.md. Measured on the Quest 3 in town: no shadows at all (2026-11-30): see Docs/perf/2026-11-30-quest3-town.md. The Quest 2, tuned in six places (2026-12-01): Docs/perf/2026-12-01-quest2-town.md.

Setting pc quest3 quest2
near ring / props / small / low (chunks) 12 / 12 / 8 / 4 9 / 8 / 4 / 2 8 / 7 / 4 / 2
sun's shadows 80 m, 4 cascades none none
MSAA / eyes' render scale / foveation 2 / 1.0 / 0 2 / 0.95 / 0 2 / 0.8 / 0
plaza's light paving, back faces culled no / yes yes / yes yes / yes
clouds' detail 1 0.5 0.5
farQuads: quads a far tile's side 32 32 16
townRadius: the town's pieces drawn within (m) 0 (always) 0 500
dungeonLightRadius: a dungeon's caverns' lights on within (m) 105 (past the fog's reach: nothing seen changes) 30 30
dungeonGlow: a dungeon's glow (bloom) yes yes yes
cpuLevel / gpuLevel: the headset's clocks' floor (OpenXR; 0: the system's) 0 / 0 0 / 0 3 (sustained high) / 0

What the Quest 2 holds with its profile (staging, 2026-12-01): 72 fps with the GPU at 74 % at its full clock in the town and 55-63 % in the meadow, mountains and lake. The forest's 139 mobs (perf/mobs-glide, every mob drawn, their level of detail): 72.4 fps on the Quest 2, 72.5 on the Quest 3; a glide 70.0 and 71.2 (Docs/perf/2026-12-01-mobs-glide.md). The Quest 3's profile has no townRadius (left for the owner).

Quest budget (draw calls and triangles, no headset)

Draw calls, triangles, objects and video memory do not depend on the machine's speed: a desktop checks what a Quest will draw. --budget FILE (PerfBudgetRun, ~20 s) builds a fixed scene offline, the same every run (the world of seed 1234, its time fixed for the clouds and platforms, no server, no bots), with the quality profile of --quality (the step uses quest3): the town from the plaza south of the fountain looking N, E, S and W, a meadow (town-n, town-e, town-s, town-w, meadow), then the crowd (crowd): 20 other players at fixed places in front of the fountain, each with a pet and a wing, a third standing, a third walking in small circles, a third gliding round 6 m up, 12 near and 8 far (Client.Core.BudgetCrowd), put in an offline connection (GameConnection.PutOffline) and shown by the game's own WorldSync: the avatars' and pets' levels of detail, the wings and their trails as in play. Each view: once the terrain is built, 30 frames averaged; the report (JSON) to FILE, --budget-shots DIR a picture of each view. The ceilings per profile and view: Libs/Client.Core/Config/perf-budget.json (edit them freely; PerfBudget); a view over one by more than 5 % prints BUDGET OVER town-e: draw calls 470 over 440 (+6.8 %) and the game quits with 1. Validate.ps1 runs it as its step Quest budget (-SkipBudget to leave it out; the pictures and report in BuildOutput/budget/):

godot --path Apps/Client --xr-mode off --resolution 1000x1000 -- --budget out.json --quality quest3 --budget-shots BuildOutput/budget

The Quest 2's ceilings (quest2, 2026-12-01): town N 113 draw calls / 256 k triangles, E 440 / 315 k, S 110 / 213 k, W 89 / 190 k, meadow 108 / 218 k, crowd 330 / 406 k; video memory 190 MB (205 MB with the crowd); Validate.ps1 runs both profiles (--quality quest2 by hand: godot --path Apps/Client --xr-mode off --resolution 1000x1000 -- --budget out.json --quality quest2). The Quest 3's were set from the measurements of 2026-11-30 (quest3, 1000 × 1000, 90° field of view) and lowered the same day when the houses, the raid hall and the dungeons' gate left the town: town N 109 draw calls / 326 k triangles, E 421 / 398 k, S 114 / 304 k, W 85 / 254 k, meadow 433 / 460 k, crowd 315 / 471 k; video memory 195 MB (210 MB with the crowd).

Combat test sessions

To see how fights go and improve the balance model (BalanceMath, the calculator BotClient --calc), on the dev server, with the player online (in VR):

./Tools/Dev/Test-Session.ps1 -Player test -Level 40 -Blaster Standard:B -Armor Dps -Team 2 -Mob StoneGolem -Rarity Elite
./Tools/Dev/Test-Session.ps1 -Player test -Report -Since 17:30     # the fights since then (UTC), against the fight model (BalanceEncounter; -WithTeam: the bots' fights too)

A series of fights (Tools/Dev/Test-Series.ps1): arena fights for one player, one after the other with nobody at the keyboard (each announced in the game, the player healed and put in the arena, the next once the fight is recorded), one thing changing from a fight to the next when asked (-Vary PlayerSpeed | MobSpeed | MobWindUp -Values 100,150,50, the values taking turns), and at the end a table by value: fights won, time, health lost, each attack's hits over its casts at the player (its dodges). It is what measured the fight model's numbers (balance.json's hitRateAnchored and dodge; The fight model in Telemetry.md). Both scripts share Tools/Dev/Session-Common.ps1 (the game's lists as numbers, the Orchestrator's commands, ClickHouse; SessionScriptsTests checks the lists against the enums).

./Tools/Dev/Test-Series.ps1 -Local -Fights 'Normal:0,Normal:3,Elite:0,Elite:3' -Repeat 2                 # 8 fights, Rarity:Gap
./Tools/Dev/Test-Series.ps1 -Local -Fights 'Elite:3,Elite:6' -Repeat 2 -Vary MobWindUp -Values 100,150,50  # the announces' length
./Tools/Dev/Test-Series.ps1 -Local -Fights 'Normal:0' -MobHp 2000 -WavesOnly -MobSpeed 200 -Timeout 240    # a golem of slams only

-MobSpeed 150 makes the arena's mobs attack and move at 150 % of their speed (the DEV command SetArenaMobSpeed, kept until changed), to measure what a mob's speed does to a fight; -MobWindUp 50 makes them announce their attacks half their time (a zone's red ground, a cast's wind-up: SetArenaMobWindUp), to measure the dodge against the time to react. SetArenaMobTest (DEV command 13) gives them more health (percent: 2000 = ×20) and, over 100000, only their shockwaves (102000: ×20 and slams only): many slams in one fight, to measure the jumps. A DEV speed of the player (SetSpeed, SetRunSpeed) must be sent after the fight's start: the start puts the starter's DEV options back to the rules'.

  • The player: its level set, a pair of blasters (-Blaster kind:rank) and a whole armour (-Armor role[:specialty], or none) forged at that level and worn, then put on the arena's north half (healed). All through the Orchestrator's admin commands (POST /api/players/{id}/command, PlayerCommand, its ADMIN_KEY read on the node over SSH, never printed): its Gateway does them as if the player had asked (DEV commands without the DEV role; the forge and the equip through the DbWorker, tried again when a write meets another).
  • Its team (-Team N): BotClient bots (--team NAME, Tools/BotClient/TeamBot.cs, for -Minutes) logging in as team0, team1..., given the same level and outfit, put beside the player; each takes the mob nearest the player (in the arena during a fight: only its mobs), stands round it at the player's distance (15 to 30 m, spread), fires both hands fully charged where it is going, runs sideways out of a cone announced on it and jumps over a shockwave at the top of its jump. They send their VR body (as --vr): the others see their blasters in their hands, aimed at the mob while they charge. The player on the arena's paving, they fight only the arena's mobs (never the slimes round it); they walk facing where they go, charge a hand only with the mob in front of them and rest a moment after each shot; the arena fight over, they leave.
  • The fight: -Mob, -MobLevel (default: the player's), -Rarity, -Count in the arena (its mobs never lose their target; off the paving the fight is given up). -NoArena: only the outfit and the team, where the player is.
  • The report: each fight since -Since (the player and the bots: the result, the time, the health lost, the mean distance, what hurt by attack, the gear), then what the model expects for the same level, gap, rarity and species (--calc, the reference player). Today the model counts only the mob's melee: a mob fighting from afar (the stone golem) shows how far it is from the real fights, what to teach it next.

Database migrations

dotnet tool restore
dotnet ef migrations add <Name> --project Apps/DbWorker/DbWorker.csproj --output-dir Data/Migrations

The DbWorker applies migrations at startup.

Sounds (SoundForge)

The game's icon (the sun rising over the sea of clouds) is drawn in Tools/Icon/icon.svg; ./Tools/Icon/Build-Icon.ps1 -Godot <the Godot console executable> renders it (Godot, headless) to Apps/Client/icon.png (256 px: the window's and the project's, config/icon) and Apps/Client/icon.ico (16 to 256 px: config/windows_native_icon, the exported .exe's through application/icon with modify_resources in export_presets.cfg, and the installer's own icon, in Tools/Installer/NexusOfFates.iss; its shortcuts take the .exe's). Never edit the PNG or the .ico by hand.

The sound effects are synthesised, like the models are made by Blender scripts: Tools/SoundForge/Sounds.cs describes each one (layers of waves or noise, each with its frequency sweep, envelope, filters and vibrato; an echo; a loop made seamless), ./Tools/SoundForge/Build-Sounds.ps1 renders them to Apps/Client/Assets/Sounds/*.wav (44.1 kHz, 16-bit mono, always the same bytes). Never edit the WAV files: SoundTests checks each file is what its definition makes. A new sound: add it to Sounds.cs, run the script, let Godot import it once (godot --headless --path Apps/Client --import, or open the editor) and commit the .wav and .wav.import; play it with Sfx (Sfx.Ui, Sfx.Play, Sfx.At, Sfx.Loop, Sfx.LoopOn: a test checks every name used exists). Names ending in _loop repeat. Listen to the result in the game (the generator cannot hear): tune the numbers and render again.

Recorded sounds. A sound can also be cut from recordings (Clip: a piece of Tools/SoundForge/Sources/<name>.wav from a time for a length, played faster or slower (higher and shorter, or lower and longer), with bass and treble, a high-pass and a low-pass, fades in and out, backwards; several clips can be mixed, a loop is made seamless). The sources are CC0 recordings only, converted once with ffmpeg to 44.1 kHz 16-bit mono WAV (the command, and each source's page, author and licence, in Tools/SoundForge/Sources/README.md); the cutting is in Sounds.cs, so the build stays the same bytes and SoundTests still checks them. Versions: step, step_2, step_3... are versions of one sound: the game plays step and picks one of them, never the same twice in a row, and nudges every sound's pitch and volume a little (Client.Core/SoundVariety: how much for each, the shots ±4-7 %, the steps ±8 % and ±2.5 dB, a level or a death not at all).

3D models (Blender)

The safe zone's buildings are generated by code with Blender 5 (winget install BlenderFoundation.Blender): Tools/Blender/buildings.py builds a modular kit (4 m grid: floor, wall, wall with window, wall with door, corner pillar, column, gable roof, stairs, lantern; and the same walls and roof in wood, wood_*) and the buildings made of it (house_small, house_large, house_wood, raid_hall, fountain), plain colours, no texture. The houses are warm and hand-made, like the world around them: cream plaster on a plinth of grey-beige stones, a dark timber frame, stone corners, rows of terracotta tiles in three shades, painted shutters, flower boxes, warm glowing windows, an arched door in a ring of stones, iron lanterns either side of it (SafeZoneBuildings.DoorX: the small house's door is right of its middle). Each house seeds its random stones, tiles and flowers with its name, so a rebuild gives the same model. Chamfered edges (obox(..., bevel)) catch the light; the many small parts are joined into one mesh per material (merged). kit_wall(..., style="wood") and house(..., style="wood") give the same modules in logs: honey logs on light chinking over a low stone plinth, crossing past the corners (a side wall's logs sit half a log higher, so the two walls' logs alternate there), plank frames, a plank door under a log lintel, wooden shingles, plank gables; house_wood stands on the plaza (BuildingKind.HouseWood, the same solid box as the stone houses). The plaza's centre is paved (plaza, SafeZone.PavedRadius = 44 m): rings of flagstones around the fountain, a star of wedges next to it, bands of light stones, a kerb, one mesh with chamfered tops 3.5 cm over the plateau (walking ignores it; BuildingsView lays it, without shadows); the terrain is lawn beyond it (TerrainColors). The raid hall, the fountain and the forge keep the older white stone and blue roofs for now.

./Tools/Blender/Build-Buildings.ps1            # Apps/Client/Assets/Buildings/*.glb and Kit/*.glb
./Tools/Blender/Build-Buildings.ps1 -Preview   # + a render of each in BuildOutput/screens/buildings

The fountain (fountain) is a round basin of carved stone with a mosaic under its water, four verdigris fish spouting jets into it from a pedestal, a fluted column carrying a scalloped bowl and a smaller one above it, both brimming over in sheets of water, and a bronze crown cupping a glowing orb. Its water has three materials, water (still), water_fall (the sheets) and water_jet (the jets), that the client replaces with an animated shader, plus droplets where the water lands and motes from the orb (FountainWater, its heights the same as FOUNTAIN_* in buildings.py). The blaster forge (blaster_forge) is one of them, and the test arena (arena: its origin is the paving's surface, the game raises the ground under it; ArenaTests checks its size). The forged blasters and their shots come from Tools/Blender/blasters.py: a kit of parts, every variant in Apps/Client/Assets/Weapons/blasters.glb (grip, a body per kind, barrels with their Tip_N / Base_N empties, muzzles, coils of 1 to 5 rings, fins, 12 cells, level bands, crest, halo; materials named Body, Trim, Dark, Glow, Cell, recoloured by the client from the rank and kind), and projectiles.glb (ball, bolt, dart, orb, laser, shard at radius 1). BlasterLook picks the parts and places them (BlasterLook.Place: the client and the tests use the same rule); BlasterTests checks every look's parts are in the kit, and BlasterFlickerTests assembles every look the forge makes from the .glb and fails when two faces lie less than 1.2 mm apart, parallel, facing the same way and overlapping (they would flicker, z-fighting: keep parts' faces 1.5 mm apart or crossing), and when a cell does not stick out of its body.

No flicker anywhere (z-fighting: two faces of two colours in one plane, the depth buffer cannot tell which is in front): ModelFlickerTests checks every model shown whole (the buildings and their kit, the shots, the ghost) and VariantFlickerTests the models made of variants, between pieces that can show together (the character with each haircut, beard... and each piece of armour, a body zone the armour hides left out; the goblins' clothes; the biomes' mobs); the shared check is Tests/Shared.Tests/Flicker.cs. The rule is strict, seen or hidden (a hidden pair shows when a piece moves, or to a VR player whose head goes into a wall): no two faces of two colours lie flush, every corner of each within half a millimetre of the other's plane, facing the same way, overlapping (Godot's reversed depth buffer tells half a millimetre apart even from afar). Faces crossing at an angle are fine (a hair-thin line), one colour's faces in one plane too. How the scripts keep it: buildings.py checks every box, log, cylinder and flat shape as it is made against the faces already made (_clear_of_others: one of another material flush with it, it grows a millimetre, again until clear); meshkit.make_skinned takes an inflate (the goblins' clothes, layer by layer over the body: LAYERS in goblin.py); elsewhere, the pieces are placed apart (a roof's rows of tiles each end at a different inset, the ridge in one piece, the arena pillar's core shorter than its glow and its stone ring's top well above the paving's).

./Tools/Blender/Build-Blasters.ps1             # Apps/Client/Assets/Weapons/blasters.glb and projectiles.glb
./Tools/Blender/Build-Blasters.ps1 -Preview    # + renders in BuildOutput/screens/blasters

The players' character comes from Tools/Blender/character.py: a manga-style hero of 1.8 m in his starting outfit (bare chest and feet, black shorts, messy blond hair, green eyes). One smooth, rounded skin built from lofted tubes (torso, limbs, palm, fingers) and an anime head, its colours as vertex colours (one material, one draw call), its arms a human's for its height (drawn short, then stretched from the shoulder by ARM_STRETCH, the hands keeping their size: shoulder to wrist 0.57 m, so a VR player's reach is the character's), skinned to a 45-bone skeleton: hips, torso, head, arms, forearms, hands with three bones per finger and thumb (for the VR controllers and hand tracking later, not animated yet), thighs, shins, feet. The game turns the bones itself (CharacterAnimator, see Docs/Architecture.md). The joints are repeated in Libs/Client.Core/CharacterRig.cs; CharacterTests checks them against the .glb. The look's variant parts are meshes of their own on the same skeleton (vagabond.py, one node per choice): the haircuts Hair0..11 (HAIRCUTS: messy, short, shaved, long, ponytail, topknot, mohawk, spiky, braids, afro, undercut, bob), the brows Brows0..2, the beards Beard1..8 (beards: stubble, short, long, moustache, goatee, both, mutton chops, long braided), the ears Ears0..2 (ears: human, elf short, elf long; the head itself has none, head(b, with_ears=False), while npcs.py keeps them on its heads), the tears Tears0..4 and the scars Scar1..3; no accessories since 2026-11-29 (see The model's variants in Characters). -Preview renders each of them and a few looks put together.

./Tools/Blender/Build-Character.ps1            # Apps/Client/Assets/Characters/human.glb
./Tools/Blender/Build-Character.ps1 -Preview   # + renders (body, face, hand, each look variant, each role's armour in its palette colours) in BuildOutput/screens/character

The armour's kit is in the same file, on the same skeleton: one mesh per slot and role (Armor_<Slot>_<Role>: helmet, chest, gloves, boots, trousers × general, tank, DPS, support), shown by the game when such a piece is worn (Shared.Gameplay.ArmorLook, the client's CharacterView.Wear; see Armour in World). Most of a piece is the body's own sections made a little fatter (shell): it is skinned as the skin under it, so it bends with it and always covers it. ..._Top is what stands near the eyes (a tank's pauldrons: never drawn on the VR player's own body), ..._Crest the ornament of ranks A and S. Its vertex colours are a palette the game fills in with the piece's colours: red the main colour, green the trim, blue the accent, dark red the main one in shade.

Each face of the body has a zone (torso, upper arm, forearm, hand, thigh, shin, foot, hair...: Shared.Gameplay.BodyZone), written in its UV: the character's shader folds the zones under a worn piece to a point, so the skin never pokes through, in the same draw call. Under a helmet the whole haircut is hidden (it would poke through) and locks made for it come out from under its rim instead (the fringe, the nape: two more zones), so the hair's colour and cut still show. ArmorLookTests checks that the file has every piece and that nothing drawn before its wearer's eyes goes higher than the base of the neck.

./Tools/Dev/Validate.ps1 -Screens after        # its "armor" screenshot: every role's set on a row of bodies

To look at the animation in the game: -- --new-account --character-preview --pitch 6 --screenshot out.png --wait 7 puts five characters 6 m in front of you (--character-preview 2.6 for a close-up) (standing, walking in a circle, running, jumping, and nearer a ghost under its respawn beam beside its body), played locally only.

The camps' goblins come from Tools/Blender/goblin.py (sharing the mesh tools of Tools/Blender/meshkit.py with character.py): one skeleton and every choice of every part in one goblin.glb, each a skinned mesh named after its part and choice (Head3, Weapon7...; see Shared.Gameplay.GoblinLook). A hunched goblin of 1.33 m (the game scales it to its height), pot belly, long arms, a big head, big feet; its legs are the players' legs at 2/3 (CharacterRig.GoblinLegScale) so the same animation walks it. The body and the clothes have "Fat" and "Thin" blend shapes; the skin meshes are white (the game tints them: material skin, the rest gear). GoblinTests checks every part and the legs against the .glb.

./Tools/Blender/Build-Goblin.ps1               # Apps/Client/Assets/Characters/goblin.glb
./Tools/Blender/Build-Goblin.ps1 -Preview      # + renders of six goblins (front, face) in BuildOutput/screens/goblin

--look-preview [ROW] puts six characters of different looks in front of you, facing you (LookPreview: the builds, skins, beards, haircuts; ROW 10 to 17: one skin, only the build changes; 20 and more: three of them close; 50 and more: their vagabond's clothes taken off in turn, LookPreview.Clothes; 60 and 61: look v2's showcase; 62 to 65: one character, one part compared side by side, framed by the preview's own camera, 63 at dusk, LookPreview.Compare): to check how the parts meet, as the neck's seam (the build's push ends 1 cm under it, CharacterView.SeamMargin: the seam's ring leans with the neck).

A dead player's ghost comes from Tools/Blender/ghost.py: a classic sheet with two eyes and a small mouth, 1.51 m tall and 0.62 m wide at the hem (drawn bigger, then scaled to the player: WIDTH, HEIGHT; 2026-11-28, it looked twice the player), one static mesh with vertex colours (ghost.glb); the game makes it see-through, floats it 0.15 m up (its head about the player's) and sways it (GhostView).

./Tools/Blender/Build-Ghost.ps1                # Apps/Client/Assets/Characters/ghost.glb

The safe zone's NPCs come from Tools/Blender/npcs.py, which imports character.py (not run: its main only runs as Blender's script) for the players' body, head and hair: each NPC is that body reshaped (a function of the position and the bone weights, applied to the vertices and the joints alike: the smith stocky and thick-armed, his head kept its size) and dressed (lofts, shells, sheets of meshkit.py and vagabond.py), on the players' skeleton (+ a Staff bone on the hips for the chief's staff, so it stays planted while the arm moves), with its idle animation baked in its file (Idle, a 6 s loop at 30 fps: breathing, a slow look around, its pose; keyed in the NPC's own terms, forward / out / in / turn, by turn_of). One npc_<name>.glb per NPC with the meshes Body (skinned), Glow (skinned, shown lit: the goggles, the gauntlet's lines, the crystal) and Props (not skinned: the anvil). NpcsView plays Idle (each NPC from its own moment of the loop); NpcTests checks the files (the animation, the heights, the anvil against its solid in SafeZoneNpcs).

./Tools/Blender/Build-Npcs.ps1                 # Apps/Client/Assets/Characters/npc_blacksmith.glb, npc_chief.glb, npc_weapons_master.glb
./Tools/Blender/Build-Training.ps1             # Apps/Client/Assets/Props/training_dummy.glb (the training ground's dummy)
./Tools/Blender/Build-Npcs.ps1 -Preview        # + renders (front, side, back, face) in BuildOutput/screens/npcs
./Tools/Blender/Build-Npcs.ps1 -Only chief     # one of them

The loot items (one per mob species: what a loot orb holds and the collection shows) come from Tools/Blender/loot.py: a static mesh each with vertex colours, named Item_<MobSpecies>, about 12 cm, in a row in loot.glb (never on each other: the flicker test reads it whole); the game takes one at its origin (LootItems) inside its orb and on its icon.

./Tools/Blender/Build-Loot.ps1                 # Apps/Client/Assets/Items/loot.glb

The biomes' mobs come from Tools/Blender/creatures.py (shapes from meshkit.py): one puppet per species (Apps/Client/Assets/Mobs/<species>.glb, stone_golem.glb for StoneGolem): empties for the joints of its body plan (Body, Head, LegFL, LegFL2, the soles LegFLFoot..., see MobModelTests), rigid low-poly pieces under them, and every choice of every part of its look (Shared.Gameplay.Species: Head0..Head9, Ears0..., or Claws3_L for one of several pieces; a choice can be nothing), an empty Top at its height, faces of the materials skin (white to grey: the game tints them with the mob's colour) and gear. CreatureView keeps the mob's choices and turns the joints.

./Tools/Blender/Build-Creatures.ps1                          # every species: Apps/Client/Assets/Mobs/*.glb
./Tools/Blender/Build-Creatures.ps1 -Species wolf,yeti       # only these

In the game: -- --new-account --mob-preview --pitch -8 --screenshot out.png --wait 10 puts every species in rows in front of you (each pacing, then taking one of its attacks' poses); --mob-preview Wolf ten wolves, ten looks. Played locally only.

To look at them in the game: -- --new-account --goblin-preview --pitch -5 --screenshot out.png --wait 9 puts goblins 7 m in front of you (--goblin-preview 4 closer): ten different ones in a row, the chief behind, two walking in circles (one running), one throwing its weapon every 3 s, one about to charge, one channelling; played locally only.

Change the script and run it again, never edit a .glb by hand. The .glb files are stored with Git LFS (.gitattributes). Sizes used by the collisions are repeated in Libs/Shared.Gameplay/SafeZoneBuildings.cs: SafeZoneBuildingsTests reads the .glb files and checks that the house boxes and the fountain's circle still match. The client reads the models at run time (GltfDocument), without the editor's import; when the editor imports them, commit the .glb.import files it writes, each saying importer="keep" (a new one written as "scene" leaves the model out of the exported game: MobModelTests checks them).

Exporting the client

The Windows preset is committed (Apps/Client/export_presets.cfg, Windows Desktop, x86_64, no console window). Godot needs a solution next to the project for the C# part: Apps/Client/Client.sln (the client and the libraries it references). The models are read with GltfDocument at run time, not loaded as imported scenes, so each *.glb.import says importer="keep": the file is exported as it is (the preset's filter *.glb adds them). A new .glb needs the same .import file, or it is missing from the exported game (the player then shows as a capsule, the buildings are gone).

The Android Quest preset (with the OpenXR vendors plugin) builds the headset's APK; measuring it on a Quest: Quest performance above.

Publishing the client (auto-update)

./Tools/Dev/Publish-Client.ps1 -Api https://sushivr.ovh -Notes "Rounded character"
  1. Installs Godot's export templates the first time (downloaded from GitHub, ~1 GB, into %APPDATA%/Godot/export_templates).
  2. Exports the client into BuildOutput/client-export/<build> (about 20 s) and writes build.json there: channel Dev, build <protocol>-<commit> (plus the time when the tree has uncommitted changes; -Build 0.3.0 for a version, as the Release workflow does), and the server it plays on (-Api). The server is not typed in the client: a published build plays on its build.json's, one without (the editor, dotnet build Apps/Client/Client.csproj then godot --path Apps/Client) on http://localhost:8080; only the test hook --api <url> changes it (SessionController, never saved).
  3. Writes into BuildOutput/client-releases (or -Out), the ApiServer's ClientReleases:Path:
    • NexusOfFates-<build>.zip: the update (the game folder, about 75 MB); the last 3 are kept;
    • latest.json: what GET /api/client/latest answers (build, protocol, file, SHA-256, size, notes), open to clients of any version;
    • NexusOfFates-setup.exe: the installer (first install), built by Inno Setup 6 from Tools/Installer/NexusOfFates.iss (ISCC.exe, installed once for the user: winget install JRSoftware.InnoSetup --scope user; or set ISCC).

First install on a PC: run NexusOfFates-setup.exe (from the server's home page). It is not code-signed yet: SmartScreen warns once (More info, Run anyway). It asks for admin rights once and:

  • installs in C:\Program Files\Nexus of Fates, the folder writable by the users (the game updates itself there without admin rights);
  • puts the game in game\ and the launcher NexusOfFates.cmd next to it, with Start menu and desktop shortcuts to the launcher (minimized: its console only flashes; the game's icon);
  • adds the Windows firewall rule Nexus of Fates for game\NexusOfFates.exe (inbound, any profile). The client's UDP socket listens on any address, and Windows asks "allow on public / private networks" for each new exe path: the game always runs from that path, so Windows never asks;
  • the uninstaller removes the game, what its updates added, and the rule. A reinstall replaces game\ as a whole.

With a headset and Virtual Desktop the game starts in VR.

Then, on the login screen (desktop and VR), the client asks its server for the latest build (ClientUpdates, ClientInstall in Client.Core):

The server has The client shows
the same build nothing
another build, same protocol "A new version is available (build). notes" and Update; it can still play
another protocol "Your version does not match the server... Update to play." and Update (the server refuses it anyway, 426)

Update downloads the zip (progress in the status line), checks its size and SHA-256, unzips it into staging\<build> (refusing any path outside it), names it in pending.txt, rewrites the launcher, starts the launcher with the same arguments and quits. The launcher (Tools/Installer/NexusOfFates.cmd, the same text as ClientInstall.LauncherScript: a test checks it, another runs it) moves game\ to old\ (retrying for about 30 s while the old game quits), the update to game\, removes old\, staging\ and pending.txt, then starts game\NexusOfFates.exe. If the move fails the old version starts, and the update is applied at the next start. A damaged download installs nothing.

C:\Program Files\Nexus of Fates\
  NexusOfFates.cmd     the shortcuts' target
  game\                NexusOfFates.exe (the firewall rule's path), its .pck and data folder, build.json
  staging\<build>\     a downloaded update, until the launcher applies it
  pending.txt          its build

The former layout (the setup zip, before 2026-11-20: versions\<build>\, current.txt) moves to this one by its next update (the launcher keeps its name, so the shortcut still works; no firewall rule then, so Windows asks once more).

Every update is mandatory (the owner's decision, 2026-11-30; Client.Core/ClientUpdates.cs, GameUpdateWatch.cs, SessionController): there is no optional update. A newer client published (another build, or another protocol) means the login screen and the character screen show only Update and Quit game (Credits too on the login screen), never the login form nor the character list: a client that starts already logged in (the device's session) goes to that update screen before the character screen, and one that finds the update while the characters show goes back to it. A store's build (Steam, Meta) shows the same blocking screen with the store's text instead of the button; a client run from the sources is never blocked by a build (developers), only by a protocol change. In game, nobody is cut off for a newer build: the client asks GET /api/client/latest every 5 minutes (at once after a (re)connection; never on the frame's thread), announces once per build that the game must be updated, and the game menu's session bar shows an Update button beside Bug and Leave (only for a build that installs itself). Update leaves the game as Log out does (saved), then goes to the update screen and installs at once; it waits while a mob is anchored to the player (a fight), with a message. Leaving the game any other way (log out, a disconnect, a protocol change after a deploy) asks again and also leads to the update screen, never to the character list. Test hooks: --update-preview (login screen as when a newer version is there), --game-update-preview (with --new-account, --menu Character, --wait 12, --screenshot): the toast and the button without a server offering one.

Only builds of the dev channel install their updates. A client run from the repository (godot --path, no build.json) is told to pull and rebuild when the protocol differs; later, Steam and Meta Store builds (channels Steam, Meta, set in build.json by their own export) will only say that the store has an update: stores update their games themselves, and an app from the Meta store may not install code. Before sharing builds outside the local network, sign them (the client would check a signature with a public key it carries), or a hijacked server could make clients install anything.

Locally, Start-Dev.ps1 points the ApiServer at BuildOutput/client-releases; in Docker the apiserver service mounts CLIENT_RELEASES (default ./BuildOutput/client-releases) at /app/client-releases. Test hook: --auto-update presses Update by itself (to test the whole chain: install with the installer, publish again, start the installed game with -- --auto-update).

Shared dev server

A backend on the LAN that every test PC connects to, so several players see each other live, with the clients kept up to date by the auto-update above. Development itself stays on the x64 PC (Blender, Godot GPU screenshots and the Windows export need it); the server is a Turing Pi 2 RK1 node with 16 GB (tp2node3, 10.0.0.19, Ubuntu 24.04 arm64, Docker); the 32 GB nodes stay free for CI, per-branch environments or load tests.

It is deployed from Gitea by hand, with nothing to run on this PC: Actions > Release makes a version (X.Y.Z, or X.Y.Z-rc.N for a candidate) of a commit of main that passed the CI (arm64 images, game client and installer into Gitea's packages, on this PC's runner), and Actions > Deploy deploys a version (by default the latest) or a commit of main on the node (its runner tp2Node3, label deploy). Its address is https://sushivr.ovh. Everything is in Deploy.

The same from this PC (an agent asked to release and deploy): Tools/Dev/Release-Deploy.ps1 waits for main's CI on the commit, runs the Release, then the Deploy, through Gitea's API (git's own Gitea login, never printed), and prints each job's result and the log lines worth reading (the version, each deploy step, the health checks); it stops at the first workflow that failed.

./Tools/Dev/Release-Deploy.ps1 -Version 0.16.0                 # origin/main: CI, Release 0.16.0, Deploy
./Tools/Dev/Release-Deploy.ps1 -Sha <full sha> -NoDeploy       # a version of that commit only (the next patch)

Still to do: an instance number for Start-Dev.ps1 / Stop-Dev.ps1 / Validate.ps1 (ports +100 per instance, one database and Redis index each), so several worktrees on the dev PC can run their backends at once; today Stop-Dev.ps1 stops every dev process by name.