Terminology glossary and system architecture map. Shows how Claude and the codebase understand game concepts.
System Architecture Map
┌─────────────────────────────────────────────────────────────────┐
│ CLIENT (Browser) │
│ │
│ index.html ──► js/main.js (game loop, state machine) │
│ │ │
│ ┌────────────┼────────────┬──────────┬──────────┐ │
│ ▼ ▼ ▼ ▼ ▼ │
│ js/engine/ js/player/ js/ui/ js/net/ js/engine/ │
│ renderer.js player.js hud.js api.js combat.js │
│ world.js camera.js inventory autosave enemy.js │
│ physics.js chat.js loader.js │
│ input.js menu.js │
│ │
│ WebSocket ◄──► js/net/multiplayer.js │
└─────────┬───────────────────────────────┬───────────────────────┘
│ REST API │ WebSocket (port 8081)
▼ ▼
┌─────────────────────┐ ┌──────────────────────────────┐
│ PHP 8.4 Backend │ │ Node.js WS Server │
│ │ │ server/ws-server.js │
│ api/auth.php │ │ │
│ api/player.php │ │ - Player position sync │
│ api/inventory.php │ │ - Server-side enemy AI │
│ api/world.php │ │ - PvE/PvP combat │
│ api/database.php │ │ - Chat relay │
│ api/config.php │ │ - Admin broadcasts │
└────────┬────────────┘ └──────────────┬───────────────┘
│ │
▼ ▼
┌─────────────────────────────────────────────────────────┐
│ MySQL 8.4 Database │
│ │
│ users ──► characters ──► inventory │
│ │ │
│ items ◄─────────────────────┘ │
│ │ │
│ ├──► abilities (left/right click links) │
│ └──► shop_items (price = item_id + amount) │
│ │
│ enemies ──► loot_tables ──► items │
│ npcs ──► shop_items │
│ npcs ──► npc_quests ──► quests ──► quest_progress │
└─────────────────────────────────────────────────────────┘
Item ↔ Ability Linking
items.left_click_ability_id ──► abilities.id (M1 action)
items.right_click_ability_id ──► abilities.id (M2 action, fallback to M1)
Final damage = ability.properties.damage + item.properties.damage
Final cooldown = ability.cooldown / item.properties.speed
Final range = ability.size + item.properties.range