Files
dflike/CLAUDE.md
Andy b94ad32806 feat: viewport modes, configurable server URL, deployment docs
- Add follow mode (F key) to cycle camera between NPCs
- Make server URL configurable via VITE_SERVER_URL env var
- Add comprehensive README with Debian LXC deployment guide
- Add character sprite assets to repo
- Add design docs and implementation plans

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:25:53 -05:00

1.6 KiB

CLAUDE.md

Project

Multiplayer NPC simulation game (Dwarf Fortress-inspired). Server-authoritative ECS architecture.

Structure

  • shared/ -- Types and constants (no runtime code)
  • server/ -- Node.js + Socket.io game server with ECS
  • client/ -- Phaser 3 + TypeScript renderer
  • chars/ -- Character sprite assets (do not modify)
  • docs/plans/ -- Design and implementation docs

Commands

  • npm install -- install all workspace dependencies
  • npm -w server run dev -- start server (port 3001)
  • npm -w server run test -- run server tests (22 tests)
  • npm -w server run test:watch -- run server tests in watch mode
  • npm -w client run dev -- start client dev server (port 3000)
  • npm -w client run build -- build client for production

Tooling

  • ESM modules throughout ("type": "module")
  • Server: tsx (runtime), vitest (tests)
  • Client: vite (bundler), Phaser 3
  • Shared: compiled to shared/dist/ (auto-built)

Key Entry Points

  • server/src/main.ts -- server startup
  • server/src/game/GameLoop.ts -- tick loop orchestration
  • client/src/main.ts -- Phaser game bootstrap
  • client/src/scenes/GameScene.ts -- main game scene
  • shared/src/types.ts -- protocol types
  • shared/src/constants.ts -- game constants

Key Conventions

  • ECS components are plain data objects, systems are pure functions
  • Server owns all game state; clients are renderers
  • Character sprites are 48x48 per frame, 6 cols x 4 rows spritesheet layout
  • Compositing: skins + accessories layered in z-order, cached as single textures
  • Shared types ensure client/server protocol agreement
  • Systems run in order: needsDecay -> npcBrain -> movement -> broadcast