# maxnest0x0/rysteria architecture

> Architecture diagram of the GitHub repository maxnest0x0/rysteria, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maxnest0x0/rysteria
- Repository: https://github.com/maxnest0x0/rysteria

## Overview

Rysteria is a multiplayer game with a browser/native client, authoritative game servers, and a JavaScript master server for account and server coordination. The main player workflow runs from client input through a live game-server session and back to client rendering; the server also simulates game state and manages squads. The tree identifies UI, persistence, and shared game-model layers. Sampled excerpts are partial, so some subsystem connections—especially master-server dispatch and unsampled game systems—are intentionally left unwired. The map editor and rarity balancer are separate tools.

Main entry points: [`Client/Main.c`](https://github.com/maxnest0x0/rysteria/blob/master/Client/Main.c) (Client runtime), [`Server/Server.c`](https://github.com/maxnest0x0/rysteria/blob/master/Server/Server.c) (Session server), [`MasterServer/main.js`](https://github.com/maxnest0x0/rysteria/blob/master/MasterServer/main.js) (Master service), [`Client/Socket.c`](https://github.com/maxnest0x0/rysteria/blob/master/Client/Socket.c) (Network socket)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Game client"]
  node_clientmain["Client runtime<br/>[Main.c]"]
  node_input["Input capture<br/>[InputData.c]"]
  node_game["Game state<br/>[Game.c]"]
  node_clientsim["Client simulation<br/>[Simulation.c]"]
  node_renderer["Rendering"]
  node_ui["Game interface"]
  node_socket["Network socket<br/>[Socket.c]"]
  node_storage["Account cache<br/>[Storage.c]"]
end

subgraph group_server["Game server"]
  node_servermain["Server entry<br/>[Main.c]"]
  node_server["Session server<br/>[Server.c]"]
  node_serverclient["Client sessions<br/>[Client.c]"]
  node_serversim["World simulation<br/>[Simulation.c]"]
  node_squads["Squad management<br/>[Squad.c]"]
  node_updateproto["Update protocol<br/>[UpdateProtocol.c]"]
end

subgraph group_shared["Shared game model"]
  node_sharedcomponents["Entity components"]
  node_sharedapi["Shared protocol<br/>[Api.c]"]
end

subgraph group_coordination["Accounts and coordination"]
  node_master["Master service<br/>[main.js]"]
  node_gameclient["Game connection data<br/>[client.js]"]
end

subgraph group_tools["Game tools"]
  node_mapeditor["Map editor<br/>[app.js]"]
  node_balancer["Drop balancer<br/>[index.js]"]
end

node_player(("Player"))
node_browserstore[("Browser storage")]
node_rivet["Rivet services"]
node_tooluser(("Tool user"))

node_player -->|"plays"| node_clientmain
node_clientmain -->|"captures input"| node_input
node_clientmain -->|"runs client"| node_game
node_clientmain -->|"runs simulation"| node_clientsim
node_clientmain -->|"renders with"| node_renderer
node_clientmain -->|"presents interface"| node_ui
node_clientmain -->|"connects through"| node_socket
node_clientmain -->|"caches account"| node_storage
node_storage -->|"reads and writes"| node_browserstore
node_socket -->|"exchanges game data"| node_server
node_servermain -->|"initializes and runs"| node_server
node_server -->|"manages sessions"| node_serverclient
node_server -->|"runs world simulation"| node_serversim
node_server -->|"handles squad requests"| node_squads
node_server -->|"encodes updates"| node_updateproto
node_serversim -->|"updates entities"| node_sharedcomponents
node_updateproto -->|"serializes state"| node_sharedcomponents
node_server -->|"uses protocol"| node_sharedapi
node_master -->|"creates connection data"| node_gameclient
node_master -.->|"calls service API"| node_rivet
node_tooluser -->|"edits maps"| node_mapeditor
node_tooluser -->|"tunes drop rates"| node_balancer

click node_clientmain "https://github.com/maxnest0x0/rysteria/blob/master/Client/Main.c"
click node_input "https://github.com/maxnest0x0/rysteria/blob/master/Client/InputData.c"
click node_game "https://github.com/maxnest0x0/rysteria/blob/master/Client/Game.c"
click node_clientsim "https://github.com/maxnest0x0/rysteria/blob/master/Client/Simulation.c"
click node_renderer "https://github.com/maxnest0x0/rysteria/tree/master/Client/Renderer"
click node_ui "https://github.com/maxnest0x0/rysteria/tree/master/Client/Ui"
click node_socket "https://github.com/maxnest0x0/rysteria/blob/master/Client/Socket.c"
click node_storage "https://github.com/maxnest0x0/rysteria/blob/master/Client/Storage.c"
click node_servermain "https://github.com/maxnest0x0/rysteria/blob/master/Server/Main.c"
click node_server "https://github.com/maxnest0x0/rysteria/blob/master/Server/Server.c"
click node_serverclient "https://github.com/maxnest0x0/rysteria/blob/master/Server/Client.c"
click node_serversim "https://github.com/maxnest0x0/rysteria/blob/master/Server/Simulation.c"
click node_squads "https://github.com/maxnest0x0/rysteria/blob/master/Server/Squad.c"
click node_updateproto "https://github.com/maxnest0x0/rysteria/blob/master/Server/UpdateProtocol.c"
click node_sharedcomponents "https://github.com/maxnest0x0/rysteria/tree/master/Shared/Component"
click node_sharedapi "https://github.com/maxnest0x0/rysteria/blob/master/Shared/Api.c"
click node_master "https://github.com/maxnest0x0/rysteria/blob/master/MasterServer/main.js"
click node_gameclient "https://github.com/maxnest0x0/rysteria/blob/master/MasterServer/client.js"
click node_mapeditor "https://github.com/maxnest0x0/rysteria/blob/master/MapEditor/app.js"
click node_balancer "https://github.com/maxnest0x0/rysteria/blob/master/Balancer/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_clientmain,node_input,node_game,node_clientsim,node_renderer,node_ui,node_socket,node_storage,node_tooluser toneBlue
class node_servermain,node_server,node_serverclient,node_serversim,node_squads,node_updateproto,node_browserstore toneAmber
class node_sharedcomponents,node_sharedapi toneMint
class node_master,node_gameclient toneRose
class node_mapeditor,node_balancer,node_player,node_rivet toneIndigo
```

## Components

### Game client

- [Client runtime](https://github.com/maxnest0x0/rysteria/blob/master/Client/Main.c): `Client/Main.c`
- [Input capture](https://github.com/maxnest0x0/rysteria/blob/master/Client/InputData.c): `Client/InputData.c`
- [Game state](https://github.com/maxnest0x0/rysteria/blob/master/Client/Game.c): `Client/Game.c`
- [Client simulation](https://github.com/maxnest0x0/rysteria/blob/master/Client/Simulation.c): `Client/Simulation.c`
- [Rendering](https://github.com/maxnest0x0/rysteria/tree/master/Client/Renderer): `Client/Renderer`
- [Game interface](https://github.com/maxnest0x0/rysteria/tree/master/Client/Ui): `Client/Ui`
- [Network socket](https://github.com/maxnest0x0/rysteria/blob/master/Client/Socket.c): `Client/Socket.c`
- [Account cache](https://github.com/maxnest0x0/rysteria/blob/master/Client/Storage.c): `Client/Storage.c`

### Game server

- [Server entry](https://github.com/maxnest0x0/rysteria/blob/master/Server/Main.c): `Server/Main.c`
- [Session server](https://github.com/maxnest0x0/rysteria/blob/master/Server/Server.c): `Server/Server.c`
- [Client sessions](https://github.com/maxnest0x0/rysteria/blob/master/Server/Client.c): `Server/Client.c`
- [World simulation](https://github.com/maxnest0x0/rysteria/blob/master/Server/Simulation.c): `Server/Simulation.c`
- [Squad management](https://github.com/maxnest0x0/rysteria/blob/master/Server/Squad.c): `Server/Squad.c`
- [Update protocol](https://github.com/maxnest0x0/rysteria/blob/master/Server/UpdateProtocol.c): `Server/UpdateProtocol.c`

### Shared game model

- [Entity components](https://github.com/maxnest0x0/rysteria/tree/master/Shared/Component): `Shared/Component`
- [Shared protocol](https://github.com/maxnest0x0/rysteria/blob/master/Shared/Api.c): `Shared/Api.c`

### Accounts and coordination

- [Master service](https://github.com/maxnest0x0/rysteria/blob/master/MasterServer/main.js): `MasterServer/main.js`
- [Game connection data](https://github.com/maxnest0x0/rysteria/blob/master/MasterServer/client.js): `MasterServer/client.js`

### Game tools

- [Map editor](https://github.com/maxnest0x0/rysteria/blob/master/MapEditor/app.js): `MapEditor/app.js`
- [Drop balancer](https://github.com/maxnest0x0/rysteria/blob/master/Balancer/index.js): `Balancer/index.js`

### Other components

- **Player**
- **Browser storage**
- **Rivet services**
- **Tool user**

## Connections

- Player → Client runtime: plays
- Client runtime → Input capture: captures input
- Client runtime → Game state: runs client
- Client runtime → Client simulation: runs simulation
- Client runtime → Rendering: renders with
- Client runtime → Game interface: presents interface
- Client runtime → Network socket: connects through
- Client runtime → Account cache: caches account
- Account cache → Browser storage: reads and writes
- Network socket → Session server: exchanges game data
- Server entry → Session server: initializes and runs
- Session server → Client sessions: manages sessions
- Session server → World simulation: runs world simulation
- Session server → Squad management: handles squad requests
- Session server → Update protocol: encodes updates
- World simulation → Entity components: updates entities
- Update protocol → Entity components: serializes state
- Session server → Shared protocol: uses protocol
- Master service → Game connection data: creates connection data
- Master service → Rivet services: calls service API
- Tool user → Map editor: edits maps
- Tool user → Drop balancer: tunes drop rates
