How maxnest0x0/gardn works
The gardn is a self-hostable multiplayer PvP game inspired by florr.io. A player configures a mode and loadout, joins a game, sends movement and action input, and receives multiplayer game state rendered in the browser. The server runs game instances and ECS simulation processes for movement, AI, combat, drops and scoring; shared definitions and simulation structures support both sides. The README also documents native and WebAssembly server options, Canvas2D rendering, a custom UI engine, and uniform-grid collision queries. Some client/server wiring is inferred only at subsystem level because those sources were not sampled.
Main entry points: Simulation.cc ECS Simulation · Client/Game.cc Client Game · Server/Game.cc Game Instances · TitleScreen Title Screens
Components 24
Browser Client
- Client Game
Client/Game.cc - UI Engine
Client/Ui - Title Screens
Client/Ui/TitleScreen - In-game UI
Client/Ui/InGame - Input Handling
Client/Input.cc - Client Networking
Client/Network.cc - Game Rendering
Client/Rendering.cc - Canvas Renderer
Client/Render/Renderer.cc - Local Storage
Client/Storage.cc
Game Server
- Game Instances
Server/Game.cc - Client Sessions
Server/Client.cc - Server Tick
Server/Server.cc
Shared Runtime
- ECS Simulation
Shared/Simulation.cc - Entity Model
Shared/Entity.cc - Game Definitions
Shared/StaticData.cc - Map and Arena
Shared/Map.cc
Gameplay Features
- Simulation Processes
Server/Process - Collision Queries
Server/SpatialHashUniform.cc - Damage and Death
Server/EntityFunctions - Entity Spawning
Server/Spawn.cc - Team Management
Server/TeamManager.cc
Other components
- Player
- Browser APIs
- WebSocket Peer
Connections 26
- Player → Title Screens: chooses mode
- Player → Input Handling: sends input
- Title Screens → Client Game: switches mode
- UI Engine → Canvas Renderer: draws UI
- In-game UI → UI Engine: uses layout
- Title Screens → UI Engine: uses layout
- Client Game → Input Handling: handles input
- Client Game → Client Networking: exchanges packets
- Client Game → Game Rendering: renders state
- Game Rendering → Canvas Renderer: draws frame
- Canvas Renderer → Browser APIs: uses Canvas2D
- Client Game → Local Storage: loads and saves
- Local Storage → Browser APIs: uses browser storage
- Client Networking → WebSocket Peer: exchanges packets
- WebSocket Peer → Client Sessions: delivers messages
- Server Tick → Game Instances: ticks instances
- Game Instances → Client Sessions: manages sessions
- Game Instances → ECS Simulation: runs simulation
- ECS Simulation → Entity Model: updates entities
- ECS Simulation → Simulation Processes: runs processes
- ECS Simulation → Collision Queries: queries spatial grid
- Simulation Processes → Damage and Death: applies combat
- Simulation Processes → Entity Spawning: creates entities
- Game Instances → Team Management: manages teams
- ECS Simulation → Game Definitions: uses definitions
- ECS Simulation → Map and Arena: uses map data