Developer
Building on Washiki Washoi. Architecture overview + how-tos for the common extension points.
Architecture at a Glance
Three things to understand before extending:
- The server is authoritative. All gameplay state lives on the server. The client predicts locally for responsiveness, but the server's tick is the source of truth.
- The simulation is shared.
simulation/FPSSimulation.tsruns on client (predicted) and server (authoritative). Identical code, identical config. Drift between them is a bug. - The engine seam. The submodule talks to the engine through documented extension points:
NetworkConnector,GameplayMapLauncher,Pickup(subclass),CommandRegistry,IGameHost. Seegetting-started/project-structure.mdfor the full mapping.
How-Tos
| Page | Covers |
|---|---|
| Adding a Weapon | Defining a new WeaponDef, projectile, HUD slot |
| Adding a Gametype | Subclassing BaseGametype, score/time rules, registration |
| Server Commands | Op commands for dedicated server admins |
Code Conventions
- Singleton pattern throughout.
XYZ.getInstance(). Reset hygiene matters — useresetInstance()in tests. - EventBus for decoupled events. Always store unsubscribe handles.
- No
Game.initializeLocal. Everything goes throughNetworkGameHostnow (since v0.9.15 in the engine). Single-player runs a real dedicated server in-process via the lobby's dev-spawn — see the engine's Map Launching Guide (docs/manual/guides/map-launching.mdin the engine repo). - Submodule edits commit to this repo first, then the outer engine repo bumps the submodule pin. AGENTS.md in the engine repo documents the flow.
Tests
Tests live in __tests__/ directories next to the code they cover. Run from the outer engine repo:
bash
npm test # all tests, including submodule
npm test FPSPickup # filter by name patternThe outer vitest config picks up src/games/fps/**/*.test.ts automatically.
See Also
- The engine's Service Registries (
docs/manual/guides/service-registries.mdin the engine repo) guide — how to add new engine→game injection points - The engine's Pickup System (
docs/manual/guides/pickup-system.mdin the engine repo) guide — Pickup base class hooks