Architecture
Services
| Service | Tech | Port | State |
|---|---|---|---|
| ApiServer | ASP.NET Core .NET 10 | 8080 HTTP | none (accounts through the DbWorker) |
| DbWorker | .NET 10 minimal API + EF Core | 8085 HTTP (internal) | PostgreSQL |
| Orchestrator | ASP.NET Core .NET 10 | 8090 HTTP | Redis (instances, cells, epochs; leader lease), players in memory |
| Redis | redis 7 | 6379 (internal) | AOF on a volume |
| Monitor | Blazor Server .NET 10 | 8091 HTTP | none (polls the Orchestrator; reads the DbWorker and the Telemetry service) |
| Telemetry | .NET 10 minimal API | 8095 HTTP (internal) | ClickHouse: game events, arena fights, server metrics (see Telemetry.md) |
| ClickHouse | clickhouse-server 25.8 | 8123 (internal) | on a volume; memory capped at 2 GB |
| Gateway ×N | .NET 10 console | UDP, public port from 7100 | sessions only |
| GameServer ×N | Godot 4.7 .NET headless | UDP 7001 (internal) | live simulation of its cells |
Login and connection
sequenceDiagram
participant C as Client
participant A as ApiServer
participant D as DbWorker
participant O as Orchestrator
participant G as Gateway
participant S as GameServer
alt this device remembers the account
C->>A: POST /api/auth/session (device token)
A->>D: POST /db/device-sessions/find, then renew (30 days)
else the first screen: Log in
C->>A: POST /api/auth/login
A->>D: POST /db/accounts/verify, POST /db/device-sessions (its hash)
end
A-->>C: JWT of the account (12 h) and the device token
C->>A: GET /api/characters (the character screen)
C->>A: POST /api/characters/{id}/play
A-->>C: JWT of the character (cid)
C->>A: GET /api/gateway
A->>O: GET /api/gateway/best (least players)
A-->>C: host, port
C->>G: UDP connect + Auth(token)
G->>D: GET the account's character (cid)
G->>O: POST /api/cells/claim (if the cell has no known owner)
G->>S: PlayerEnter(state)
G-->>C: AuthResult(seed, position, stats)
S-->>G: Snapshot(cell) 10 Hz
G-->>C: Snapshot (forwarded bytes)
The test hooks and the bots skip the login: with the admin key they get a test account (POST /api/admin/test-accounts) or the pool's bot account (POST /api/admin/bot-accounts/{index}) with its session ready, then go on from the character screen's calls (see Test and bot accounts in Security.md). The Gateway reads the account's kind with the character (CharacterDto.AccountKind) and marks a test or bot player (PlayerStateMsg.Service, EntityMeta.Service, AuthResultMsg.Service): a player's Players tab does not list it.
Connection lifecycle
"Losing the connection is not losing the game" (2026-11-30). A game session ends in one of three ways:
| How | Who sees it | What happens |
|---|---|---|
| Log-out (the game menu, Update, quitting) | the client closes its socket: the Gateway sees RemoteConnectionClose |
PlayerLeave: the GameServer removes and saves the player at once; the client goes to the character screen |
| Refusal (an old client, a kick, too many messages, a login refused, the character taken by a newer connection) | the Gateway closes with a reason (or refused the Auth) |
as a log-out on the servers; the client shows the reason (the update screen for an old client), no retry |
| Lost (internet gone, a crashed client, a Gateway restarting or stopping) | a timeout (AwayStore.IsLost), or the Gateway's link to the GameServer gone |
PlayerAway: the GameServer keeps the player for the grace, the client reconnects alone |
The grace (server). PlayerAway (or the Gateway's link lost, or the Gateway stopping) marks the player away for Rules.ReconnectGraceSeconds (60 s, WorldSimulation.PlayerAway): its entity stays in the world, its body still (no input comes; no AI), vulnerable (mobs keep their aggro, it can be hit and die: a normal death, a ghost; pulling the cable never escapes a death). Its GameServer writes where it stands in Redis (away:{characterId}, expiring with the grace, IAwayStore). When the grace is over (WorldSimulation.TakeExpired, every tick) it leaves and is saved as at a log-out. An away player outside the server's cells (a drain) is not handed off (no Gateway would take it): its grace ends at once, it is saved.
Coming back. The client's next Auth, through any Gateway (the session is the character's token, not the socket), reads the away spot with the character (ClientAuthenticator): the player is placed there, not in the safe zone, so the cell's owner gets the PlayerEnter; the GameServer finds the entity away (WorldSimulation.Resume) and takes it back as it is (place, health, fight, quests, mobs), bound to the new Gateway, and tells its new client everything again (stats, a correction to where it stands, quests, raid). A PlayerEnter for a player still bound to another Gateway (the client came back through a new one before the old one timed out) takes it over the same way; the old Gateway's late PlayerLeave / PlayerAway is then ignored (only the Gateway that has a player may send it away). On the same Gateway, a new connection of a character still connected there (its old one not timed out yet) is never refused any more ("Already connected"): the Gateway closes the old one with AuthErrors.Replaced (its client does not retry) and the new one takes the entity over.
The client. Client.Core.Reconnection (engine-free, tested in ReconnectTests) decides: Classify tells a loss (timeout, the Gateway gone, a transient refusal: "Already connected", "Authentication failed") from a refusal (anything the Gateway said as it closed, a login refused for good, another protocol's key) and from the client's own close; a refused token (AuthErrors.InvalidToken, 12 h old) is renewed by this device's session (/api/auth/session, 30 days) and /api/characters/{id}/play, never by asking the password. A session that was in the game and is lost starts a reconnection (SessionController): the world goes, the black loading space shows "Connection lost, reconnecting…" with Cancel (SplashScene.ShowCancel), the client asks /api/gateway again and connects with the same character, backing off 1, 2, 4, 8, 8… s, for up to Reconnection.GiveUpSeconds (2 minutes). Back in: the world is built again round the same character (no character screen). Given up (2 minutes, a refusal, an HTTP 401 / 403 / 426) or Cancel: the character screen with the reason, as before (the update screen when the server wants a newer client).
A dungeon that does not open. A player sent into a dungeon (through the city's gate: a correction into the dungeon's space, then a handoff) waits for the dungeon's instance (Placement). If no GameServer takes it within Placement.DungeonOpenSeconds (30 s: the instance failed to start, or is not reachable), the Gateway logs why and puts it back where it stood by the gate (a correction), with the notice @dungeon.not_opened ("The dungeon could not open, try again in a moment").
World time
What moves on its own (the clouds, the moving platforms (retired for now); later anything that turns, opens or comes and goes) is a pure function of the world's seed and the world time (Shared.Gameplay.WorldClock: seconds since 2026-01-01 UTC, a double): every machine computes the same thing and nothing is sent.
- Servers (Orchestrator, Gateways, GameServers) read it from their system clock, which NTP keeps on time (
Deploy.md). Each heartbeat measures how far the instance's clock is from the Orchestrator's (HeartbeatResponse.WorldTime, the round trip halved) and the next one reports it (InstanceMetrics.ClockDriftMs): the Monitor's Servers page shows it (Clock, orange over 50 ms). The heartbeat also carries the loop's last second (Server.Core.LoadMeter: the tick's p95 and longest, the process's CPU, the kB/s it sent), read byTools/Dev/Perf-Test.ps1. - Clients never read their own clock: they ask their Gateway (
TimeSync, answered at once by the Gateway, unreliable).Client.Core.WorldTimeSynckeeps a steady clock (Stopwatch) plus an offset: a burst of 8 questions at login, then one every 10 s.- The offset is the median of the 3 fastest of the last 8 exchanges (an uneven trip makes a slow one less sure).
- Once set it never jumps: it slides by at most 5 ms a second (what turns never jerks, the time never goes back).
- An answer further from it than its round trip allows (the PC slept, the Gateway changed) starts again with a burst.
- Precision: a few milliseconds (the trip's unevenness is invisible to any such method), i.e. a few centimetres for something moving at walking speed.
GameConnection.WorldTimeis the frame's value (the PC's clock for the first second, before the first answers); Main setsClientContext.WorldTimefrom it after each poll and passes it on: to the rig (IPlayerRig.WorldTime), the remote players' views, the own balls, the platforms' view and the sky.
Moving platforms (Shared.Gameplay.Platforms, MovingPlatform): a slab going from A to B and back (easing in and out, waiting at the ends) and/or turning, from the world time. None is in the world now: the town's three (Platforms.Town) were a test, retired on 2026-12-01 and kept for later (a dungeon, a trial). Platforms.Retired is the single switch: Platforms.All is empty, so nothing is drawn (PlatformsView), StandOn / Resolve / Ceiling / Hits find nothing, and the server forgets a client's InputMsg.Platform (ById is null). Everything below stays and is tested on platforms a test gives (Platforms.Use(set), for its own flow only).
- Solid: shared (rule 11). One stands on them (
StandOn), their sides push (Resolve), their underside stops a jump (Ceiling), balls stop on them (Shots.Blocked). - Client → server: a player standing on one is described in its frame. The client sends
InputMsg.Platformand where on it (LX, LY, LZ, LYaw; the world X, Y, Z too, for the Gateway's routing). - GameServer: keeps that, puts the player where the platform is at each tick (
PlayerSystem.Ride: its cell, the mobs, the shots) and checks only the player's own move on the platform (Rules.SpendMove). - Snapshots: the rider is sent in the platform's frame too (
EntityState.Platform, 4 bits of the kind's byte: the 19 bytes stay). - Other clients draw the rider on the platform as it is now (
EntityView: smoothed in the platform's frame). The usual delay of the others (network and smoothing, ~0.1-0.2 s) can no longer sink them into a rising platform or float them over a falling one. Their body is animated in the platform's frame too (AnimatedBody.OnPlatform,Locomotion.GroundIn): the feet stand on its top and go with it, and a raised platform is not taken for the air (no falling pose). - Local player: carried (
Client.Core.PlatformRider, throughLocomotion.CarryandLocomotion.Settled): before the frame's move, from where the platform was at the last frame to where it is now; its turn turns the view too. Leaving it, the player keeps its speed (the horizontal part drifts the jump, the vertical part adds to it). - A simulation without a world clock (
WorldSimulation.WorldTimeNaN: the tests, the replay) has no platforms.
Messages (UDP, LiteNetLib)
A packet is [ushort MsgId][payload]; payloads are INetSerializable structs (Libs/Shared.Protocol). MessageRouter dispatches by id.
| Leg | Messages |
|---|---|
| Client → Gateway | Auth (token + protocol version), Input (position 15 Hz, sequenced, dev flag, the body's animation), Fire (a hand's trigger, FireKind: pressed, released with muzzle, direction and charge, cancelled, or an overheat), Teleport, MetaRequest, Respawn (a ghost's button), Raise (target id, repeated while the key is held), ScoutCamp, DevCommand (DEV tab: level, gold, go to a camp or a biome, speed, run speed, jump, gliding speed, swim; DevAction), Equip (a forged blaster of the bag, or the belt one, in a hand; or a piece of armour worn or taken off, slots 2 to 6), Arena (start or stop a fight in the test arena), TimeSync (the world time: answered by the Gateway itself), BodyPose (VR: the tracked body, 15 Hz, sequenced) |
| Gateway → Client | AuthResult, LobbyStatus (raid lobby, from the ApiServer through the Orchestrator's heartbeat answer), Announcement (the server's announcement to every player, from the Monitor through the Orchestrator's heartbeat answer; the Gateway keeps it until its countdown ends, or 10 minutes without one, and sends it to whoever logs in meanwhile), DevResult (answer to a developer command, also unwrapped from PlayerDevResult), EquipResult (answer to Equip), TimeSyncResult |
| GameServer → Gateway → Client | Snapshot (forwarded as is; no shots since protocol 35), Shots (a cell's shot events: fired once, a homing one's turns, stopped; each client gets only those near it or coming at it, not its own: ShotInterest; reliable, unordered), CellPoses (the VR bodies of a cell: each client gets only those of its nearest players, at most 12 within 20 m, chosen again every 0.5 s by the Gateway: PoseInterest), CellMeta, CellGone (cached by the Gateway), Stats, Correction, RaidLives, ScoutResult, CampSite (a camp's plateau, once near), Notice (a notification line: the arena's answers) (the last six unwrapped from PlayerStats / PlayerCorrection / PlayerRaidUpdate / PlayerScoutResult / PlayerCampSite / PlayerNotice) |
| Gateway → GameServer | GwHello, PlayerEnter, PlayerInput, PlayerFire, PlayerTeleport, PlayerRespawn, PlayerRaise, PlayerScout, RaidTeleport (group teleport of a raid), PlayerDev (a developer command), PlayerEquip (the blaster in a hand, once the DbWorker agreed), PlayerWear (the armour in a slot, once the DbWorker agreed), PlayerArena (an arena command), PlayerBodyPose (a VR player's tracked body), PlayerLeave, PlayerAway (a lost connection: the grace, see Connection lifecycle), Subscriptions |
| GameServer → Gateway | Handoff, PlayerStats, PlayerCorrection, PlayerRaidUpdate, PlayerScoutResult, PlayerDevResult, PlayerCampSite, PlayerNotice, Snapshot, CellMeta, CellGone |
Protocol version (ProtocolVersion.Current, now 69): raise it whenever a message or an ApiServer call of the client changes (every server comes from this repository and has the same version: only a game client can be older or newer). The client sends it to the ApiServer with every call (header X-Client-Version): another version gets 426 and "This game client is out of date (version 6, server 7): please update it." (or "newer than the server"), shown on the login screen; a request without the header goes on, and the Gateway refuses the same versions in Auth. GET /api/client/latest stays open to every version: it is how a client of another version finds the right build and updates itself (see Publishing the client in Development.md). The version is also the end of the Gateway → GameServer connection key (NetKeys.GatewayKey), so servers of different versions cannot connect.
Protocol history (newest first):
| Version | Change |
|---|---|
| 72 | Stamina (Shared.Gameplay.Stamina): StatsMsg.Stamina, MaxStamina, StaminaRegen, PlayerStateMsg.StaminaSpent (carried across a handoff, never saved) |
| 69 | The quests' times and reward: QuestProgressWire.StartedAt and CompletedAt (also in CharacterQuests), PlayerGiveRewardMsg (101: a reward's gold and items in one, replacing the item alone) |
| 68 | Quests v2, the engine (Quests): QuestLog (35) and QuestProgress (36) to the client (PlayerQuestLog 99, PlayerQuestProgress 100), QuestAbandon (31, PlayerQuestAbandon 98), the item of a reward (101, PlayerGiveReward since 69); NpcLineMsg carries keys (Line, Started, Done: strings); PlayerStateMsg.QuestLog replaces the two bits a quest of the player's state, and StatsMsg no longer carries the quests; CharacterDto.QuestLog (table CharacterQuests) |
| 66 | The DEV tab's gold typed with a unit (2.5 and M): DevCommandMsg.Amount (a double) for DevAction.SetGold |
| 65 | The gold a double (it grows ×1.08 a level, 2026-11-28): LootOrbWire.Gold, PlayerGiveGoldMsg.Gold, and every gold of the ApiServer's and the DbWorker's calls (CharacterSheet, ContractDto, LookResult, RepairResult, SellResult, LootDbRequest/Result, SetGold/SpendGold) |
| 64 | Talking to the safe zone's NPCs and the quests: NpcTalk (client), PlayerNpcTalk, PlayerNpcLine → NpcLine (what the NPC says, a quest's reward), the quests in the stats and in the player's state (two bits a quest, saved in the characters' table, column Quests; replaced in 68); PlayerTravelRefund is now PlayerGiveGold (a quest's gold too). 61 and 62 are taken by branches not merged yet (the opening story, the pets) (built beside the pets, the clothes and the dungeons: renumbered after them, NpcTalk 29, PlayerNpcTalk 97, PlayerNpcLine 96, PlayerGiveGold 93) |
| 63 | The pets as items, three more kinds (dog, cat, falcon), each its own look: InventoryItem.Pet (PetItem: kind, seed), worn by Equip in slot 7, EquipDbResult.Pet, CharacterDto.Pet; PlayerPet gains Seed and Recall, PlayerStateMsg PetSeed and PetAway; PetCommand now calls the pet back; a pet's meta carries its seed (Look) |
| 62 | The pets (Pets in World.md): EntityKind.Pet, PetCommand (28) and PlayerPet (94), LootEvent.Carried, StatsMsg.Pet, PlayerStateMsg.Pet and PetCarry0/1 |
| 61 | The vagabond's clothes: ArmorWire.Clothes (its shirt or trousers worn where no armour is: the others see its underwear otherwise), InventoryItem.Clothes (ClothesItem), EquipDbResult.Clothes, CharacterDto.Clothes |
| 61 | The dungeons: TeleportTarget.Dungeon with TeleportMsg.Range (through the city's gate into a range's dungeon), DungeonStatus (DungeonStatusMsg: its players, mobs alive, the hall's fight, cleared; PlayerDungeon from its instance through the Gateway) |
| 60 | The game settings reported for the telemetry: POST /api/settings-report (SettingsReportDto) |
| 59 | The bag arranged by the player: POST /api/bag-layout (BagLayout: pouches, the items' order), CharacterSheet.Bag |
| 58 | Away: CharacterAnim.Sit (sitting cross-legged, "zZz" before the name; no loot share on the server) |
| 57 | The paid teleport to one's level zone: TeleportTarget.LevelZone (Teleport), PlayerTravelRefund (GameServer → Gateway: its gold back when refused; PlayerGiveGold since 63) |
| 56 | A mob in a fight waiting between its attacks sends MobAction.Stand (not Idle): its nameplate keeps its level, rarity and traits, its aura shows; the login screen asks the server GET /api/health (its Server online / unreachable line) |
| 55 | Speak and listen (near, party): VoiceStateMsg.Cuts and EntityMeta.Cuts (VoiceCuts), PlayerVoice says whether the players near hear the slice, POST /api/party/voice, PartyMemberDto.Cuts |
| 54 | The terms of use: GET /api/terms, POST /api/terms/accept, LoginResponse.TermsAccepted; POST /api/characters/{id}/play answers 403 until the account accepted the current terms |
| 53 | Instant notices and anti-spam: SocialPing (Gateway → client: the friends or the party changed, read them again); FriendDto.Asks, PartyInviteDto.FromId and Asks; a friend request or a party invitation can be refused with 429 (too many) |
| 52 | The party: the ApiServer's /api/party routes (PartyDto...), JoinMember (client → Gateway), PartyVoiceFrame (Gateway → client), PartyVoice (GameServer → every Gateway), PlayerJoin (Gateway → GameServer); PlayerVoice carries the speaker's party, CellVoiceMsg.PartyId; FriendDto.CharacterId |
| 51 | Friends: the ApiServer's GET/POST /api/friends, POST /api/friends/{id}/accept, POST /api/friends/{id}/remove (FriendsDto, FriendRequest, FriendRequestResult) |
| 50 | The Players tab: BlockPlayer (client → Gateway: a character id, block or unblock), ReportPlayer (a reason, a text up to 500 characters), VoiceBlocks (Gateway → client: the players blocked, at login and after each change), PlayerVoiceBlock / CellVoiceBlock (a block sent to the Gateways of the blocker's cell); CellVoiceMsg.SpeakerAccount (the blocks are between accounts) |
| 49 | Proximity voice: Voice (client → Gateway: VoiceMsg seq, level, channel, Opus bytes), VoiceState (microphone off, deafened), PlayerVoice / PlayerVoiceState (Gateway → GameServer), CellVoice (GameServer → Gateways, with where the speaker stands), VoiceFrame (Gateway → client); EntityMeta.MicOff, Deafened (an icon over the player) |
| 48 | A handoff keeps the player's poison, slow and respawn beam (PlayerStateMsg.PoisonSeconds, PoisonStrength, PoisonLevel, SlowSeconds, SlowFactor, RespawnHeld: in seconds from now, each server has its own clock; before, they were lost) |
| 47 | The forge's recipes (Shared.Gameplay.Crafting): ForgeRequest.GoldOnly, ArmorForgeRequest.GoldOnly, a repair's RepairRequest (/api/items/{id}/repair takes a body), POST /api/collection/sell (SellRequest), DevAction.GiveItems |
| 46 | The loot (Shared.Gameplay.Loot): client → Gateway LootTake (17), Gateway → client Loot (53), Gateway → GameServer PlayerLootTake (79), GameServer → Gateway PlayerLoot (88), PlayerStateMsg.Loot and LootSeq (the orbs waiting, carried across a handoff); GET /api/collection |
| 45 | The barber (Shared.Gameplay.Barber): POST /api/barber (BarberRequest: the look wanted, fixed prices), client → Gateway LookRefresh (16, empty: the Gateway reads the look from the DbWorker), Gateway → GameServer PlayerLook (78) |
| 44 | Wear (Shared.Gameplay.Upkeep): BlasterWire.Wear and ArmorWire.Wear (thousandths: in the state, the stats and the metas, the others' by steps of 50) |
| 43 | Dirt (Shared.Gameplay.Upkeep): PlayerStateMsg.Dirt, SinceWash, DirtSeed (saved, carried across a handoff), StatsMsg.Dirt (thousandths; its MaxMagic counts it), EntityMeta.Dirt (twentieths: a new meta at a step) and DirtSeed |
| 40 | The server's announcements: Announcement (AnnouncementMsg: its text and the world time its countdown ends at, NaN: none), Gateway → client, from the Monitor through the Orchestrator's heartbeat answer (HeartbeatResponse.Announcements) |
| 39 | Worn armour on the others' bodies: EntityMeta.Armor0 to Armor4 (a player's worn pieces by slot, ArmorWire; level 0: nothing) |
| 38 | The others see a blaster charge: in BodyPose.Hands, each hand charging (BodyPose.LeftCharging, RightCharging: bits 6 and 7); a shockwave zone, HazardKind.Wave (a golem's slam: HazardState.Size how far it goes, HalfAngle its speed in m/s) |
| 37 | The blasters in the others' hands: EntityMeta.Blaster0 / Blaster1 (a player's two blasters; a new one raises its meta's version) and, in BodyPose.Hands, which slot each hand holds (BodyPose.HeldIn / Hold: bits 2-3 the left hand, 4-5 the right one) |
| 36 | Smoothness: the snapshots carry their world time and come in parts under 900 bytes (SnapshotMsg.MaxPartBytes; zones and cameras first, then the entities; unreliable, a part too big for one packet reliable: NetSend.Timed); the VR bodies (CellPosesMsg) carry their time too and go at 20 Hz (the nearest 6 of a client's 12 every time, the others every other time) |
| 35 | The shots leave the snapshots: Shots (ShotsMsg, a cell's ShotEvents of the round: Fired once when a shot starts flying in a cell, with its look, gravity and lifetime, Update for a homing shot every 0.3 s, Gone where it stopped, with its burst; compact: positions to the centimetre in the cell, velocities in cm/s), the clients fly the shots themselves; the Gateway sends each client only the shots near it or coming at it, not its own (ShotInterest) |
| 34 | The VR bodies apart from the snapshots: CellPoses (CellPosesMsg: a cell's bodies, each with its position; the Gateway sends each client only the bodies of its nearest players, PoseInterest), the snapshots' optional last section is now the cameras alone; EntityMeta.Dev (a DEV player, shown from farther) |
| 33 | The stream camera: StreamCamera / PlayerStreamCamera (StreamCam: place, turn, field of view; 79: and its red light, NamesFilmed), and the snapshots' optional section of cameras after the poses (the poses' count then always written, 0 if none) |
| 32 | The VR players' tracked bodies: BodyPose / PlayerBodyPose (BodyPose: head, wrists and hands, fingers, crouch, the body's turn), and the snapshots' optional last section of poses |
| 31 | Pairs of blasters: an Equip of a hand (slot 0 or 1) holds the pair in both hands (EquipDbResult.ClearedSlot no longer used); the inventory's Hold the pair |
| 30 | Trousers (a fifth armour slot): PlayerStateMsg.Armor4, EquipMsg slot 6, ArmorSlot.Legs in the forge's and the inventory's items; the ranks' scale and the mobs aiming ahead change the game, not a message |
| 29 | The armour's roles, weight and bonuses: ArmorWire.Role, Specialty in place of Kind; StatsMsg.LoadPercent, GearSpeedBonus, ChargeCut, AmmoBonus, MagicBonus; POST /api/forge/armor's Role and Specialty |
| 28 | The world clock and the moving platforms: TimeSync / TimeSyncResult, InputMsg.Platform and its LX, LY, LZ, LYaw, EntityState.Platform in the kind's byte |
| 27 | Forged armour: PlayerStateMsg.Armor0..Armor3, PlayerWearMsg, EquipMsg slots 2 to 5, POST /api/forge/armor |
| 26 | The rename to Nexus of Fates (the Gateway's key) |
| 25 | The glides sent to the monitoring (POST /api/flights) |
| 24 | A charge carried across a handoff: PlayerStateMsg.ChargeHeld0, ChargeHeld1 |
| 23 | The server's own charge and scatter: FireMsg.Kind (FireKind) in place of Seed and Backfire, StatsMsg.ShotCount, PlayerStateMsg.ShotCount |
| 22 | The arena screen's last fights (GET /api/arena/fights) |
| 21 | The aura's rhythm and falloff: EntityMeta.AuraTenths, AuraFalloff |
| 20 | The exponential progression: health and XP as doubles in StatsMsg, PlayerStateMsg, EntityState; a mob's draw in EntityMeta.Rarity, Affixes, AuraDm; its special attack's timer EntityState.SpecialIn; StatsMsg.Anchored, StatsMsg.MobsIgnore, DevAction.SetMobAggro; the arena's Arena / PlayerArena (ArenaCommandMsg), StatsMsg.Arena (its Start / Stop button), the countdown zone HazardKind.Countdown and Notice / PlayerNotice (NoticeMsg) |
| 19 | The shots' behaviour: FireMsg.Seed, Backfire, ProjectileState.AreaDm, ProjectileShape.Laser |
| 18 | The blaster forge: StatsMsg.Magic, MaxMagic, Blaster0, Blaster1, PlayerStateMsg.Magic, Blaster0, Blaster1, ProjectileState.Shape, Rgb, Radius, Equip, EquipResult, PlayerEquip, POST /api/forge, POST /api/items/{id}/destroy |
| 17 | Running: RunSpeed in StatsMsg and PlayerStateMsg, DevAction.SetRunSpeed |
| 16 | Gliding and swimming: CharacterAnim.Glide, Swim; the character's speed StatsMsg.Speed, PlayerStateMsg.Speed (kept across a handoff); DevAction.SetSpeed, GotoBiome; GlideSpeed and Swim in StatsMsg and PlayerStateMsg, DevAction.SetGlideSpeed, SetSwim; the jump height Jump and DevAction.SetJump |
| 15 | The strange biomes: no message changed, but the ground did (the glowing lakes' ponds) and the props one stands on |
| 14 | The biomes' mobs: MobSpecies values, StatsMsg.SlowPercent, Poisoned, HazardState.Effect |
| 13 | A ghost's body: EntityKind.Corpse (see Corpses) |
| 12 | The biomes: no message changed, but the world's ground did (a client of another world would see other heights than the servers) |
| 11 | The respawn beam: StatsMsg.GhostX, GhostZ, Respawning, PlayerStateMsg.GhostX, GhostZ, PlayerAction.Respawning |
| 10 | The DEV role: AuthResultMsg.Dev, PlayerStateMsg.Dev |
| 9 | Players' bodies: InputMsg.Anim, EntityState.Anim |
| 8 | Goblin camps: EntityMeta.Species, CampSite, PlayerCampSite, hazard kind Line (a charge: HazardState.HalfAngle is then its half width) |
| 7 | Developer commands: DevCommand, DevResult, PlayerDev, PlayerDevResult; the client's version on every ApiServer call (X-Client-Version) |
| 6 | The raid board: ScoutCamp, ScoutResult, LobbyStatus, RaidTeleport |
| 5 | Camps: EntityMeta.Scale (a boss is 2.5× bigger), RaidLives |
| 4 | The ghost state: Respawn, Raise |
| 3 | Compact snapshots: name and level moved to the entity meta |
| 2 | The entity meta per cell, cached by the Gateway (CellMeta, CellGone, MetaRequest); the first numbered version (in Auth and the Gateway key) |
| 1 | The first protocol, before the version existed |
There is no text chat (ids 4, 42 and 65 are retired, never reuse them): players talk by voice (see Voice). Game messages ("Teleported to the safe zone.", welcome...) are client-side notifications: a banner, one small line at the top of the view, centred, for a few seconds (BannerController, UiBanner, Client.Core.BannerQueue; 2026-12-01, the Character tab's Messages screen is gone), red for an error (not enough gold, the bag full, no answer), and the bottom left lines on a desktop; the DEV tab's answers go to the log only, an orb taken to the desktop's lines and the log. The server's announcements (the Monitor's Send to all: "an update in 10 minutes, please log out") are a gold banner with their countdown, before the lines waiting. Some are messages to read (Client.Core.GameMessages, the session's only, gone at log out): a raid started, cancelled or won, a party's invitation, a friend request, a dungeon cleared. Each shows as a panel in the world (MessagePanelController: a UiScreen placed in front of the eyes when it comes and staying there, its title, text, countdown and "1 / 3" when more wait; OK reads it, Accept / Refuse answers it; it never stops the game).
Connection keys (NetKeys) separate the two kinds of peers: a client cannot connect to a GameServer port.
Snapshots carry the entities, the flying balls (position + velocity) and the zones of a cell. An entity takes 19 bytes (EntityState.Write, EntityState.WireSize): id, kind (its high 4 bits: the moving platform a player stands on, then the position is in the platform's frame), X and Z relative to the cell on 16 bits (~1 mm), Y in centimetres, direction on 8 bits, health as a fraction on 8 bits (0 only when dead), action, meta version, the animation of a player's body (CharacterAnim on 16 bits: idle, walk, run, jump, fall; its client sends it with its position in InputMsg.Anim), and the seconds before a mob's special attack (SpecialIn, 16 bits). Its name and level are in its EntityMeta (below). In a busy area (25 cells, 137 entities) a round of snapshots went from 6.3 KB to 2.5 KB with this (10 per second). Snapshots under 1000 bytes go Sequenced (latest wins); bigger ones ReliableOrdered (LiteNetLib only fragments reliable packets). Stats also carries the ammo of both weapon slots, the blaster held in each (Blaster0, Blaster1) and the magic (Magic, MaxMagic).
Who is in each cell (entity meta)
What changes all the time (position, direction, action, health) is in the snapshots, 10 times a second. What does not change, or rarely (name, level, kind, later colour, species, guild...), is an EntityMeta (id, kind, version, name, level), sent once; its version goes up when it changes (a player levelling up), and every snapshot carries the version so a client with an older one notices:
- GameServer: after each snapshot round, for each owned cell,
WorldSimulation.DiffCellcompares who is in the cell with what it sent before: aCellMetalists the entities that appeared (spawned, respawned, walked in, logged in) or whose meta changed (version up), aCellGonethe ones that left (walked out, died after their death burst, logged out). Both reliable, only when something changed, before the snapshot. A cell new on this server, and every cell every 5 s, send their whole list (Full), which replaces what the receivers knew: events of two servers can reach a Gateway out of order (an entity going back and forth over a border between their cells), the periodic full list repairs that within seconds for a few hundred bytes. A Gateway that subscribes to a cell gets its whole list at once. - Gateway:
EntityMetaCache(Libs/Server.Core) keeps the lists of the cells it subscribes to and forwards the events to the clients following the cell. When a client starts following a cell (it moved, it logged in), the Gateway sends it that cell's whole list from the cache, without asking the GameServer. Per client it only remembers which cells it sent (KnownCells). - Client:
GameConnectionkeeps the metas by id and fills each entity's name and level from them; the view of an entity is created once its meta is known (usually at once: the slime size depends on its level). An entity seen in a snapshot without its meta, or with a newer meta version, for 0.5 s is asked for withMetaRequest(at most 32 ids, twice a second), answered by the Gateway from its cache.BotClientprints how many entities are "without meta": it stays at 0 (a few for a moment with two servers, repaired by the full lists).
Gateway
Apps/Gateway: one loop thread (GatewayServer: sockets, routers, rate limits, metrics) and small parts sharing a GatewayState (sessions, GameServer links, cell directory, the queue of async results):
| Part | Role |
|---|---|
ClientAuthenticator |
protocol version, JWT, character from the DbWorker, then placement |
Placement |
sends a player to the GameServer owning its cell, claims the cell from the Orchestrator when needed (login, handoff, lost GameServer); a dungeon that does not take its player in 30 s: back by the gate with a notice (see Connection lifecycle) |
PlayerRelay |
a player's messages: Input / Fire / Teleport / Respawn / Raise / ScoutCamp to its GameServer, Equip (checked with the DbWorker, then PlayerEquip), DevCommand (gold set by the Gateway itself, the rest as PlayerDev), PlayerStats / PlayerCorrection / Handoff back |
CellRelay |
who follows which cell, subscriptions to the GameServers, fan-out of Snapshot / CellMeta / CellGone, the EntityMetaCache and MetaRequest answers |
GameServerLinks |
one connection per GameServer of the directory |
VoiceRelay |
the voices (see Voice): a client's slice to its GameServer, a cell's slices to the clients near (not deafened, no block between them), the microphone state, blocks (with the DbWorker, then to the other Gateways through the GameServer) and reports |
PartyRelay |
the party (see Party): each session's party read from Redis every 2 s, the party voices to the members at any distance, Join checked then sent to the GameServer |
Presence |
the players online in Redis every 5 s (where, their level): the raid board, the friends, the party |
OrchestratorSync |
registration and heartbeat (background task), directory, kicks, announcements and admin commands (PlayerRelay.Command: a test session) applied on the loop |
A new client message: a handler in the part it belongs to, one line in the router of GatewayServer, its limit in ClientRateLimiter.
Gateway protections
Before decoding a client packet, the Gateway checks it with the client's ClientRateLimiter (Libs/Server.Core):
- size: at most 512 bytes (the biggest real packet, a shot, is ~40);
- id: only client messages (
Auth,Input,Fire,Teleport,MetaRequest,Respawn,Raise,ScoutCamp,DevCommand,Equip,Arena,TimeSync,BodyPose,StreamCamera,LookRefresh,LootTake,PetCommand,NpcTalk,QuestAbandon,Voice,VoiceState,BlockPlayer,ReportPlayer,JoinMember); anything else is dropped; - rates (token buckets, per second / burst):
Input30 / 30 (the client sends 15 per second),Fire~18.5 / 72 (a shot is two messages, pressed and released; sized from the forge's best blasters in both hands:Blasters.MostAmmo, 16, emptied at once, then fired as fast asBlasters.FastestRefillSeconds, ~0.32 s, refills them, half again for bunching),Teleport1 / 3,MetaRequest4 / 8,Respawn1 / 2,Raise4 / 6 (the client sends 4 per second while the key is held),ScoutCamp1 / 2,DevCommand2 / 4,Equip2 / 4,Arena2 / 4,TimeSync2 / 12 (a burst of 8 at login, then one every 10 s),BodyPose30 / 30 (15 per second),StreamCamera20 / 20 (10 per second while it is out),LookRefresh0.5 / 2,LootTake4 / 10,PetCommand1 / 4,NpcTalkandQuestAbandontogether 1 / 3,Voice50 / 50 (25 slices a second while speaking),VoiceState2 / 6,BlockPlayerandReportPlayertogether 0.2 / 4,JoinMemberasTeleport,Auth0.1 / 3, everything together 110 / 140. Any other id is dropped: a new client message needs its limit here (ClientRateLimiterTestschecks every one).
A packet over a limit is dropped. More than 100 dropped packets within 10 s disconnects the client with the reason "Too many messages" (logged with its entity id); the Gateway logs the number of dropped packets once a minute. Normal play never reaches a limit (test Normal_play_is_never_limited). BotClient --flood N checks it live.
GameServer simulation
Libs/Server.Core/Simulation is engine-free (the Godot GameServer and Tools/HeadlessGameServer host it). WorldSimulation keeps the public API (SetOwnedCells, AddPlayer, ApplyInput, Fire, TeleportToSafeZone, Tick, BuildSnapshot...) and only wires the systems; they share the entities through SimState (cells and their mobs, players, balls, zones, the clock, one seeded Random, one id counter for balls and zones).
| System | Does |
|---|---|
CellSystem |
Owned cells from the Orchestrator, deterministic mob spawns, handoff of players outside the owned cells (after a 3 s grace). A player arriving (PlayerSystem.Add: login or handoff) keeps its height when it is above the ground (a glider goes on gliding; the height check follows from its next input), and its first move may cover 0.75 s more than since it came (ArrivalMoveSeconds: its client went on during the handoff), so a fast glide crossing cells is not put back |
PlayerSystem |
Arrival / departure, position input (speed check, a ghost at 5 m/s and still under its beam, dev flight), shots (ammo, magic, charge, muzzle checks; none for a ghost), the blaster held in each hand (Equip), health, ammo and magic regeneration, a ghost's respawn beam (TickRespawns), raise channels (TickRaises) |
MobAiSystem |
Respawn, target choice (aggro, sight, give up; a mob looks only at the players of its cell and the 8 around: PlayerGrid, rebuilt each tick), chase, melee, return home and heal, wander; the species' habits (MobTraits: packs, a hyena's flight, a zombie getting up, ambush, a worm under the ground, flyers, a wraith through trees, sporelings gone for good); every mob sprints after a target out of its reach and hits 2.5 m all round (pursuit, meleeReach); the particularities (TickAffixes: aura, regen, rage, call help, flee, leap, anchor) and the special attack's timer (Special: explosion, heal, summon) |
MobAttackSystem |
Special attacks by kind (AttackKind): choice by distance and cooldown (a skeleton's from its weapon), projectiles, cone / circle / nova zones, charges and tongues (a line), a worm bursting out, a fairy's blink, a unicorn's healing, a myconid's sporelings (added after the mobs' loop); the special attack's explosion (SpecialBlast, dodgeable or not) and summons (SpecialSummon, ids from SimState.NextSummonId); a zone is announced shorter and wider against a lower target (zoneGap in Config/mobtraits.json) |
ProjectileSystem |
Balls: movement, ground / obstacle / cell edge, hits on mobs or players. The flight and the hit volumes are Shots.Fly / Shots.HitsMob / Shots.HitsPlayer (Shared.Gameplay), the same code the client runs for its own shots (Ball.Step): one rule, no copy to keep in step |
HazardSystem |
Zones: a cone or a line hits once after its wind-up (a tongue also pulls), a circle once or every tick while active; a hit leaves its attack's poison or slow |
CombatSystem |
Damage, poison and slow on players (TickStatus), player death (a ghost on the spot, mobs drop it), mob death (XP, level up, its zones cancelled; a zombie gets up once, a crystal golem sends back a quarter, a crystal slime bursts) |
SafeZoneSystem |
Reach rules (a ghost, flying or in the safe zone: slimes leave you alone; a ghost or in the air: zones miss), teleport to the safe zone (not for a ghost) |
CampSystem |
Camps of the owned cells (spawn with their centre cell, no wandering slime inside), minion respawn delays, combined attacks (2 Hz, allocation-free), defeat and return after 30 min |
RaidSystem |
Raids on this server's camps: shared respawns at the camp entry, wipe and no-respawn-left failures, victory on the boss's death, leaving by teleport |
ArenaSystem |
The test arena (Arena): a fight with the mobs a player chose near it (species, level, how many, rarity, particularities: MobTraitRolls.Chosen), one at a time on the arena's server; its mobs stay on the paving (Arena.Clamp), never come back, give nothing; its mobs never lose their target (theirs dead: the nearest player alive on the paving); won, died (no one alive left on the paving), left (its starter alive 1 m off the paving: giving up) or stopped; a 5 s countdown first, ending with the starter on the paving (else cancelled) (SimState.ArenaCountdownEnd, sent as a Countdown zone); recorded through the outbox (ArenaFight, the host sends it to the Telemetry service; Dev when the starter used DEV tools, Specials its mobs' special attacks) and told to the player (Notice) |
QuestSystem |
The quests (Quests): talking to the safe zone's NPCs (near, alive: Quests.Talk gives, turns in, waits, or says its idle line), the reward (XP here, gold and items through the Gateway), giving up; the event objectives counted as they happen (kills from CombatSystem, a champion hit then fled, glides measured from the positions by PlayerSystem), the « ready » flags once a second; each change to the client (QuestProgress) and into the player's state (saved, handed off) |
DevSystem |
Developer commands (DEV or Bot role checked by the Gateway, DevRights: a bot gets no gold nor items): set the level (XP 0, full health), go to the entry of the nearest camp of a level (ServerWorldGen.NearestCampOfLevel) or to the nearest dry spot of a biome, set the speed, run speed, jump height, top gliding speed and swim ratio |
SnapshotBuilder |
The state of one cell for the clients |
Tick order (it matters, the replay hash checks it): mobs, camps, balls, zones, raise channels, raids, then each player (regeneration, handoff check). Mob ids: wandering slimes above −2^30, camp mobs below (CampSystem.MobId). A new rule goes in the system it belongs to, with a test in Tests/Shared.Tests/SimulationSystemTests.cs or SimulationTests.cs.
Client (Godot)
Apps/Client/Scripts/Main.cs builds the scene (its spaces, the rig, layers), creates a ClientContext (root, settings, rig, VR or desktop, layers, current GameConnection) and runs the controllers every frame in a fixed order. Each controller is a plain C# class:
| Controller | Does |
|---|---|
Main (away) |
Client.Core.AwayState: the headset taken off (the OpenXR session loses its focus) or, on a desktop, 3 min without input: the client sends CharacterAnim.Sit (the others see it sitting cross-legged, "zZz name · away"), stops sending its tracked body, cuts its microphone; the server gives it no share of a group's loot; after 20 min away it logs out |
SessionController |
At start the account remembered on this device (its device session, see Device sessions in Security.md) goes to the character screen; none: the login screen (2D or VR; Log in or Create an account, then its form, AccountForm; its server line: whether the server answers, asked at once and again every 5 s while it does not, every 30 s while it does: ServerStatus); the character screen's Switch account (revokes the device session) and Quit; Gateway connection; the game's log out back to the character screen; raises Entered, Left, StatsChanged |
LoadingController |
The splash and loading screen (its own space, ClientSpaces.Splash; see Spaces): the start and the entering of the world, Show / Hide with a status text and a fade |
WorldSync |
Players, slimes and zones from the snapshots (create, update, remove; the players' detail rings, AvatarLod); the others' and the mobs' shots from their events, flown by GameConnection.AdvanceShots and drawn together (RemoteShotsView: one multimesh per shape for the cores and one for the halos, a light on the 8 nearest only; a goblin's thrown weapon its own model) |
CombatController |
Own shots: Fire to the server and the local ball until it hits |
GameMenuController |
In-game menu (M / B / hand pinch): open, close, buttons, switches, map, selected inventory item, the session's messages (GameMessages: notifications and messages to read), desktop keys; builds the MenuModel of the 3D menu (VR and desktop); the lasers / mouse on while the menu, a station's screen or a message panel is there (SyncLasers) |
MessagePanelController |
A message to read (an announcement, a raid's news) as a panel in the world: OK / Later, its countdown, walked away = Later |
NpcController |
The safe zone's NPCs: the sign of their quests over their heads, a free hand pointed at one and the trigger (desktop: the right button) to talk, what it says as a panel beside it (on its left, in pages of about five lines that follow the voice (Client.Core/NpcPaging) or Next ▸, then OK) and aloud; the same click opens Borin's forge, the barber's screen and a training dummy's (see Quests in World.md) |
RaidBoardController |
Raid board and inventory in the menu: the character sheet and the contracts from the ApiServer, posting intel, joining contracts, scout results and lobby messages as notifications (a raid started, cancelled or won: a message to read) (rules and texts in Client.Core RaidBoardView) |
HudController |
HUD of the session: stats, hurt flash and vibration, blaster charge, info line (Main also slows the rig and tells a mob's poison or slow: StatusNotices) |
GhostController |
Ghost state (2026-11-27: no body, a ghost's sheet for the stream camera, no belt nor blaster to take; the menu opens, a ghost looks and changes its settings, nothing else: GameMenu.GhostMay): grey world (environment saturation 0), menu closed, ghost rig at 5 m/s (no jump, no shooting), the respawn pose held 1 s (RespawnGesture; VR hands up, desktop R), the hint line, its own RespawnBeam (others' beams are on their EntityView); the raise key (E / VR X) on the nearest ghost in range (GhostLogic, RaiseChannel in Client.Core) |
VoiceController |
The voices (see Voice): the microphone to the Gateway while speaking, each voice heard at its speaker's head or as the party's radio, the per-player volume and mute, the dictation's recording |
PlayerPointController |
Pointing at a player 3 s with an empty hand (desktop: right mouse): the ring, then the Players tab on it (see Players tab) |
FriendsController |
The friends' list read every 30 s, its notices, its requests and answers (see Friends) |
PartyController |
The party read every 5 s (members, invitations, places for the map), its notices and changes, Join (see Party) |
TestHooks |
Command-line hooks for scripted runs and screenshots (--new-account, --screenshot, --menu, --shoot, --fly, --walk, --ghost-preview, --character-preview, --body-preview, --body-eyes, --goblin-preview, --mob-preview, --dungeon-preview, --origin-test...) |
Per frame, in game: terrain, entities, menu left behind (10 m), own balls, other balls, map, zones, position sent (15 Hz), HUD, test hooks. Rules that do not need Godot go to Libs/Client.Core (tested), not into these controllers.
Spaces (ClientSpaces): each world the client shows is a space of its own, a subtree with its own environment (sky colour, haze, the ghost's grey), its own sun and its own clouds, and only one is in the scene at a time (ClientSpaces.Show: the other is taken out of the tree, kept, neither drawn nor processed). Nothing of one can leak into the other: before, the login screen was the game's scene with the world hidden, and things of the game showed there (the platforms, a blaster, the belt, the sky's clouds around a balcony left at the height the player logged out from).
- The login's space (
LoginSpace): the balcony over its sea of clouds (LoginBalcony: the clouds turn very slowly round the balcony, each at its own distance, so the sea stays as dense near it after an hour, and none enters it) and its own sky, around the scene's origin. On leaving the world the floating origin goes back to zero and the player stands at the same place on the balcony, wherever they were (a mountain, a glide, 100 km away). The Nexus (the opening,Plan.md) goes there too. - The game's space (
GameSpace): its environment (ClientContext.Environment), its sun, and the world underClientContext.WorldRoot(game coordinates, the floating origin): its sky and clouds, the terrain, the entities, the shots, the platforms. Shown on entering the world (Main.OnEntered), the login's back on leaving it (OnLeft). - The splash and loading space (
ClientSpaces.Splash, 2026-11-29): a space of its own like the others, not a panel over one: a black environment (no sky, no ground, no sun), andSplashScenein it: the game's name (not translated), "Made with" (loading.made_with) and the official Godot logo (Apps/Client/Assets/Splash), a line of status ("Logging in…", "Entering the world…"). The game starts in it (Main: before the login's space), and entering the world swaps to it. It is placed where the head looks when it opens, then stays there (HeadAnchor, like the login menu: never carried by the head). The load's space can be warmed (ClientSpaces.WarmWorld): the world is in the scene but hidden (Visibleoff, itsWorldEnvironmentemptied) while the splash is the space seen, because the terrain and the views need the tree to build themselves;Showthen makes it visible (the only exception to one space in the scene: the warmed one is never drawn).LoadingControlleris the one controller for every load:Begin(showAfter, minShown, optionalCap, max, to, status, warmTo)andTick(delta, ready, optionalReady)each frame,SetStatus,Show/Hidefor a load with its own end;Client.Core.LoadingGate(pure, tested) decides when it shows and goes.- At start: shown at once, for
LoadingGate.StartMinSeconds(1.5 s;--splash-min) at least, until the first screen is ready (SessionController.ScreenReady: the device's session traded and the characters listed, or the login's two choices; an error of the server counts: its message shows when the splash goes; at mostStartMaxSeconds) and the item icons are drawn (ItemIconStudio.Done, at mostIconsCapSeconds: then they finish behind the next screen). - Entering the world: only if it takes longer than
EnterDelaySeconds(0.5 s: no flash on a quick load), until the terrain round the player is built (Terrain.NearReady), the first snapshot came (GameConnection.SnapshotsReceived) and the startup preload is done (Client.Core.StartupPreload, 2026-12-01: one gate for everything the client prepares off the main thread from its start, each part registering its progress; the mobs' models,MobModels, "Preparing creatures… 14/20",loading.creatures; and the in-game menu,GameMenuController.Prepare, "Preparing the menu… 12/31",loading.menu, 2026-12-01: built one step a frame, then each tab drawn once with the player's data, shrunk under a pixel in front of the camera, then hidden, so its first opening drops no frame (--menu-tourmeasures and checks it,Docs/perf/2026-12-01-menu-first-open.md); and the VR quest watch,WatchController.Prepare,loading.watch, three frames: built, drawn once under a pixel with sample texts, hidden, then kept for the run (a desktop has none: done at once); meanwhile the line under the logo says the first unfinished part; usually done long before a character is picked: no wait; the same gate for the character screen's Play, an automatic login and a reconnection, all throughMain.WorldReady), at most 30 s; the HUD and the rig's controls come back then. It goes by a fade: the scene's alpha, the next space shown, a black veil (a sphere with one see-through unshaded material, round the eyes) fading away: no shader beyond that, a steady frame rate. The login and character screens are hidden meanwhile (SessionController.Hold: one root for the 3D menus, one canvas layer for the desktop's). - The dungeons' gate uses it too (2026-11-30, the old veil of the dungeons is gone):
Main.SwitchSpacebuilds the new space warmed (ClientSpaces.WarmDungeon/WarmWorld: in the scene, hidden, environment off) behind the splash (LoadingController.Show), andHidewhen the dungeon's mobs show (or the world's time passed). Where it leads is decided when it goes, not when it began: the space the player's feet are in then (Client.Core.SpaceSet.Destination), so a move refused (a ghost, a mob holding the player) or later than the screen's wait (a dungeon on another GameServer) shows the space the player is still in, never the world's space at the dungeon's place (bug report #12, 2026-11-30). Which space is shown and which is warmed is one pure state,Client.Core.SpaceSet(tested: in and out twice, refused, late, a death, entering the world in a dungeon), andClientSpacesputs all four nodes in that state after each change: one warmed at a time (a dungeon warmed then the world: the dungeon leaves the scene), a space shown is always visible with its environment on. A space goes out of the scene and comes back (RemoveChild), so a node in it must not take_ExitTreefor its end:Terraindrops its chunks' results only when freed (NotificationPredelete; before, a terrain taken out of the scene once never built a chunk again: bug report #13, the city back from a dungeon without ground nor houses).
- At start: shown at once, for
- What goes from one to the other: the rig (the headset or the desktop camera, the hands and lasers, the own body), the menus, the HUD and the panels (scene coordinates, children of
Main), the sounds, the stream camera. - A node in a space may leave the tree and come back: what it sets up while in the scene goes in
_EnterTree/_ExitTree(_Readyruns once), and a sky leaving clears its cloud's fog off the eyes (SkyAndClouds.ClearFog). - A dungeon's space (
ClientSpaces.Dungeon): no sky, a dark haze themed by the level range (DungeonView.Theme), the caves (DungeonView) under its own root (DungeonRoot, game coordinates, placed at −origin like the world root: the caves lie 20 km from the city,DungeonMap.OriginFor). The player's own space follows its feet (DungeonSpace.RangeAt): when the server moves it into a dungeon (through the gate) or back (the teleport to the city, a death),Main.SwitchSpacetakes the space left down and builds the other behind the splash / loading space (LoadingController: black, the title, a line of text): into a dungeon, the world's terrain freed, the caves built (DungeonView, a lantern round the player), the view turned into them, until the dungeon's mobs show (its instance's first snapshots); back, the terrain built again. What lives in both (players, mobs, shots, zones, loot, sounds, beams) is underClientSpaces.Actors(ClientContext.ActorsRoot), moved with the space shown; what is the world's only (terrain, buildings, platforms, stations, sky) stays in its space. The ground under the rig, the views and the own shots is the space's (GameConnection.Ground). The offline preview shows the caves too (--dungeon-preview, see Dungeons inWorld.md). - A later world (the tower's floors) is one more space of the same kind.
- Checked by
--login-check(LoginCheck: the game's space out of the scene, every visible 3D object in the login's space or the player's menus and hands), run byValidate.ps1 -Screenson a desktop, with the VR menu, and after a game 3 km away (--logout-after;--reloginplays again 2 s later).
The player's body is an IPlayerRig: DesktopRig (keyboard and mouse) or VrRig (OpenXR).
- Walking: both rigs use the same code,
Client.Core.Locomotion(engine-free, tested inLocomotionTests; it walks anIGround, the rig'sWorld: the world,WorldGen, or a dungeon's caves,DungeonMap;Movement.csonly converts Godot's vectors and the floating origin). Each frame a rig calls, in order:UpdateSwimming(deep water: floating);Carry(the moving platform under the feet);- its own move:
Step(the same speed rules as the server checks,WalkSpeed, pushed out of every solid withResolve) orDive; SettleYwith itsJumper(ground, jump, falling off a ledge over 0.6 m, a jump stopping under a roof, an arch or a platform:Headroom);Settled(what the feet stand on now). The rig only reads its input and moves its node.
- Gliding (VR only,
Client.Core.Glider): arms spread in the air. The controllers' pitch dives, climbs or airbrakes; their bank turns the view and the glide, with no stick turning meanwhile. Energy is kept, up to the character's top gliding speed (see Gliding inWorld.md). - Swimming: both rigs swim and dive (
Client.Core.Swimming), with a light blue tint around the eyes under water (Movement.UnderwaterTint). - The water (
WorldWater, the plane atWorldGen.WaterLevelthat follows the player inTerrain): a shader, no texture. Four swells of different lengths cross it and move with the time (its normals only: the plane stays flat), the sun glints on their crests, it is seen through from above (the bottom shows near the shore) and mirrors the sky's colour at a grazing angle; the small waves fade with the distance (no shimmer far away in a headset), the swells too from 400 m to 1.5 km (smaller than a pixel they drew rings of moiré on the far water). Its swells are computed in the world's coordinates folded on 256 m, each with a whole number of waves over 256 m along x and along z (the pattern repeats exactly): the floating origin's shifts and the plane following the player never make them jump. From below its underside shows, bright and moving: the surface seen by a diver. - Under the water (
SkyAndClouds.Water, the game's sky): the eyes under the water level turn the fog into a close blue-green haze, darker and closer the deeper (30 m of sight at the surface, 14 m at 20 m down), the sky's clouds hidden (they ignore the fog: they would show through the surface); eased in a fraction of a second, back as the head comes out. - Own body (VR,
OwnBody): the players' character under the eyes, at its own size, seen when looking down (it replaces the blue boxes the hands were). A ghost's is pale and see-through. It is drawn twice with the same pose (AnimatedBody.Mirror): headless and without a shadow for the headset; whole, with its head, on theRenderLayers.ThirdPersonlayer that the headset's camera does not show: its shadow has a head, and the stream camera sees it all (the headless one is onRenderLayers.FirstPerson, which only the headset and the stream camera through the eyes show).- It hangs from the player's neck, not from the eyes (2026-12-01, the owner on the Quest 3: placed from the eyes, the chest followed them when looking down and the eyes ended in it, a "big belly", no legs): the neck is 10 cm behind and 11 cm under the eyes in the head's frame (
BodyTracking.NeckFromEyes), so pitching the head moves the eyes about it, forward and down in front of the chest, and the body stays: looking down shows the chest from above, then the legs and the feet. Its hips go down as far as that neck is under where it is standing (BodyTracking.PlaceOwn: a shorter player, knees bent for real; looking down is no crouch), so its neck is never above the player's; and it moves back if the eyes would come nearer its torso than 9 cm (EyesClearance: beyond a headset's 5 cm near plane even at its corners, so the chest is never cut open; the torso's shape isBodyTracking.TorsoStations, the model's, checked againstcharacter.pyby a test). The others' crouch is read from the head upright (UprightEyes) within the neutral zone. It turns towards where the head looks (lagging, at most 40° aside); when the play area turns (a snap or smooth turn, a turning platform) it turns with it at once; its legs walk with the player (AnimatedBody), its hips go down when the player crouches (CharacterAnimator.Crouch, from the eyes' height) and only then: walking or running never lowers them under the eyes (2026-12-01, the owner saw his body sink under him when he set off):CharacterAnimator.HeadAnchoredleaves out the stride's dip and bob, the landing's crouch and the lean forward for the own body; its legs still walk, and the others see the whole walk (their animators do not set it). Client.Core.BodyTracking(engine-free, tested) puts the tracking on the walking pose: the head as the headset (shrunk to nothing for the player's own eyes:AnimatedBody.HideHead), each arm reaching its wrist (two-bone IK, the elbow out and down; the torso never moves for the hands; the model's arms are a human's for its height, shoulder to wrist 0.57 m for 1.8 m, but a player's own arm may reach further (a tall player's eyes are lowered to the character's, not its arms): the arm then stretches to the wrist, up to 40 % longer (BodyTracking.MaxArmStretch,CharacterPose.ReachL/ReachR: the view scales the whole arm from the shoulder and the hand back to its size,AnimatedBody.ApplyPose), so the hand stays on the blaster, which is where the controller is (the aim never moves for the body); beyond, a controller put down far away, the hand stops at the end of the stretched arm; the other players see the same, their client solving the same arms), each hand turned as the controller (held in a fist: the fingers along its aim, the index side up) or the tracked hand (its palm's frame).- A blaster in the hand (
Client.Core.BlasterGrip): the blaster stays where the controller puts it (the aim the player knows) and the character's hand closes on its grip instead: the wrist a fist behind the grip's middle, the fingers across it, a little down (a pistol grip leans back 15°), the middle, ring and little fingers round it, the thumb across, the index on the trigger, pulled with it (BlasterGrip.Fingers). - The fingers bend (
HandCurl, turned byAnimatedBodyon the model's finger bones): with a controller, the grip closes the middle, ring and little fingers, the trigger the index (resting on it: a little bent; off it: pointing), the thumb lies down on the stick or a button (the Quest Touch's touch sensors:trigger_touch,primary_touch,ax_touch,by_touch), else it is stretched out, raised as the hand closes (a thumbs-up); with a bare tracked hand, each finger's bend comes from its joints.
- It hangs from the player's neck, not from the eyes (2026-12-01, the owner on the Quest 3: placed from the eyes, the chest followed them when looking down and the eyes ended in it, a "big belly", no legs): the neck is 10 cm behind and 11 cm under the eyes in the head's frame (
- Eyes' height (VR,
Client.Core.EyeHeight): the eyes in the game are the eyes in the room plus a fixed offset: the view never moves by itself (2026-12-01, the owner on the Quest 3: the old slow settling, 4 cm/s, recentred the view while he moved). The offset is set by a recentring, which puts the player's steady head (EyeHeight.SteadyHead: within 3 cm of its smoothed height for half a second) in the middle of the range,EyeHeight.Centre: the character's eyes standing (1.62 m, the world as it always looked), with 20 cm free above before the ceiling (Headroom) and 20 cm below before the crouch starts (the neutral zone). A recentring happens only when the view moves anyway: at the start (the first steady head; before it, the view is held at the centre), on a teleport (the world's entry, a loading screen, a dungeon) and a respawn, at once while the screen is dark; on a jump (or a wing's take-off) and at the start of a glide, spread over 0.7 s (JumpRecentreSeconds) on top of the jump's own motion. Each one logs[eyes] recentred by N cm on jump|teleport|respawn|glide|start. In between the eyes follow the head 1:1.- The ceiling: 20 cm above standing (
EyeHeight.Ceiling, 1.82 m: a head on tiptoes still moves the view up 1:1; higher, on a chair or a ladder at home, it is held there: nobody rises further in the game by climbing at home); the floor: never under its lowest crouch (1.07 m); neither touches the offset, so the view follows again as soon as the head is back in the range. The right stick (pushed past 80 %,EyeHeight.DeadZone, so never by mistake; up or down, more than sideways; not while pointing at a menu nor flying): up raises the offset up to standing and never higher (a seated player stands up; the head now and its steady height both count, so a head a moment lower while the stick is held, looking down or leaning, never stores more: 2026-12-01, the owner saw his head 20 cm above his body after a stick crouch then the stick up; the room above standing is only for the real head; it stays until the next recentring, which centres the seated head anyway), down crouches only while it is held: let go, the eyes rise back by themselves at 1.2 m/s (EyeHeight.RiseSpeed, about half a second from the lowest). The play area is lifted by the difference (VrRig._lift), the feet staying on the ground. The own body keeps its real size: centred, its eyes standing are the player's; a head above standing (tiptoes, up to the ceiling) makes it grow with it, uniformly, its feet on the ground and its neck under the head (BodyTracking.OwnScale, at mostCeiling / Standing, about 12 %), so there is never a gap between the head and the shoulders; back to its size as soon as the head comes down. Only the own view (and its stream camera's whole body): the others always see the character at its size. - A neutral zone: the eyes within 20 cm under the centre (
EyeHeight.Zone,EyeHeight.Middle, which is the centre; so the crouch has its full range, 1.42 m down to 1.07 m) change nothing: no hips down for the others (BodyTracking.Crouch(eyes, middle),BodyPose.Crouch), no slower walk, no rest (EyeHeight.CrouchDepth/Speed/Crouched, whatVrRig.Crouchedand the server's rest read). Beyond it the crouch grows from zero (no jump at the threshold) to the same maximum, reached with the eyes at their lowest. Crouched, one walks slower, more and more as one goes down: full speed over the first quarter of the crouch after the zone, then evenly down to a fifth at its bottom (EyeHeight.SpeedFactor). - The others see it: with each position (15 Hz) the client sends its tracked body (
BodyPose: the head's turn, each tracked wrist and hand, the fingers' bends, the crouch, how the body is turned from the head's yaw; 50 bytes); the GameServer keeps the last one and sends the fresh ones (under 0.5 s, not a ghost's) after its cell's snapshot, apart (CellPoses, each with where its player stands); the Gateway does not forward that message as is: each client gets only the bodies of its nearest players (at most 12 within 20 m, whatever their cell, chosen again every 0.5 s:Server.Core.PoseInterest), the far ones being shown walking anyway (below); the other clients put it on that player's body (EntityView: smoothed between updates,TrackedBody.Lerp), so they see the head turn, the arms and the fingers move, the thumbs-up and the crouch. A stale one: back to the walking animation. It also says which blaster each hand holds (BodyPose.HeldIn); the player's two blasters are in its meta (EntityMeta.Blaster0,Blaster1), soCharacterViewdraws that blaster in that hand (placed from the hand bone as posed:BlasterGrip.Controller, the inverse of the grip); the hold in the hand is the same for everyone (fixed). The VR belt (VrRig: two holsters under the eyes, turned with the head) is placed by the player in Options, Blasters (height, spacing between the two sides, forward:Client.Core.BeltHold, ±20 cm, saved in settings.cfg; bug report #80, 2026-12-02, the owner: the belt's blasters, not the held ones); the grab measures from the blaster where it hangs, so the hand takes it at its new place. Only its player sees its belt (the others' bodies show held blasters only,CharacterView): nothing is sent, its index moving with the trigger within reach (the contact ring: further, the fingers are still), its charge glowing and growing while that hand charges (BodyPose.ChargingIn: the glow computed by each client from the weapon and when the charge started; silent, never overheating there:Blaster.Shown). Its shots leave from that blaster's muzzle (WorldSync.MuzzleOf: the held blaster's muzzle nearest the shot; a desktop player's, about where its hand is).
- The ceiling: 20 cm above standing (
- Stream camera (Options > Stream;
Client.Core.StreamCameramoves it, engine-free and tested;StreamCameraViewshows it): a camera the player takes out to stream or film.- Not on a standalone headset (a Quest, the Android build: no desktop window to stream to): the quality profile's
streamCamerais false there (Config/quality.json,QualityProfile.StreamCamera), so Options has no Stream section (GameMenu.Sections), the camera, its window and its SubViewport are never made, and a setting saved on a PC cannot turn it on; the other players' cameras are still seen. It stays out through a log out and back in (it belongs to the game, not to the session), and is put away when the game closes: its on is never saved, its settings are (Settings.Load). Its image goes to a window of its own on the PC (a system window,WindowwithGuiEmbedSubwindowsoff, seeing the same world: what OBS captures; the headset keeps its own view), 1280 x 720 to 2560 x 1440. Four modes: follows behind (third person: behind the body, up and aside, turned to the head), selfie (the same in front), my eyes, steadied (the head's view without its roll, smoothed), and free: it stays where it was put (Place it in front of me, or let go). In VR the grip of a free hand takes it within 30 cm (in any mode: it becomes free); held, it is at the end of a pole along the controller (0 to 2.5 m), turned to the player or along the hand (Free camera: always turned to me), level like on a gimbal. The stabiliser (0 to 100 %) smooths its moves and turns (up to about 0.8 s behind; held, only its turn: the pole is rigid). - Max. trail (0.5 to 15 m, 3 by default; 2026-12-02, the owner: in a glide it was soon far behind): a following camera (follow, selfie, eyes) never trails more than that behind its place, so fast moves (a glide at up to 66 m/s, a fall) keep it close while the stabiliser still smooths a walk. Its settings: distance, height, side, pole, stabiliser, max. trail, field of view (30 to 110 degrees), window size, and its image on a small screen over the left hand (VR). Closing its window puts it away, and so does going more than 20 m from it when it was left somewhere (free mode, not held:
StreamCamera.AutoCloseDistance, with a notification). A following camera never is put away (before 2026-12-02 a glide or a fall to death left it over 20 m behind and put it away); a teleport or a respawn (a jump of more than 30 m) takes any camera along, a free one in front of the player. The camera is a small dark box with a lens, a red light and its image on its back, onRenderLayers.StreamGear: the headset sees it, the camera itself does not. It sees the whole body with its head (ThirdPerson), through the eyes the headless one (FirstPerson); the whole body has its own wing and the wind round its hands (CharacterView.DrivenWing, 2026-12-01: before, the only wing was the headset's body's, onFirstPerson, and the stream showed its shadow, not the wing). Everything else a player sees in the world (the shots, the mobs' zones on the ground, projectiles, effects) is on layer 1, which every camera shows. - Names: a nameplate is turned to the eyes, so the stream camera has its own: while it is out (
Nameplate.StreamLens) each plate gets a twin turned to it, drawn only by it (RenderLayers.StreamNames; the players' onStreamPlayerNames), the plate itself only for the eyes (EyesNames; the headset and desktop cameras leave the stream's layers out,RenderLayers.Eyes). The mobs' and NPCs' names are always in the stream; the players' only while Show players' names is on (on by default), and then its red light is lit, for everyone: the others know their names are filmed; off, it is dark. - A ghost (2026-12-02, the owner): the world turns grey for the player (
GhostController), the stream keeps its colours (its lens gets its own copy of the world's environment in colour, its fog followed each frame:StreamCameraView.Ghost), except through the eyes (StreamCamera.InColourWhileGhost: what the player sees, grey too; held, it is a camera again). Settings saved insettings.cfg(sectionstream). On a desktop it works too, but the desktop player has no body of their own to film. - The others see it: while it is out the client sends it 10 times a second (
StreamCamera: its place in the world, its turn, its field of view, whether it films the players' names (StreamCam.NamesFilmed: its red light, protocol 84); 22 bytes; only within 60 m of the player,StreamCam.MaxRange, which the GameServer checks too). The Gateway passes it on (PlayerStreamCamera), the GameServer keeps it (SimPlayer.Camera) and sends it in the snapshots' optional section after the poses for one second after the last one (SnapshotBuilder.CameraFreshSeconds); the other clients show the same camera there, smoothed (RemoteStreamCameras), and put it away 1.5 s after it stops coming.
- Not on a standalone headset (a Quest, the Android build: no desktop window to stream to): the quality profile's
- Terrain:
Terrainstreams the ground around the player: which chunks and far tiles, at which level of detail, within a time budget per frame. Near chunks go to 384 m on a PC (the device's quality profile,Client.Core.QualitySettingsandConfig/quality.json: less on a Quest), drawn by blocks of 4 × 4 chunks (Client.Core.TerrainBlocks: one ground mesh and one multimesh per prop mesh a block, merged on a worker thread, a block rebuilt once all its changed chunks are computed); far rings of 256 m tiles to 1 km and 1 024 m tiles to 4 km. - Meshes:
GroundMeshmakes the ground triangles, coloured byShared.Gameplay.TerrainColors(biome, height, slope; also used by the map and the doc site).PropMeshesmakes each biome's props as MultiMeshes: trees, cones for pines, glowing shards for crystals, rocks, bones, stone rings and arches, unlit spheres for the glowing bulbs and wisps.
Static pieces merged (MeshMerge.Collapse, the flight tower: ~160 draw calls fewer in the town's east view): a node's meshes with a material override merged into one mesh per material; every piece is made indexed as it comes in (Client.Core.MeshMergeBuffer, tested), so indexed meshes (a BoxMesh) and non-indexed ones (a SurfaceTool strip) mixed keep all their triangles (2026-12-01, bug report #18: SurfaceTool.AppendFrom drew only the vertices an index named, the ramp's handrail vanished); a piece that is not triangles is left as it is. --no-mesh-merge leaves every piece alone (to compare a picture).
Terrain threads: a chunk's or far tile's heights are computed once on a grid ((n + 1)² points, not 3 per triangle), then its vertices, flat normals and colours (GroundMesh.ChunkArrays / TileArrays) and its trees and rocks (PropMeshes.Compute) are built on the thread pool, up to half the cores at once (2 to 8). The main thread only turns finished arrays into meshes and nodes, 2 ms per frame at most and one block or far tile a frame (each is a mesh to upload). A ground mesh's surface is even encoded on the worker in the renderer's own byte format (GroundSurface: positions, octahedral normals and the tangent Godot makes up, 8-bit colours) and handed to the mesh as a saved mesh is read (ArrayMesh._surfaces): the main thread is left with the GPU upload (2026-12-01: a block's AddSurfaceFromArrays took a Quest 20 ms and more, a dropped frame while gliding). The layout is asked of Godot once at start and the encoder checked byte for byte against a mesh Godot builds itself; any difference (another Godot, another renderer) and the old way is used (the log says which).
Planned ahead: above 8 m/s (a glide, a dev flight) the near chunks are planned round a point 1.5 s ahead along the smoothed horizontal velocity, at most 64 m (TerrainDetail.PlanCentre: the ground under the feet stays at full detail), so what the player flies towards is computed and built first. The terrain has no physics shapes: collisions are Shared.Gameplay.Obstacles and the ground's heights, pure functions. A result that is no longer wanted (the player moved on, the level of detail changed, a camp's plateau was revealed meanwhile: Terrain._version) is dropped. The workers only read the world: WorldGen.Height, Props and CampSites (copied on write when the main thread adds a revealed site).
Map (MapRenderer, MapFrame): 200 × 200 pixels of 5 m, 1 km around you, no zoom. The ground (heights, water, the safe zone's edge, known camps) is drawn on a worker thread only when you have moved 50 m from its centre or a camp was revealed; four times a second the dots (you with your direction, players, the party: filled squares; never the mobs since 2026-11-27, one finds them by looking) are drawn on a copy of it. Beside it (VR: on the right screen) a compass (CompassWidget, values from Client.Core Compass), north up like the map: the four points, a yellow mark where you look, an arrow towards the safe zone's fountain (the world's centre) with the fountain at its tip and the distance; under it your position and the fountain's distance and direction ("Fountain: 12.3 km W (270°)").
Floating origin (WorldOrigin, Client.Core FloatingOrigin): a 32-bit float has ~7 digits, so 10 km from (0, 0) it only places things to the millimetre (8 mm at 100 km) and what is 50 cm from the eyes (hands, blasters, status panel) shook. The scene is therefore drawn around a moving origin.
- World root: everything of the world (terrain, buildings, players, mobs, balls, zones, clouds) is under
ClientContext.WorldRoot, in game coordinates. That node is placed at −WorldOrigin.Offset. - Scene coordinates: the rig and what is placed around the head (menus) live near (0, 0).
- Shift: when the player is more than 2 048 m from the scene's centre, the origin moves by whole 1 024 m steps (exact in a float, chunk-aligned) and the rig and menus move back (
Main.ShiftOrigin): nothing shows. Game coordinates (server, network,WorldGen, collisions, the map) never change. - The rule: a scene position read from a node outside the world root (the rig's feet are
IPlayerRig.SceneFeet, a muzzle, the head) goes throughWorldOrigin.ToWorldbefore game logic or the network. A game position goes throughToScenebefore it is put on such a node.IPlayerRig.Feetis already in game coordinates, and the rigs move in scene coordinates (Movement.Stepasks the world at feet + offset). - Test: the hook
--origin-testmoves the origin by ±1 024 m every second, so a node not converted jumps by a kilometre.Validate.ps1 -Screensalso takes a screenshot 100 km away.
Status and laser:
- Status (
StatusWidget, values fromClient.CorePlayerStatus): the level in a circle whose ring fills with the XP towards the next level. Under it the health bar, green above half, orange down to a quarter, red below, with "hp / max" in it, the magic bar and the stamina bar (yellow, thinner, 2026-11-29:StaminaGauge, counted by the client each frame byHudController.StepStaminaand set right by each stats); while a wing S is worn, the stamina bar ends in a small wing whose ring fills during the take-off's cooldown, gold when ready (2026-12-02, Wings inWorld.md); each ends in grey for what is lost of its maximum now (2026-11-27:ClientArmor.Full, the maximums clean and in new armour; the magic loses to the dirt and the armour's wear, the health to the wear). Beside the ring a badge for a mob's poison (a pulsing green drop, the bar's edge pulsing green: the VR viewport is redrawn every frame meanwhile) or slow (blue, the speed left). Name and kills are in the menu. In VR it is a panel under the eyes, half a metre ahead (VrRig.UpdateStatusPanel), set in Options > Interface (Client.Core.StatusPanel, saved with the settings): when it shows (always; in a fight only: while the health is not full or the player is poisoned or slowed, and for 8 s after a blow taken or a shot fired, fading in and out; hidden: the panel never shows; the menu's Character tab no longer has the health since 2026-12-01, it is the character's exploits), how far under the eyes (10 to 55 cm by 5, 30 by default: lower leaves the view freer, higher is read without looking down), and over the hands and blasters or not (on, as before: drawn over everything, a hand or a blaster passing between it and the eyes does not hide it; off: what is nearer passes in front of it). The centred line above it (a ghost: how to respawn) always shows. - Where: always shown. On a desktop at the top left. In VR drawn into a small viewport (redrawn only when a value changes) on a panel 0.5 m ahead and 0.3 m under the eyes, always facing them (square to the gaze when you look down at it) and drawn on top of everything (
IPlayerRig.HudAnchor, placed every frame byVrRig). - Following the head: not up and down (looking up hides it). Horizontally it stays put while the head turns less than 25° from it, then catches up like a spring until it is in front again.
- Laser: each blaster in hand (
IPlayerRig.Aim: the shot's direction) shows a thin laser of its colour, brighter while charging, always 5 m, through everything (2026-11-23: stopping on a mob's hit sphere, wider than its model, ended it a metre or more before a golem). It is a child of the muzzle, so it never lags behind a moving hand. It lights up (paler, opaque) while it crosses a mob's hit sphere: a shot fired now would hit (Client.CoreLaserSight.OnMob, the balls' sphere, allocation-free;CombatController.UpdateLasersevery frame). None for a ghost or a holstered blaster.
Buildings: BuildingsView places the safe zone's buildings (SafeZoneBuildings) from their .glb models (Apps/Client/Assets/Buildings, made by Tools/Blender/buildings.py), read at run time with GltfDocument (Glb.Read, the one reader of every model; Glb.Meshes lists a model's meshes). Godot ↔ System.Numerics conversions (the libs' types) are the extensions of NumericsExtensions (ToNumerics(), ToGodot()).
Players' bodies
Smoothness (Client.Core/Interpolation.cs). The others are shown a little in the past, between two of their states, so they move evenly whatever the packets do:
- each snapshot part says the world time its states were true at; each player and mob keeps its states by time (
Timeline, about a second; late parts put in their place); - the client shows them at
GameConnection.RenderTime= the world time minusInterpolationDelay(one snapshot interval plus the mean lag and three times its spread: 100 ms on a good network, more on a jittery one, moving slowly), on a smooth curve through the states (Catmull-Rom with their times), the turn the short way, on a moving platform in its frame; - past the newest state (late or lost) it goes on along its last velocity at most 0.2 s, then holds; when the states come back, the jump is not shown: it goes into a correction that fades in ~0.25 s (
RemoteMotion); a teleport is shown at once; - the VR bodies the same way (
PoseTimeline, 20 Hz from the nearest, no extrapolation of the hands); - the mobs' actions and zones are not delayed (the warnings come as soon as possible);
- a shot of another player leaves its hand as shown, then joins its real flight; a correction of the local player glides on a desktop when small, jumps in VR (gliding a view the player did not move makes them sick);
--net-sim LATENCY,JITTER,LOSS(client and bots: LiteNetLib's simulation) and the--perfcounters (interp_delay_ms,lag_ms,jitter_ms,extrapolating_pct,corrections) measure it;InterpolationTestsplays a player walking through simulated networks.
The other players are shown as a manga-style character (EntityView → CharacterView), with a detail that falls with distance so a crowd costs little (Client.Core.AvatarLod, chosen by WorldSync each frame from the distance to the eyes):
| Ring | Distance | At most | Shown |
|---|---|---|---|
| Contact | ≤ 5 m | 10 with Near (the nearest) | the whole body, its VR body with the fingers, its name plate, its shadow, animated every frame |
| Near | 5–15 m | (the same 10) | the same, the fingers still, animated every other frame |
| Mid | 15–40 m | 30 | walking only (no VR body), no shadow, animated every fourth frame (Godot's mesh LODs lower its triangles) |
| Far | beyond, or past the limits | — | a plain dark silhouette, all of them in one draw (CrowdSilhouettes, a multimesh), leaning when it walks |
The choice is stable: made again every 0.5 s, a ring left only 1 m past its edge, a player taking another's place only when 2 m nearer and after that one held it 2 s. Name plates: the nearest 12 that may have one (close, or Mid within 25 m). A DEV player (EntityMeta.Dev) is shown at least Mid with its plate up to 200 m, outside the limits. Measured on the dev PC with 100 VR bots on the plaza (flat 1280 × 720): 3.8 ms a frame and +68 draw calls over the plaza alone, where it was 14.7 ms and +864 before.
The mobs' level of detail (2026-12-01, Client.Core.MobLod, chosen by WorldSync each frame from the distance to the eyes, whether the mob fights, MobLabels.Fighting, and its longest attack's reach, MobLod.ReachOf): a dense forest has ~140 wolves in the active cells, each a puppet of ~70 nodes and ~8 draw calls; posed every frame they took a Quest's main thread (20 fps). No mob is ever hidden (a ranged mob must never shoot from out of sight):
| Tier | Which | Shown |
|---|---|---|
| Near | the nearest 12 within 22 m, and every mob fighting within 45 m (on top of the 12) | its puppet posed every frame, feet placed on the ground, its nameplate |
| Mid | within 45 m, fighting within 100 m (beyond every attack's 70 m), or within its attack's reach of the eyes + 5 m | its puppet posed one frame in 3 (the time added up), legs swung, no nameplate (not processed) |
| Far | the rest | no puppet (never built while it stays far: CreatureView goes in the scene when it comes nearer), no script, no nameplate: the species' model at rest, all of a species in one draw call (MobCrowd: the puppet's pieces merged once into one mesh, the first choice of each part, the instance's skin colour and scale; a fairy and a wraith glow, a wraith see-through, a worm under the sand not drawn), placed one frame in 2 |
In a big fight only the nearest 16 fighting mobs are near (MobLod.MaxFightingNear, a dungeon's hall: its ~50 mobs called there would all be), the others fighting are mid: animated, no nameplate, never drawn at rest. A tier is kept 12 % further (no flicker). The mob views do not process themselves: WorldSync ticks each at its tier's rate, spread over the frames by id (MobLod.Due); slimes and goblins have no crowd (a far one is posed one frame in 4). The biomes' models are prepared on a worker thread from the start (MobModels: each file parsed, GltfDocument.AppendFromFile, and its far mesh's arrays and its height baked from the parsed file, on the CPU; a species whose mob shows first goes first), and a species' whole scene (every variant of every piece) is made on the main thread only when its first mob comes near (a few milliseconds, once; made for all 20 at start, their ~1 500 meshes exhausted a PC's Vulkan allocations once the sun's shadows were on); a mob whose model is not read yet waits out of sight (it comes in at the far edge of the active cells), and the crowd's shaders are compiled at start (MobCrowd.Warm): a new species met in a glide no longer stops the game 30-60 ms on a Quest. The dungeon's offline preview (--dungeon-preview) shows its mobs at the same tiers (its goblins and slimes as the game's views) and --perf-run measures it; --dungeon-rally puts every mob of the dungeon in the champion's hall, fighting, and --dungeon-off glow,fog,lights,lantern,crystals turns parts of the caves' look off (what each costs). A dungeon's caverns' lights are on only within dungeonLightRadius of the eyes on a Quest 2 (the quality profile; faded in and out): the mobile renderer gives each cave mesh every light whose range touches it, and every pixel pays them all (the champion's hall: 96 % of a Quest 2's GPU with all of them, 58 % without). --mob-lod near|mid|far forces a tier (with --mob-preview: each species beside its far crowd's look). Measured: Docs/perf/2026-12-01-mobs-glide.md.
| Part | Where | Does |
|---|---|---|
| Model | Apps/Client/Assets/Characters/human.glb, made by Tools/Blender/character.py |
One smooth skinned mesh (~6 200 triangles, vertex colours) on a 45-bone skeleton: hips, torso, head, arms, forearms, hands with three bones per finger and thumb, thighs, shins, feet. Read once, copied per player: one draw call and one material per body (the hit flash and a dead player's greyer body, CorpseView, change the material; that body is posed once, limp (CorpsePose: arms flung out, legs apart, the head rolled aside, seeded by its id) and tilted with the slope under it; a ghost is the sheet of ghost.glb, GhostView). |
| Skeleton | Libs/Client.Core/CharacterRig.cs |
The animated bones, their parents and rest positions, the finger bones. CharacterTests checks them against the .glb. |
| Animation | Libs/Client.Core/CharacterAnimator.cs |
Pure math, no allocation per frame (tested). The pose: hips position and each bone's rotation, in frames aligned with the character (x = its left, y up, z forward; rest = arms and legs hanging down). |
| Goblins | Apps/Client/Assets/Characters/goblin.glb, made by Tools/Blender/goblin.py; Apps/Client/Scripts/GoblinView.cs |
One skeleton and every choice of every part (68 skinned meshes: Body with "Fat" / "Thin" blend shapes, Head0..9, Face0..9, Weapon0..9, Top1..9, Bottom0..9, Headgear1..9, Accessory1..9). Each goblin keeps the parts of its GoblinLook (Shared.Gameplay, from its mob id), tints its skin, sets its build, is scaled to its height. Its legs are the players' at CharacterRig.GoblinLegScale (2/3), so the same animator walks it (in a space where they are the players' legs: positions divided by leg scale × body scale, AnimatedBody); GoblinView.Adjust adds the attack poses (throw, charge, cast / channel). A thrown weapon is the thrower's own (ThrownWeapon). GoblinTests checks the parts and the legs against the .glb. |
| Biomes' mobs | Apps/Client/Assets/Mobs/<species>.glb, made by Tools/Blender/creatures.py; Apps/Client/Scripts/CreatureView.cs |
One puppet per species (Species, all but slimes and goblins): joints (empties named for its BodyPlan: Body, Head, LegFL, LegFL2..., Hips, ArmL..., Seg0..., WingL...) holding rigid low-poly pieces, every choice of every part (Head0..9, Ears0..9, or Claws3_L for one of several pieces), an empty Top at its height, materials skin (tinted with the mob's colour) and gear. Each mob keeps the pieces of its MobLook, is tinted, thin or stocky, scaled to its height; CreatureView turns the joints for its body plan (four legs, two legs, eight legs, a worm, wings, a fairy, a wraith, a mushroom). Within 70 m of the camera its legs walk on the real ground: each sole (an empty LegFLFoot, LegLFoot, LegL0Foot...) is planted while the body passes over it (the gait advances with the distance walked: no sliding), then swung to its next landing ahead, the hip and knee turned by a two-bone IK (Client.Core.LegIk); the body tilts with the slope under its feet and rises or sinks to them (a biped stays upright, its knees bend). Farther, the legs just swing. It also takes a pose for what it does (crouched before a charge, arms up casting, getting up, under the sand as a mound). MobModelTests checks every model's joints and parts. --mob-preview [species] shows them in the game. |
| View | Apps/Client/Scripts/CharacterView.cs |
Each frame: the animator's pose onto the Skeleton3D. A rotation q given in the character's frame becomes the bone's local rotation P⁻¹ · q · P · rest (P: the parent bone's rest rotation in the skeleton's space), so the bones' own orientation in the model does not matter. |
| What to play | Libs/Shared.Gameplay/CharacterAnim.cs |
Idle, Walk, Run, Jump, Fall, Glide (lying flat, face down, the arms spread like wings, the legs stretched behind; also a DEV flying at a run or faster more than a metre over the ground), Swim (a breaststroke), from CharacterAnims.From (the rig's gliding and swimming, then airborne and vertical speed from its Jumper, horizontal speed between two sends; run from 4 m/s). The legs only use it for the air: walk and run come from the speed shown (below). |
The animation:
- Steps: each foot is a point of the world. On the ground it stays where it is while the body passes over it, in any direction (sideways, backwards), when setting off, turning or stopping; a test checks it slides less than 2 to 3 cm. Then it lifts and swings to where the body will be half a stance after it lands, re-aimed every frame from the body's velocity, so a change of direction is followed at once. Faster means longer and quicker steps: the step rate keeps a foot on the ground within 40 cm (walk) or 45 cm (run) of the hips. Two gaits, from the speed shown with a margin so they do not flicker: run from 2.4 m/s (
CharacterAnimator.RunFrom), back to walk under 1.9 m/s (WalkBelow). Walking, a foot is down 55 % of the cycle and lifts 10 cm; running, 32 % (a flight between steps), 24 cm, the hips bouncing. Setting off, the foot further behind lifts at once; a foot left too far behind (a burst of speed, a sharp turn) quickens the steps; standing still, a foot away from its place (after a stop or a turn on the spot) steps back under the hips, then the steps stop. The heel lifts before a foot leaves. - Ground: each foot goes on the ground under it (
Locomotion.Ground: terrain, water, rocks, the hall's floor) by a two-bone IK (thigh, shin, knee forward); the hips go down when a foot is lower (slopes), the foot follows the slope. A foot on the ground keeps its ground height and slope (heel and toe) until it is put elsewhere, the body turns or its height changes: about 4 ground queries a frame per body walking and 1 standing, instead of 7 (tested). Above the ground by more than 0.5 m (dev flight, lag), a body shown walking falls instead. - Upper body: arms swing against the legs (more and bent when running), the body leans forward and twists a little, breathes when standing.
- Air: rising, knees up and the left arm up; falling, legs reaching down and arms out; on landing, a 0.3 s crouch.
- Gliding: lying flat (the torso turned 80° forward,
CharacterAnimator.Prone), the legs stretched out behind, the arms spread like wings and a little swept back (a VR player's follow its controllers); the hips go up and back so the neck stays where it is standing (under a VR player's eyes). Pale wind trails come off the hands (CharacterView: particles left in the air, a streak the longer the faster; not drawn beyond 60 m).
On the network: the client sends its animation with its position (InputMsg.Anim, 15 Hz), the GameServer keeps it (SimPlayer.Anim) and puts it in the snapshots (EntityState.Anim); other clients then compute the pose themselves. Bots send Walk when they move.
Later: the VR hands and fingers of the players near you (the finger bones are there; Valve Index controllers and hand tracking give every finger, Quest controllers only the touches of the thumb, index and grip), only the arms further, only this animation far away; and the same body for your own player (third person or a selfie camera for streams).
In-game menu
The game is made for VR, so there is one menu, the 3D one (GameMenuVr), on a desktop too (the desktop is a development tool: you test there what the headset shows). It draws a MenuModel (Libs/Client.Core/MenuScreens.cs: name, stats, switches, notices, raid board, selected item). The texts come from GameMenu, InventoryScreen and RaidBoardView (Client.Core, tested).
The menu is a group of screens 1.1 m in front of the eyes (in VR where the head looks horizontally, on a desktop where the camera looks, 1.5 m there so the side screens fit), closed when you get more than 10 m away from it (walked or teleported away), with the tabs as a row of buttons under the centre screen (tilted up towards the eyes). The right screen is wider (0.82 m instead of 0.6 m) on the tabs whose right side has much to show (Inventory, Collection, Options, DEV: GameMenuVr.SetRightWidth). Each tab shows one to three screens, the side ones turned 28° towards the player:
| Tab | Left screen | Centre screen | Right screen |
|---|---|---|---|
Inventory (GameMenuVr.Inventory.cs) |
Equipped: the character in what it wears and the blasters it holds (CharacterView.HeldOnDisplay: from the stats, the belt blasters not shown), standing alone in the air, no panel nor title behind it (2026-12-01, bug report #35: an open wing was cut by the panel's edge), turned with the slider alone under it (CharacterTurntable, UiSlider(bare: true): no name, no degrees; it never turns by itself, its legs stay still); an item dropped on it is worn or held |
the pouches' tabs (the bag, up to 5 pouches the player makes and names, + Pouch), Sort (level, rank, value: the pouch shown put in order once), the bin, and the 5 × 4 slots of the pouch shown: every item, the worn and held ones too (green; selected: blue) | the item's card: its name, where it is, a blaster's damage-by-charge graph, its facts as pictures with a word (ItemCards; the kit's UiItemCard, the same as the forge's centre screen, with ▲▼ against what is equipped); the pointer on one says what it means; the buttons left: Repair, and for a camp's intel Sell intel, Post bounty, Raid size |
Collection (GameMenuVr.Collection.cs) |
the whole collection in a line (how many, of how many kinds, what the smith gives), a tile per kind of material (7 a row) | the kind picked as a table that never grows, however many piles of levels there are: a row per rank (six at most, the best first), a column per band of levels (five at most: one level each when few, else round bands 1–49, 50–99... of the smallest width that covers them, CollectionScreen.Bands), a count in each cell, the rank's total and what it sells for (CollectionScreen.Grid), the smith's price for the weakest, Sell one at the forge |
|
| Character | the symbols over the mobs (MobLabels.Legend) |
stats | latest messages |
| Map | map (1 km around you, no zoom, no mobs), legend, TP to safe zone, TP to my level (N gold) (greyed with why in red over them when they cannot be done: a mob holds the player, a ghost, not enough gold; the party's Join too: TeleportBlock) (Travel: paid; the Gateway spends the gold through the DbWorker POST /db/characters/{id}/spend, the GameServer lands the player on a spot drawn where the mobs are about its level, TravelSpot: land, gentle, free; refused to a ghost, in a fight or held by an anchor, the gold back: PlayerGiveGold), Scout |
compass, your position, the fountain, the mobs' level here | |
| Raids, DEV | board / switch and text | ||
| Options | turn switch, language; Audio: the microphone and the sound output chosen in drop-down lists (AudioDevices: the system's default first, then the devices it lists; kept by name in the settings, Settings.ApplyDevices sets Godot's AudioServer.InputDevice / OutputDevice; an unplugged device gives way to the default, its choice kept for when it comes back), the microphone's test; Stream: the camera's mode in a drop-down list |
controls: wrapped lines in a list that scrolls |
The hands hold what the stats say (InventoryScreen.Worn: the belt blaster, or a forged one, see Blaster forge in World.md); the head, body, hands and feet slots show the armour worn (InventoryScreen.WornArmor: the character sheet's pieces flagged Worn; Wear / Take off, see Armour in World.md). Selecting a camp intel makes it the one Sell intel / Post bounty posts (RaidBoardView.Intel).
The bag is arranged by hand (2026-11-27). An item is dragged (pressed on, moved more than the tap threshold in any direction, let go: a bag slot is a VrWidgets.IDragScroll with AnyDirection, so VrWidgets.Touch of both rigs carries it; its picture follows the pointer): onto the character it is worn or held (in use already: taken off, put away; the same as two presses, InventoryScreen.QuickAction), onto another slot it takes that place (the others shift), onto a pouch's tab it goes there, onto the bin it is picked to destroy. A press selects.
The bin: pressed, the items pressed after are picked (red, never one in use); pressed again it asks (Destroy 2 for good? Press again); again, they are destroyed; pressed with nothing picked it stops.
A quest's gift in use for its quest is refused by the bin, server side, with "InventoryItem.Bound, ItemBinding; Gifts are bound in Quests.md). No Wear, Hold, Take off nor Destroy button any more.
Pouches and order are a BagLayout (Shared.Contracts/BagApi.cs: the bag first, then the named pouches, each a list of item ids; rules and changes in BagLayoutRules: Normalize, Move, Add, Rename, Remove, Sort, at most 5 pouches of 14 characters): only an arrangement, the items stay the character's inventory. The client puts the sheet's inventory in that order once (Bag.Arrange), so a slot is still an index of the inventory and a pouch a run of it (Bag.Range); each change shows at once and is saved (POST /api/bag-layout → the DbWorker's Character.BagLayout column, checked by BagLayoutRules.Validate on both; the sheet brings it back: CharacterSheet.Bag). An item the layout does not list (just forged) is at the end of the bag; an id that is no item is dropped. Sort by value uses Bag.Value: what a forged piece's recipe costs bought whole with the smith's fee, an intel's suggested price (a guide: nothing buys a forged piece yet).
VrWidgets holds the 3D pieces. A ClickableBox reacts to a laser: lighter and slightly raised while pointed (with a light haptic tick), darker and pushed into the screen while pressed (it acts on press and comes back up on release). The right stick up / down scrolls what the right laser points at (VrWidgets.Scroll: the first IScrollable from the pointed collider up, e.g. a UiScrollList and its rows), one row then on while held; meanwhile it does not turn the player. VrWidgets.SyncColliders takes hidden widgets off the laser's collision layer. A box can be disabled (Enabled: dim, its click does nothing), draws its face's parts under Content (they sink with it), and hears where it is pointed while pressed (PointerAt, called by both rigs: a slider follows the laser or the mouse).
Stations (StationController, Client.Core StationTracker): the forge and the arena are not tabs of the menu but screens of their own (ForgeStationView, ArenaStationView, built from the kit), the arena's opening by itself when the player comes near (12 m of its middle), in its middle, 4× the menu's size and turned to the player; the forge's and the barber's (the Weaver's) open only on a click (2026-11-29, StationController.OpenOnClick, StationTracker.Open, from NpcController: Borin, the Weaver; a training dummy's small screen too, TrainingController.OpenOnClick), on the left of the NPC, farther out the wider the screen (StationPlacement.BesideNpc/BesideDummy: its body, a gap, half its width), turned towards the player as they were at the click, and closing when the player walks away (6 m of the forge's spot or the barber's, Rules.StationKeepMargin more); the arena's closes Rules.StationKeepMargin (3 m) farther and stays closed once closed (X) until the player leaves and comes back, and hides during the player's fight. Their buttons work, and the servers accept their use, as far as the screen stays open (the same margin). The lasers and the mouse reach StationPlacement.PointerReach (20 m). The choices stay in RaidBoardController; the arena's Last fights come from GET /api/arena/fights (the ApiServer reads them from the Telemetry service, the caller's only).
UI kit (Scripts/Ui, see UI kit): widgets built on ClickableBox (button, switch, choice, stepper, slider, text field, keyboard, tabs), stacks and grids that place them, screen and menu templates, texts fitted to their box and read from Loc (Client.Core). Players' and mobs' nameplates (Nameplate) are a template of the kit too.
VrRig has a laser on each hand (only drawn while it touches a menu); the trigger of that hand presses what it points at. On a desktop the mouse does the same (DesktopRig): freed while the menu is open, a ray from the camera through the cursor lights the button under it, a left click presses it, the wheel scrolls a ScrollArea; Space still fires. With hand tracking (OpenXR hand_interaction_ext profile: pinch = trigger, grasp = grip), a short pinch of a free hand (no blaster, laser not on a menu, palm towards the eyes) opens or closes the menu (PinchMenuGesture). The two blasters hang on a belt 0.42 m under the eyes (BeltHold.BelowHead). The headset keeps the double pinch (Virtual Desktop menu on the left hand, Quest menu on the right), so a pinch only counts after 0.35 s without a second one, and a pinch held longer than 0.5 s is not a tap.
The DEV tab (shown only with the DEV role, GameMenu.IsShown) has Dev locomotion, the values Speed (walking and flying), Run speed, Jump, Glide speed, Glide accel, Glide hover and Swim (numbers, MenuValue, − / +; their help is on the right screen), a Biomes list (go to the nearest dry spot of one), then Set level, Set gold and Go to camp: each asks a number on a keypad (VrNumpad, a reusable widget standing where the right screen does). Typing rules: NumberEntry (Client.Core). Set gold asks an amount and its unit (2026-11-28: the gold grows ×1.08 a level): a list beside the display (none, K, M, G, T, aa… up to DevRules.MaxGold, NumberEntry.WithUnits), a decimal point allowed (2.5 and M is 2 500 000, shown under it), sent as DevCommandMsg.Amount. The answer comes back as a notification.
With hand tracking the rig reads the pinch strength itself (PinchDetector: closed at 0.7, open again under 0.35), and a pinch that starts up to 0.25 s after the laser left a button still presses it (the fingers move the ray down). The menu pinch needs the palm towards the eyes (HandGestures.PalmFacesEyes, from the OpenXR palm joint; without joint data it is not checked).
A hidden menu takes its colliders off the laser's layer (GameMenuVr.OnHidden): before, the invisible menu caught the laser in front of the login menu after a log out.
Texts are English only; the language choice is planned in Localization.md.
Sounds
- Files: synthesised by
Tools/SoundForge(see Sounds inDevelopment.md), inApps/Client/Assets/Sounds. Most are cut from CC0 recordings (Tools/SoundForge/Sources, see Sounds inDevelopment.md): the interface, the blasters' shots and charge, the explosions, being hurt, the steps (six versions), the jump and landing, the forge, a level, gold, death and life. Still placeholder beeps:hit_mob,splash,overheat_beep; still silent: the glide's air, the platforms' machines and the wind (no recording for them yet:Todo.md). Each play varies a little: another version when the sound has several, its pitch and volume nudged (Client.Core/SoundVariety). The hooks below are in place. - Player (
Sfx, one per game): three buses under the master, each with its volume in Options > Audio (MenuValue.Volume*, saved in the settings): Effects, Interface, Ambience. The players are pools (12 in the head, 24 in the world): no node made per sound. A sound in the world (Sfx.At) is heard from where it happens (AudioStreamPlayer3Dunder the world root; the camera, the headset's in VR, listens); the player's own and the interface's are in the head. - What plays:
- the blasters: the trigger's press (
charge_start), a hum while charging whose pitch rises with the charge, the shot by its look (Sfx.ShotOf: standard, sniper, rapid, heavy, laser; a better rank a little lower, each shot a little different), beeps faster and faster as it overheats, the explosion, an empty click without ammo or magic; - the others' shots where they are fired, a goblin's throw; a mob or another player hit where they are; a shot stopping on the ground; a heavy shot's burst;
- the local player's state (
Client.Core.SoundCues, tested): footsteps (one every 0.75 m walked on the ground, 1.1 m running), a jump, a landing (louder the harder), a splash into deep water, a level, gold gained, becoming a ghost and alive again, the air rushing past while gliding or falling (louder and higher with the speed); being hurt; - the world: the moving platforms' machines (a loop on each), the forge making an item, the wind everywhere (the ambience, slowly swelling);
- the interface: a button pointed at and pressed, the menu opening and closing, a notification.
- the blasters: the trigger's press (
- Later: music and realistic ambiences (libraries or tools, with their licences in a credits file), footsteps, the mobs' voices.
Voice
Proximity voice (protocol 49), relayed like the VR bodies, never decoded by a server:
- Client (
VoiceController,Client.Core/VoiceCodec): the microphone (AudioStreamMicrophoneon a muted Mic bus, read by anAudioEffectCapture; it runs only while the microphone is on, in the game; read every 10 ms on its own thread, the detector and Opus with it, the slices handed back to the main thread to be sent: reading the capture waited on the audio thread up to 17 ms, 2026-12-01) is resampled to 16 kHz mono and cut in 40 ms slices (VoiceRules); a detector sends only while the player speaks (louder than the microphone's sensitivity of Options > Audio, −42 dBFS by default, plus 400 ms after and the slice before), each slice encoded with Opus (Concentus, 16 kbit/s, ≈2 kB/s while speaking). A voice heard comes out of the speaker's head (anAudioStreamPlayer3Dunder its view, on the Voices bus with its own volume), fed by its own decoder (up to 2 lost slices filled in, a late one dropped); more than 0.25 s queued, a slice is dropped so the voice never lags, 60 ms of silence before it starts again for the slices that come late. - Servers: the Gateway checks the slice (its size; nothing from a player whose microphone is off) and sends it to the player's GameServer, which sends it at once to the Gateways following its cell with where the speaker stands (
CellVoice, unreliable). Each Gateway gives it to its clients following that cell within 30 m (VoiceRules.Radius), not the speaker, not one deafened, the loudest few each (VoiceInterest:VOICE_MAX_STREAMS, 8 by default, a voice keeps its place while it speaks). Rate limit: 50 slices per second. - State: the microphone off and the voices off (Options > Audio) are sent to the servers (
VoiceState): the others see a microphone or a headset crossed out over the player (EntityMeta.MicOff,Deafened); nothing shows when both are on. A deafened client gets no voice. - Testing and seeing it (2026-11-27): Options > Audio starts with the microphone's rows: Test my microphone captures it (sent to the others only when the microphone is on) and shows a meter under it, its level (−60 to 0 dB) green when the detector hears the voice at the sensitivity's threshold (
MicMeter: "−32 dB: your voice is heard", "too quiet (threshold −42 dB)", "no sound from the microphone"). In the Players tab a note ♪ comes before the name of who speaks now (a voice heard within 0.4 s,VoiceController.IsSpeaking; the player itself while its detector hears it), in the near list and the party's, redrawn when someone starts or stops (SpeakingVersion). - Channel: every slice carries a channel byte (0: proximity) for the party, guild and NPC voices to come.
Players tab
The menu's Players tab (Client.Core/PlayersScreen, GameMenuVr.Players.cs, protocol 50):
- The list: the players within 20 m, nearest first (name, level, distance; muted or blocked after it), then the players blocked who are not near, to unblock them. The one picked shows on the right screen.
- Volume and mute: this player's own, for that player's voice (0 to 200 %, by 10 %), kept in the settings file by character id (
VoicePrefs,audio/voice_prefs); nobody else knows. - Block: both ways, the whole account: neither hears the other's voice, whatever character either plays. The Gateway asks the DbWorker (
POST /db/accounts/{id}/blocks, tableBlocks: one row per account blocked, with the character blocked then and its name), sends the client its list (VoiceBlocks) and the GameServer sends the block to the Gateways following the blocker's cell (CellVoiceBlock), so the other player's Gateway stops relaying at once. At login the Gateway reads the account's blocks both ways with the character (CharacterDto.Blocks); each voice slice carries the speaker's account (CellVoiceMsg.SpeakerAccount, never sent to a client) and is not given to a listener whose account blocked it or was blocked by it. The name and the avatar stay visible. - Report: a reason (harassment, hate, cheating, offensive name, spam, other) and a text typed on the keyboard (up to 500 characters), sent through the Gateway (
ReportPlayer) to the DbWorker (POST /db/reports, tableReports, with the reporter, the target, both accounts and names, where the reporter stood); at most 10 an hour per account. The team reads them in the Monitor's Reports page (GET /db/reports) and marks them handled. A notice comes back only when it could not be saved. - Rate limit: blocks and reports together, 4 at once then one every 5 s (
ClientRateLimiter.Social). - Pointing at a player (
Client.Core/PlayerPointGesture,PlayerPointController): an empty hand (holding no blaster; desktop: the view's centre) aims at a player within 3 m and holds the trigger (desktop: the right mouse button) 3 s; a ring (UiRing) fills over its head, the hand buzzes at each quarter; then the menu opens on the Players tab with that player picked. Looking away a quarter of a second is forgiven; letting go starts again. - Dictation (
Client.Core/Dictation,WhisperSpeech): the report keyboard's microphone key listens (the key turns red; nothing is sent to the players around meanwhile), pressed again it writes what was said into the text, in the game's language. The engine is local (Whisper base, whisper.cpp through Whisper.net, on the processor): its model (ggml-base-q5_1.bin, 57 MB) is downloaded once from Hugging Face into the player's folder (user://speech) the first time; nothing said leaves the PC. 30 s at most a time. BehindISpeechToText, so a server's engine can take its place on a headset too weak for it. - Later: the party.
Friends
Between accounts, like the blocks (Client.Core/FriendsScreen, FriendsController, ApiServer Friends.cs, DbWorker FriendEndpoints, table Friendships: one row per pair, the asker first, accepted or not; at most 100 friends and requests an account):
- Ask: in the Players tab, a player near picked, Add as a friend: only a player in the game (the Gateways' presence in Redis), not one blocked either way. Asking a player who already asked makes both friends at once.
- Answer: the Friends list of the tab (beside Near) shows the requests got (Accept / Refuse), the friends (in the game first: by the character they play now, else the one played last; Remove), the requests sent (Take back). A friend near is marked friend in the Near list; its row's button says Your friend.
- Notices: the client reads the list when the game starts and every 30 s (
GET /api/friends), and says when a request came or was accepted. - Party: an online friend can be invited from its row (see Party).
Terms of use
Accepted in the game before playing, again at each new version (TermsRules.Version): see Terms.md.
Anti-spam and instant notices
- Instant notices: the ApiServer publishes each change in Redis (
{prefix}:social,Server.Core/Party/SocialLimits.cs:ISocialNotifier): a friend request, an answer, an invitation, a member come or gone, the lead, the mode. Every Gateway is subscribed and sendsSocialPingto the players it has; their client reads its friends or its party again at once (FriendsController,PartyController), so the notice shows within a moment. The 5 s / 30 s reads stay as a fallback. - Anti-spam (
SocialLimits, counts in Redis for an hour:asks:{kind}:{from}:{to},asks_all:{kind}:{from}): a player asks the same player at most 3 times an hour (friend requests and party invitations apart), and at most 20 friend requests and 30 invitations an hour in all; beyond, the ApiServer answers 429 ("… does not take your requests for now", "Too many requests this hour"). An accepted request starts the pair again. From the 3rd request of the hour, the one asked sees "(3 times)" on the row and a third button, Refuse and block (the request refused, the player blocked: no voice either way, no more requests nor invitations). - Blocks: a block either way also refuses a party invitation (as it already did a friend request).
Party
Players playing together, any number (Server.Core/Party: PartyRules, PartyService, PartyStore; ApiServer Party.cs; Gateway PartyRelay; client PartyScreen, PartyController):
- Where it lives: in Redis, shared by the servers (
party:{id}: its members in the order they joined, its mode, its leader;party_of:{characterId};party_invites:{characterId}, 5 min (2 before 2026-11-27); the invited player sees it as a panel in front of it for 30 s, a friend request too (MessageKind.Social), and answers there: Accept, Refuse (SocialAsk,GameMessages.Answer; since 2026-11-28, before only in the Players tab);party_lock:{id}: one change at a time). A party expires 3 min after its last read by a member in the game: the members stay in it while logged out, it goes when none is in the game. - Invite: a player near (or a friend in the game) from the Players tab, Invite to the party: only a player in the game (the Gateways' presence). The caller's party is made then if it has none. An invitation while already in a party says so: accepting leaves the old one.
- Lead: by default everyone leads (invite, put out, change the mode); Everyone leads off: only the leader, who can give the lead; when the leader leaves, the next member in the line leads. No size limit.
- The list (the tab's Party): the invitations (Join this party / Refuse), the members (the leader marked ★ with one leader; in the game: level and distance; else away), the player itself (Leave the party, the mode). The client reads it every 5 s (
GET /api/party): notices when someone invites, joins or leaves. - Voice: each Gateway reads its players' parties every 2 s (
party_of) and sends the party with each slice (PlayerVoice); the GameServer sends a party member's slice to every Gateway too (PartyVoice), which give it to their members of that party at any distance (not deafened, no block between them, the loudest few), and the proximity path skips them (no slice twice). The client plays a member's voice at its head when it is shown within 30 m, else as a radio (in the head, a Radio bus with a band-pass and a little grit, under the voices' volume). - Speak and listen (protocol 55; the Players tab's left screen, Voice): with Near picked, Speak and Listen for the players near (30 m); with Party, for my party (in one); all ticked by default (
VoiceCuts, rules inVoiceCut, tested). Options > Audio's microphone off and voices off still cut everything. The near ones are kept on the PC (Settings.NearCuts) and count everywhere; the party's are kept with the member in the party record (POST /api/party/voice,PartyMemberDto.Cuts): found again after a new login, gone when it leaves the party (all on again; its Gateway drops them too once the member has no party). The client sends them to its Gateway at once (VoiceStateMsg.Cuts), which routes by them: the speaker's Gateway sends the slice to the players near and / or to the party (PlayerVoice: its party, 0 when cut, and whether the near ones hear it), each listener's Gateway skips the channels it cut. A member near is heard by either channel: with the party's cut, it comes as a player near (VoiceCut.HearsNear), never twice. The others see an icon only when they no longer hear the player or it no longer hears them (VoiceCut.Shownover its head, fromEntityMeta.Cuts; a member's list row says radio cut, its page what it cut). The changes are telemetry events (mic_off... withnearorpartyindetail).--party-test(bots) checks the routing. - Map: the other members in the game are green squares on the map (their place from the list).
- Join: a member's Join: the Gateway checks both are in the same party and the other is in the game (its place from the presence), the joiner's GameServer checks it is no ghost, not anchored nor fought by a mob, and that the other is no ghost nor fought (when it is on that server), then puts it 2 m from it on dry ground clear of obstacles (
PartyJoin.SafeSpot); no cooldown; a refusal is a notice. The handoff takes it to the other's server.
Threading
- GameServer: Godot calls
GameServerHost.Tickfrom_PhysicsProcess(30 Hz). Network polling, simulation and sends all happen there. The heartbeat loop and the DbWorker saves are async; their results go through a queue applied at the next tick. Game events (ISimulationOutbox.GameEvent: a special attack, a death) are queued forTelemetrySender, sent every second from another thread (Telemetry.md). - Gateway: one loop thread polls both
NetManagers (clients, GameServers) and drains its queue (JWT validation, character load, cell claims are async). - Client:
GameConnection.Pollis called from_Process.
Raid board
sequenceDiagram
participant C as Client
participant G as Gateway
participant S as GameServer
participant R as Redis
participant A as ApiServer
participant D as DbWorker
participant O as Orchestrator
C->>G: ScoutCamp
G->>S: PlayerScout
S->>R: SET camp_lock NX (15 min)
S->>D: add CampIntel
S-->>C: ScoutResult
C->>A: POST /api/contracts, /join (HTTPS, token)
A->>R: online:{id} (safe zone), extend camp_lock (60 min)
A->>D: contract, gold (one transaction)
loop every second (LobbyTicker)
A->>R: who is online, countdown
A->>O: reserve the camp, then start the raid
A->>O: lobby notices
end
O-->>S: RaidStarts (heartbeat answer)
O-->>G: Teleports, Notices (heartbeat answer)
G->>S: RaidTeleport
S-->>C: Correction, RaidLives
S->>R: defeated_camps (30 min)
S->>A: notify-defeat / notify-failed (worker key)
- Redis keys (
Server.Core/Raids/CampStore, prefixnexusoffates:):camp_lock:{campId}(scout id, 15 then 60 min),defeated_camps:{campId}(30 min),online:{characterId}(x,z,level, 15 s, refreshed by the Gateways every 5 s),raid:{campId}(the camp's GameServer confirms a raid runs),lobby_countdown:{contractId}. A GameServer readsdefeated_campsfor the camps it gets, so a camp beaten on another server stays empty. - PostgreSQL:
Characters.Gold(100 at the start) andCharacters.Inventory(jsonb list ofInventoryItem), tableCampContracts. The DbWorker moves gold only inside serializable transactions with the contract (purchase, escrow, payout, refund); a GameServer save never touches gold or inventory. A transaction Postgres refuses (40001 serialization failure, 40P01 deadlock: a quest's reward racing the character's save) is run again whole, up to 5 tries (SerializedinApps/DbWorker/RaidBoardEndpoints.cs), then answered 409. A DbWorker route built from a contract's format string (/db/characters/{0}/…) is mapped throughstring.Format(route, "{id:int}"), never as it is (its parameter would be named0, every call a 400; checked byDbWorkerRouteTests). - ApiServer:
GET /api/character,GET|POST /api/contracts,POST /api/contracts/{id}/join(bearer token, online and in the safe zone); internalPOST /api/contracts/notify-defeatandnotify-failed(headerX-Worker-Key).LobbyTicker(every second): start conditions (RaidBoardRules.WhyNotReady), countdown, start, expiry. - Orchestrator:
POST /api/camps/{id}/reserve,POST /api/raids/start,POST /api/notices; the commands ride on the next heartbeat answer of the instance concerned (HeartbeatResponse.RaidStarts,Teleports,Notices). They are part of the saved state (ClusterSnapshot): a new leader delivers what its predecessor had not. On top of that a contract becomesRunningonly once the GameServer has writtenraid:{campId}; without it within 5 s the ApiServer asks again (a GameServer that already runs the same raid keeps it and confirms again), and after 3 tries the lobby opens again. - Settings: GameServers and Gateways get
REDIS_URLandAPI_URL(Orchestrator:InstanceEnv); the ApiServerRedis:Connection. Without Redis each process keeps its own memory store: fine for tests, not for a cluster.
Persistence
- Accounts:
Accountstable, username unique case-insensitive, password hashed with ASP.NET Core Identity'sPasswordHasher,Roles(text[], e.g.DEV, see below). - Roles: given from the Monitor (Players, Grant DEV, Grant Bot:
PUT /db/characters/{id}/roleson the DbWorker); the Bot role also by the admin-key routes that make test and bot accounts (see Roles inSecurity.md). What each allows is decided in one place,Server.Core.DevRights: Bot has the DEV moves and the commands on the character (level, speeds, a camp or biome teleport, mob aggro off), not the admin ones (gold, items), not the DEV tab (AuthResultMsg.Bot,PlayerStateMsg.Bot;EntityMeta.Bot: a "[bot]" tag over its name). The Gateway reads them with the character at each login, so a new role applies at the next login.- DEV shows the DEV tab (the Gateway tells the client in
AuthResultMsg.Dev) and lets a player fly and move at any speed (the Gateway puts the role inPlayerStateMsg.Dev; the GameServer acceptsInputMsg.Devmoves only with it,PlayerSystem.ApplyInput) and use the developer commands of the DEV tab: the Gateway refusesDevCommandwithout it, sets the gold itself through the DbWorker (POST /db/characters/{id}/gold, in a transaction; a GameServer never touches gold) and sendsPlayerDev(level, go to a camp) to the player's GameServer. Limits inDevRules(Shared.Gameplay).
- DEV shows the DEV tab (the Gateway tells the client in
- Characters:
Characterstable (position, HP, level, XP, kills,Version). The GameServer saves every 30 s when changed and when the player leaves. A save carries the version it loaded; the DbWorker refuses an old version (409). After a GameServer crash the next owner may hit a conflict: it logs it and writes its live state with the current version. - Live state (who owns which cell, which instances run) is saved in Redis by the leading Orchestrator; a restarted or standby replica goes on with it (
Docs/Orchestrator.md). Who is online comes back with the next heartbeats.
Known limits (v1)
- One Orchestrator decides at a time (leader); a standby takes over in ~5 s, during which cells are not reassigned (players keep playing).
- A player logged in on two Gateways at once is not refused: its GameServer gives the entity to the newer connection (see Connection lifecycle); the older client stays connected to its Gateway, without a player, until it times out.
- During a player's grace (60 s after a lost connection) its Gateway no longer marks it online: another character of the same account can log in meanwhile.
- Fighting across a cell border owned by another server is ignored (the target must be on the same GameServer).
- World changes (harvested resources, buildings) are not a feature yet; the terrain is fully computed.