@loonylabs/create-game 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/bin/create-game.js +213 -0
  2. package/package.json +18 -0
  3. package/template/.claude/skills/aigdtk-create-game-stories/SKILL.md +177 -0
  4. package/template/.claude/skills/aigdtk-create-game-stories/story-template.md +85 -0
  5. package/template/.claude/skills/aigdtk-implement-game-stories/SKILL.md +129 -0
  6. package/template/.claude/skills/aigdtk-new-game/SKILL.md +126 -0
  7. package/template/.claude/skills/aigdtk-shared/ascii-grammar.md +133 -0
  8. package/template/.claude/skills/aigdtk-shared/enemies.md +112 -0
  9. package/template/.claude/skills/aigdtk-shared/framework.md +93 -0
  10. package/template/.claude/skills/aigdtk-shared/visuals.md +125 -0
  11. package/template/apps/client/index.html +14 -0
  12. package/template/apps/client/package.json +31 -0
  13. package/template/apps/client/public/assets/audio/enemy_killed.wav +0 -0
  14. package/template/apps/client/src/components/App.svelte +290 -0
  15. package/template/apps/client/src/components/CraftingPanel.svelte +253 -0
  16. package/template/apps/client/src/components/DevPanel.svelte +180 -0
  17. package/template/apps/client/src/components/DungeonClearOverlay.svelte +53 -0
  18. package/template/apps/client/src/components/EquipmentPanel.svelte +191 -0
  19. package/template/apps/client/src/components/HealthBar.svelte +50 -0
  20. package/template/apps/client/src/components/Hub/BackToHubButton.svelte +37 -0
  21. package/template/apps/client/src/components/Hub/ExperienceCard.svelte +115 -0
  22. package/template/apps/client/src/components/Hub/Hub.svelte +88 -0
  23. package/template/apps/client/src/components/Inventory.svelte +174 -0
  24. package/template/apps/client/src/components/Runner/RunnerDeathScreen.svelte +182 -0
  25. package/template/apps/client/src/components/Runner/RunnerHUD.svelte +157 -0
  26. package/template/apps/client/src/components/Shooter/DamageNumbers.svelte +96 -0
  27. package/template/apps/client/src/components/Shooter/GameOverScreen.svelte +109 -0
  28. package/template/apps/client/src/components/Shooter/ShooterHUD.svelte +95 -0
  29. package/template/apps/client/src/components/SkillBar.svelte +146 -0
  30. package/template/apps/client/src/components/ToastSystem.svelte +158 -0
  31. package/template/apps/client/src/game.ts +918 -0
  32. package/template/apps/client/src/input.ts +92 -0
  33. package/template/apps/client/src/lib/audio/CombatDetector.test.ts +59 -0
  34. package/template/apps/client/src/lib/audio/CombatDetector.ts +53 -0
  35. package/template/apps/client/src/lib/audio/MusicManager.ts +137 -0
  36. package/template/apps/client/src/lib/audio/SoundManager.ts +59 -0
  37. package/template/apps/client/src/lib/audio/index.ts +9 -0
  38. package/template/apps/client/src/main.ts +32 -0
  39. package/template/apps/client/src/renderer/basecamp.ts +126 -0
  40. package/template/apps/client/src/renderer/dungeon.ts +250 -0
  41. package/template/apps/client/src/renderer/dungeonPortal.ts +73 -0
  42. package/template/apps/client/src/renderer/dungeonZone.ts +301 -0
  43. package/template/apps/client/src/renderer/entities.ts +197 -0
  44. package/template/apps/client/src/renderer/runnerTrack.ts +221 -0
  45. package/template/apps/client/src/renderer/shaders/SkyShader.ts +190 -0
  46. package/template/apps/client/src/renderer/shaders/TerrainShaderMaterial.ts +133 -0
  47. package/template/apps/client/src/renderer/shaders/floor.frag.glsl.ts +17 -0
  48. package/template/apps/client/src/renderer/shaders/shaderConfig.ts +18 -0
  49. package/template/apps/client/src/renderer/shaders/spawn.frag.glsl.ts +19 -0
  50. package/template/apps/client/src/renderer/shaders/terrain.frag.glsl.ts +314 -0
  51. package/template/apps/client/src/renderer/shaders/terrain.vert.glsl.ts +16 -0
  52. package/template/apps/client/src/renderer/shaders/wall.frag.glsl.ts +20 -0
  53. package/template/apps/client/src/renderer/shooterArena.ts +102 -0
  54. package/template/apps/client/src/renderer/voxelChunkStreamer.ts +79 -0
  55. package/template/apps/client/src/renderer/voxelMesh.ts +86 -0
  56. package/template/apps/client/src/renderer/voxelTerrain.ts +74 -0
  57. package/template/apps/client/src/socket.ts +268 -0
  58. package/template/apps/client/src/store.ts +74 -0
  59. package/template/apps/client/src/style.css +60 -0
  60. package/template/apps/client/tsconfig.json +11 -0
  61. package/template/apps/client/vite.config.ts +10 -0
  62. package/template/apps/client/vitest.config.ts +8 -0
  63. package/template/apps/experiences/diablo/index.ts +94 -0
  64. package/template/apps/experiences/diablo/systems/dungeonClearSystem.ts +60 -0
  65. package/template/apps/experiences/diablo/systems/enemyAISystem.ts +11 -0
  66. package/template/apps/experiences/diablo/systems/entitySyncSystem.ts +80 -0
  67. package/template/apps/experiences/diablo/systems/itemPickupSystem.ts +11 -0
  68. package/template/apps/experiences/diablo/systems/movementSystem.ts +13 -0
  69. package/template/apps/experiences/diablo/systems/physicsSystem.ts +92 -0
  70. package/template/apps/experiences/diablo/systems/transitionSystem.ts +105 -0
  71. package/template/apps/experiences/runner/data/runner-config.ts +54 -0
  72. package/template/apps/experiences/runner/index.ts +143 -0
  73. package/template/apps/experiences/runner/systems/collectibleSystem.ts +157 -0
  74. package/template/apps/experiences/runner/systems/deathSystem.ts +42 -0
  75. package/template/apps/experiences/runner/systems/entitySyncSystem.ts +59 -0
  76. package/template/apps/experiences/runner/systems/obstacleSystem.ts +91 -0
  77. package/template/apps/experiences/runner/systems/runnerPhysicsSystem.ts +82 -0
  78. package/template/apps/experiences/runner/systems/trackStreamSystem.ts +19 -0
  79. package/template/apps/experiences/runner/track/laneSystem.ts +53 -0
  80. package/template/apps/experiences/runner/track/segmentTypes.ts +141 -0
  81. package/template/apps/experiences/runner/track/trackGenerator.ts +292 -0
  82. package/template/apps/experiences/shooter/ai/aiStateMachine.ts +394 -0
  83. package/template/apps/experiences/shooter/ai/lineOfSight.ts +32 -0
  84. package/template/apps/experiences/shooter/arena/arenaGenerator.ts +101 -0
  85. package/template/apps/experiences/shooter/arena/arenaTypes.ts +49 -0
  86. package/template/apps/experiences/shooter/arena/hitscan.ts +101 -0
  87. package/template/apps/experiences/shooter/data/enemy-types.ts +108 -0
  88. package/template/apps/experiences/shooter/data/wave-definitions.ts +40 -0
  89. package/template/apps/experiences/shooter/data/weapon-config.ts +80 -0
  90. package/template/apps/experiences/shooter/index.ts +127 -0
  91. package/template/apps/experiences/shooter/systems/enemyAISystem.ts +113 -0
  92. package/template/apps/experiences/shooter/systems/entitySyncSystem.ts +68 -0
  93. package/template/apps/experiences/shooter/systems/shooterPhysicsSystem.ts +89 -0
  94. package/template/apps/experiences/shooter/systems/waveSpawnerSystem.ts +87 -0
  95. package/template/apps/experiences/shooter/systems/weaponSystem.ts +157 -0
  96. package/template/apps/game-data/src/areas/area-manifest.json +18 -0
  97. package/template/apps/game-data/src/assets/migration.test.ts +291 -0
  98. package/template/apps/game-data/src/audio/music-config.json +21 -0
  99. package/template/apps/game-data/src/audio/sound-config.json +11 -0
  100. package/template/apps/game-data/src/combat/action-types.ts +2 -0
  101. package/template/apps/game-data/src/combat/enemy-def.ts +12 -0
  102. package/template/apps/game-data/src/combat/hitboxes.ts +23 -0
  103. package/template/apps/game-data/src/dungeon/cell-types.ts +20 -0
  104. package/template/apps/game-data/src/dungeon/cell-visuals.ts +13 -0
  105. package/template/apps/game-data/src/dungeon/door-directions.ts +2 -0
  106. package/template/apps/game-data/src/enemies/enemy-defs.json +32 -0
  107. package/template/apps/game-data/src/equipment/slots.json +5 -0
  108. package/template/apps/game-data/src/events/event-defs.ts +20 -0
  109. package/template/apps/game-data/src/events/event-types.ts +10 -0
  110. package/template/apps/game-data/src/events/toast-config.json +49 -0
  111. package/template/apps/game-data/src/items/item-pool.json +13 -0
  112. package/template/apps/game-data/src/loot/item-pool.ts +14 -0
  113. package/template/apps/game-data/src/loot/rarities.ts +2 -0
  114. package/template/apps/game-data/src/physics/dungeon-physics-config.ts +12 -0
  115. package/template/apps/game-data/src/physics/jump-config.ts +17 -0
  116. package/template/apps/game-data/src/recipes/recipe-book.json +68 -0
  117. package/template/apps/game-data/src/rooms/room_basecamp.json +16 -0
  118. package/template/apps/game-data/src/rooms/room_corridor_ew.json +9 -0
  119. package/template/apps/game-data/src/rooms/room_corridor_ns.json +11 -0
  120. package/template/apps/game-data/src/rooms/room_crossroads.json +11 -0
  121. package/template/apps/game-data/src/rooms/room_dead_end.json +10 -0
  122. package/template/apps/game-data/src/rooms/room_staircase.json +12 -0
  123. package/template/apps/game-data/src/rooms/room_start.json +11 -0
  124. package/template/apps/game-data/src/skills/skill-book.json +20 -0
  125. package/template/apps/game-data/src/voxel/biome-terrain.ts +76 -0
  126. package/template/apps/game-data/src/voxel/materials.ts +45 -0
  127. package/template/apps/game-data/src/voxel/sandbox-terrain-config.ts +19 -0
  128. package/template/apps/game-data/src/world/area-config.ts +33 -0
  129. package/template/apps/game-data/src/world/biome-def.ts +15 -0
  130. package/template/apps/game-data/src/world/biomes.json +57 -0
  131. package/template/apps/game-data/src/world/movement.ts +2 -0
  132. package/template/apps/game-data/src/world/overworld-layout.test.ts +93 -0
  133. package/template/apps/game-data/src/world/overworld-layout.ts +127 -0
  134. package/template/apps/server/data/game.db +0 -0
  135. package/template/apps/server/package.json +30 -0
  136. package/template/apps/server/src/areaManager.ts +346 -0
  137. package/template/apps/server/src/db/client.ts +45 -0
  138. package/template/apps/server/src/db/schema.ts +40 -0
  139. package/template/apps/server/src/gameLoop.ts +267 -0
  140. package/template/apps/server/src/gameState.ts +3 -0
  141. package/template/apps/server/src/handlers/actionEvent.ts +55 -0
  142. package/template/apps/server/src/handlers/craftHandler.ts +59 -0
  143. package/template/apps/server/src/handlers/equipHandler.ts +73 -0
  144. package/template/apps/server/src/handlers/raycastHandler.ts +97 -0
  145. package/template/apps/server/src/handlers/skillHandler.ts +87 -0
  146. package/template/apps/server/src/handlers/terraformHandler.ts +74 -0
  147. package/template/apps/server/src/index.ts +597 -0
  148. package/template/apps/server/src/persistence.ts +135 -0
  149. package/template/apps/server/src/rooms.ts +20 -0
  150. package/template/apps/server/src/systems/dungeonPhysics.test.ts +32 -0
  151. package/template/apps/server/src/systems/dungeonPhysics.ts +16 -0
  152. package/template/apps/server/src/systems/enemyAI.ts +129 -0
  153. package/template/apps/server/src/systems/itemPickup.ts +31 -0
  154. package/template/apps/server/src/tests/areaManager.test.ts +77 -0
  155. package/template/apps/server/src/tests/diablo-experience.test.ts +60 -0
  156. package/template/apps/server/src/tests/runner-experience.test.ts +273 -0
  157. package/template/apps/server/src/tests/runner-powerups-scoring.test.ts +221 -0
  158. package/template/apps/server/src/tests/server.integration.test.ts +92 -0
  159. package/template/apps/server/src/tests/shooter-enemy-ai.test.ts +328 -0
  160. package/template/apps/server/src/tests/shooter-experience.test.ts +281 -0
  161. package/template/apps/server/src/tests/voxelChunkCache.test.ts +29 -0
  162. package/template/apps/server/src/tests/voxelSandbox.test.ts +133 -0
  163. package/template/apps/server/src/voxelChunkCache.ts +31 -0
  164. package/template/apps/server/src/voxelPlayerState.ts +23 -0
  165. package/template/apps/server/tsconfig.json +17 -0
  166. package/template/apps/server/vitest.config.ts +8 -0
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: aigdtk-new-game
3
+ description: Start here to create a new game. Leads a structured conversation to capture your game idea, then saves a Game Brief for the next step.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # New Game — Discovery Conversation
8
+
9
+ ## Supporting files (shared knowledge base)
10
+ - Framework reference: [../aigdtk-shared/framework.md](../aigdtk-shared/framework.md)
11
+ - ASCII room grammar: [../aigdtk-shared/ascii-grammar.md](../aigdtk-shared/ascii-grammar.md)
12
+ - Enemy definitions reference: [../aigdtk-shared/enemies.md](../aigdtk-shared/enemies.md)
13
+ - Cell visuals / palettes: [../aigdtk-shared/visuals.md](../aigdtk-shared/visuals.md)
14
+
15
+ Do NOT load these files during the conversation. They are used by `/aigdtk-create-game-stories`.
16
+
17
+ ---
18
+
19
+ <activation CRITICAL="TRUE">
20
+ You are now in game discovery mode. Your role is **interviewer and listener**.
21
+ The human is the game designer. You capture their vision — nothing more, nothing less.
22
+
23
+ ## NON-NEGOTIABLE RULES
24
+
25
+ 1. **NEVER ask technical questions.** No questions about: file formats, schemas,
26
+ ECS, tick rates, area types, JSON, TypeScript, or anything requiring dev knowledge.
27
+
28
+ 2. **NEVER generate any game files.** No code, no JSON, no room layouts.
29
+ This session is for listening and saving — not building.
30
+
31
+ 3. **Ask product questions only.** Any question must be answerable by someone
32
+ who has only ever played games, never made one.
33
+
34
+ 4. **Dig deeper when answers are vague.** If the answer to any question is
35
+ short or unclear, ask ONE follow-up before moving on. Example:
36
+ - "Dark and moody" → "What game or movie has that exact feeling you're after?"
37
+ - "Fast enemies" → "Fast like a cat circling you, or fast like a bullet?"
38
+
39
+ ---
40
+
41
+ ## STEP 1 — Ask exactly these 5 questions, all at once
42
+
43
+ Present them as a numbered list. Do NOT split them across messages.
44
+
45
+ > **Ich habe 5 Fragen zu deinem Spiel — beantworte sie so ausführlich oder knapp wie du möchtest:**
46
+ >
47
+ > 1. Wie heißt dein Spiel?
48
+ > 2. Beschreib den Core Loop in einem Satz — was macht der Spieler die ganze Zeit?
49
+ > 3. Nenn ein Spiel das sich ähnlich anfühlen soll (Stimmung, Tempo, Schwierigkeit).
50
+ > 4. Beschreib einen Feind — wie heißt er, wie bewegt er sich, wie fühlt es sich an gegen ihn zu kämpfen?
51
+ > 5. Wann wärst du zufrieden? Was muss passieren damit du sagst: "Ja, das ist mein Spiel"?
52
+
53
+ Wait for answers. Then follow up on anything vague before proceeding.
54
+
55
+ ---
56
+
57
+ ## STEP 2 — Clarify if needed
58
+
59
+ For each answer that is vague or very short, ask ONE targeted follow-up question.
60
+ Do not bombard with multiple questions at once.
61
+ Do not move to Step 3 until you have enough to paint a clear picture.
62
+
63
+ ---
64
+
65
+ ## STEP 3 — Write the Game Brief
66
+
67
+ Write `docs/aigdtk/game-brief.md` with this exact structure:
68
+
69
+ ```markdown
70
+ # Game Brief: [Spielname]
71
+
72
+ _Generated by /aigdtk-new-game — [heutiges Datum]_
73
+
74
+ ## Dev Answers
75
+
76
+ - **Name:** [Spielname]
77
+ - **Core Loop:** [Core Loop in einem Satz]
78
+ - **Reference Game:** [Referenzspiel]
79
+ - **Enemy:** [Feind-Beschreibung]
80
+ - **Happy When:** [Erfolgs-Kriterium]
81
+
82
+ ## Additional Context
83
+
84
+ [Alle weiteren Antworten aus Nachfragen, freie Form. Leer lassen wenn keine Nachfragen nötig waren.]
85
+
86
+ ## Derived Decisions
87
+
88
+ _Diese Sektion wird von /aigdtk-create-game-stories befüllt._
89
+ ```
90
+
91
+ ---
92
+
93
+ ## STEP 4 — Show summary for confirmation
94
+
95
+ Show the developer a compact summary:
96
+
97
+ > **Hier ist was ich verstanden habe:**
98
+ >
99
+ > 🎮 **[Spielname]**
100
+ > Loop: [Core Loop]
101
+ > Fühlt sich an wie: [Referenzspiel]
102
+ > Feind: [kurze Feind-Beschreibung]
103
+ > Fertig wenn: [Happy When]
104
+ >
105
+ > Passt das so? Dann geht's weiter.
106
+
107
+ Wait for confirmation ("ja", "yes", "ok", "passt", "stimmt", or similar).
108
+ If the developer corrects something, update the Game Brief and show the summary again.
109
+
110
+ ---
111
+
112
+ ## STEP 5 — Handover message
113
+
114
+ After confirmation, output exactly this:
115
+
116
+ ```
117
+ ✅ Game Brief gespeichert: docs/aigdtk/game-brief.md
118
+
119
+ Starte eine neue Claude Code Session und führe aus:
120
+
121
+ /aigdtk-create-game-stories
122
+ ```
123
+
124
+ Nothing else. Do not generate files. Do not explain next steps in detail.
125
+
126
+ </activation>
@@ -0,0 +1,133 @@
1
+ # ASCII Room Grammar — AI Reference
2
+
3
+ Load this file when generating or modifying room_*.json files.
4
+
5
+ ---
6
+
7
+ ## Room File Format
8
+
9
+ Every room is a JSON file in `apps/game-data/src/rooms/`.
10
+
11
+ ```json
12
+ {
13
+ "id": "room_start",
14
+ "ascii": [
15
+ "WWWWWWWWWW",
16
+ "W........W",
17
+ "W...S....W",
18
+ "W........D",
19
+ "WWWWWWWWWW"
20
+ ],
21
+ "tags": ["start"]
22
+ }
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Symbol Map
28
+
29
+ | Symbol | Cell Type | Description |
30
+ |--------|-----------|-------------|
31
+ | `W` | wall | Solid, impassable block |
32
+ | `.` | floor | Walkable ground |
33
+ | `D` | door | Room connection point (must be on outer wall) |
34
+ | `S` | spawn | Player start position |
35
+ | `>` | transition | Transition to another area |
36
+ | `N` | npc | NPC position |
37
+ | `F` | fire | Fire cell (walkable but harmful) |
38
+ | ` ` | empty | No mesh, no collision (void) |
39
+
40
+ ---
41
+
42
+ ## Rules (Critical — violations cause runtime errors)
43
+
44
+ 1. **All rows must be the same length** — pad with spaces if needed
45
+ 2. **Exactly one room must have `"tags": ["start"]`** — this is where players spawn
46
+ 3. **Doors (`D`) must be on the outermost row or column** — doors on interior walls break navigation
47
+ 4. **`S` appears at most once per room** — multiple S cells = undefined behavior
48
+ 5. **Rooms must be fully enclosed** — no open edges (walls or doors only on perimeter)
49
+
50
+ ---
51
+
52
+ ## Tags
53
+
54
+ | Tag | Meaning |
55
+ |-----|---------|
56
+ | `"start"` | Initial spawn room — exactly one room must have this |
57
+ | `"boss"` | Boss encounter room |
58
+ | `"corridor"` | Narrow connecting room |
59
+ | `"treasure"` | Loot room |
60
+
61
+ Tags are used by the dungeon generator to decide room placement.
62
+
63
+ ---
64
+
65
+ ## Room Design Patterns
66
+
67
+ ### Minimal start room (safe default)
68
+ ```json
69
+ {
70
+ "id": "room_start",
71
+ "ascii": [
72
+ "WWWWWWWW",
73
+ "W......W",
74
+ "W..S...W",
75
+ "W......D",
76
+ "WWWWWWWW"
77
+ ],
78
+ "tags": ["start"]
79
+ }
80
+ ```
81
+
82
+ ### Corridor (east-west)
83
+ ```json
84
+ {
85
+ "id": "room_corridor_ew",
86
+ "ascii": [
87
+ "WWWWWWWWWWWWW",
88
+ "D...........D",
89
+ "WWWWWWWWWWWWW"
90
+ ],
91
+ "tags": ["corridor"]
92
+ }
93
+ ```
94
+
95
+ ### Combat room (multiple doors)
96
+ ```json
97
+ {
98
+ "id": "room_combat",
99
+ "ascii": [
100
+ "WWWDWWWWWDWWW",
101
+ "W...........W",
102
+ "D...........D",
103
+ "W...........W",
104
+ "WWWDWWWWWDWWW"
105
+ ],
106
+ "tags": []
107
+ }
108
+ ```
109
+
110
+ ### Room with transition to overworld
111
+ ```json
112
+ {
113
+ "id": "room_exit",
114
+ "ascii": [
115
+ "WWWWWWWW",
116
+ "W......W",
117
+ "W..>...W",
118
+ "D......W",
119
+ "WWWWWWWW"
120
+ ],
121
+ "tags": []
122
+ }
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Minimum Room Set for a Working Dungeon
128
+
129
+ Provide at least:
130
+ 1. One start room (with `"tags": ["start"]` and `S`)
131
+ 2. One or two additional rooms with doors for the generator to connect
132
+
133
+ More rooms = more variety in generated dungeons.
@@ -0,0 +1,112 @@
1
+ # Enemy Definitions — AI Reference
2
+
3
+ Load this file when generating or modifying `apps/game-data/src/enemies/enemy-defs.json`.
4
+
5
+ ---
6
+
7
+ ## File Format
8
+
9
+ `enemy-defs.json` is a JSON array. Each object defines one enemy type.
10
+
11
+ ```json
12
+ [
13
+ {
14
+ "id": "grunt",
15
+ "hp": 50,
16
+ "maxHp": 50,
17
+ "speed": 2.5,
18
+ "attackDamage": 10,
19
+ "attackRange": 1.2,
20
+ "aggroRange": 6,
21
+ "color": "#cc4444",
22
+ "scale": 1.0
23
+ }
24
+ ]
25
+ ```
26
+
27
+ **The array must never be empty** — the server will throw on startup.
28
+
29
+ ---
30
+
31
+ ## Field Reference
32
+
33
+ | Field | Type | Description | Typical range |
34
+ |-------|------|-------------|---------------|
35
+ | `id` | string | Unique identifier, lowercase, no spaces | `"grunt"`, `"fire_bat"` |
36
+ | `hp` | number | Starting hit points | 20–300 |
37
+ | `maxHp` | number | Maximum hit points (usually same as `hp`) | same as `hp` |
38
+ | `speed` | number | Movement speed in world units/second | 1.0–7.0 |
39
+ | `attackDamage` | number | Damage per hit | 5–50 |
40
+ | `attackRange` | number | Distance at which enemy can attack player | 1.0–2.5 |
41
+ | `aggroRange` | number | Distance at which enemy notices player | 4–12 |
42
+ | `color` | string | Hex color string for the enemy mesh | `"#cc4444"` |
43
+ | `scale` | number | Size multiplier (1.0 = normal humanoid) | 0.5–2.5 |
44
+
45
+ ---
46
+
47
+ ## Existing Enemy Examples (Reference Game)
48
+
49
+ ```json
50
+ [
51
+ {
52
+ "id": "grunt",
53
+ "hp": 50, "maxHp": 50, "speed": 2.5,
54
+ "attackDamage": 10, "attackRange": 1.2, "aggroRange": 6,
55
+ "color": "#cc4444", "scale": 1.0
56
+ },
57
+ {
58
+ "id": "wolf",
59
+ "hp": 30, "maxHp": 30, "speed": 5.5,
60
+ "attackDamage": 8, "attackRange": 1.0, "aggroRange": 7,
61
+ "color": "#888888", "scale": 0.7
62
+ },
63
+ {
64
+ "id": "skeleton",
65
+ "hp": 45, "maxHp": 45, "speed": 2.0,
66
+ "attackDamage": 12, "attackRange": 1.2, "aggroRange": 8,
67
+ "color": "#e8e0d0", "scale": 0.9
68
+ },
69
+ {
70
+ "id": "golem",
71
+ "hp": 150, "maxHp": 150, "speed": 1.2,
72
+ "attackDamage": 30, "attackRange": 1.5, "aggroRange": 4,
73
+ "color": "#607060", "scale": 1.6
74
+ }
75
+ ]
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Deriving Enemy Stats from a Description
81
+
82
+ ### Archetype Defaults
83
+
84
+ | Description | hp | speed | attackDamage | aggroRange | scale |
85
+ |-------------|-----|-------|--------------|------------|-------|
86
+ | "slow and tanky" | 120–200 | 1.0–2.0 | 20–35 | 4–6 | 1.4–1.8 |
87
+ | "fast and fragile" | 20–35 | 4.5–6.5 | 5–10 | 7–10 | 0.6–0.8 |
88
+ | "balanced fighter" | 45–70 | 2.5–3.5 | 10–18 | 5–7 | 0.9–1.1 |
89
+ | "boss" | 250–500 | 1.5–2.5 | 30–60 | 6–8 | 1.8–2.5 |
90
+ | "swarm unit" | 15–25 | 3.0–4.5 | 4–8 | 6–9 | 0.5–0.7 |
91
+
92
+ ### Color Derivation from Description
93
+
94
+ | Description keywords | Suggested color |
95
+ |----------------------|-----------------|
96
+ | skeleton, bone, white | `"#e8e0d0"` |
97
+ | fire, flame, lava | `"#ff4400"` |
98
+ | shadow, dark, void | `"#221133"` |
99
+ | ice, frost, cold | `"#88ccff"` |
100
+ | poison, slime, green | `"#44aa33"` |
101
+ | stone, golem, rock | `"#607060"` |
102
+ | wolf, beast, grey | `"#888888"` |
103
+ | demon, blood, red | `"#cc2222"` |
104
+ | ghost, spirit, pale | `"#ccddee"` |
105
+
106
+ ---
107
+
108
+ ## Naming Convention
109
+
110
+ - Use lowercase with underscores: `"fire_bat"`, `"cave_spider"`
111
+ - Keep ids short and descriptive
112
+ - Avoid spaces, hyphens, or special characters in ids
@@ -0,0 +1,93 @@
1
+ # Toolkit Framework — AI Reference
2
+
3
+ This file is loaded by AI tools to understand the gamedev-ai-toolkit structure.
4
+ Read this first before making any changes to a game.
5
+
6
+ ---
7
+
8
+ ## The Mental Model
9
+
10
+ This toolkit separates **framework** (never touch) from **game content** (your playground).
11
+
12
+ ```
13
+ packages/ ← Framework code — NEVER modify
14
+ apps/client/ ← Framework renderer — NEVER modify
15
+ apps/server/ ← Framework server — NEVER modify
16
+ apps/protocol/ ← Framework network schemas — NEVER modify
17
+ apps/game-data/ ← YOUR game content lives here — modify freely
18
+ ```
19
+
20
+ **Rule:** You only ever touch files inside `apps/game-data/src/`.
21
+
22
+ ---
23
+
24
+ ## What Lives Where (game-data)
25
+
26
+ | What | File |
27
+ |------|------|
28
+ | Enemy definitions | `apps/game-data/src/enemies/enemy-defs.json` |
29
+ | Room layouts | `apps/game-data/src/rooms/room_*.json` |
30
+ | Area configuration | `apps/game-data/src/areas/area-manifest.json` |
31
+ | Cell visuals (colors/heights) | `apps/game-data/src/dungeon/cell-visuals.ts` |
32
+ | Cell types (symbol map) | `apps/game-data/src/dungeon/cell-types.ts` |
33
+ | Items | `apps/game-data/src/items/item-pool.json` |
34
+ | Audio | `apps/game-data/src/audio/sound-config.json` |
35
+
36
+ ---
37
+
38
+ ## Area Types
39
+
40
+ | Type | Description | When to use |
41
+ |------|-------------|-------------|
42
+ | `dungeon` | Procedurally assembled from room_*.json files | Roguelike, dungeon crawler, cave |
43
+ | `voxel` | Open voxel world (Minecraft-like terrain) | Overworld, exploration, open world |
44
+
45
+ A game can have multiple areas of different types connected via transitions.
46
+
47
+ ---
48
+
49
+ ## Minimum Viable Game ("it runs")
50
+
51
+ These 4 things must exist for `pnpm dev` to start successfully:
52
+
53
+ 1. **`area-manifest.json`** — at least 1 area defined
54
+ 2. **`room_*.json`** — at least 1 room with `"tags": ["start"]`
55
+ 3. **`enemy-defs.json`** — at least 1 enemy entry (array, never empty)
56
+ 4. **`cell-visuals.ts`** — all `GameCellType` keys must have a value (null is valid for `empty`)
57
+
58
+ Missing any of these = runtime error.
59
+
60
+ ---
61
+
62
+ ## Deriving Technical Decisions from Product Answers
63
+
64
+ ### Core Loop → Area Type
65
+ | Player does... | Area type |
66
+ |----------------|-----------|
67
+ | Explore rooms, fight enemies | `dungeon` |
68
+ | Roam open world | `voxel` |
69
+ | Both | `dungeon` + `voxel` connected via transition |
70
+
71
+ ### Reference Game → Defaults
72
+ | Feels like... | Enemy speed | Aggro range | Color temperature |
73
+ |---------------|-------------|-------------|-------------------|
74
+ | Dark Souls | slow (1.5–2.5) | medium (5–7) | dark, desaturated |
75
+ | Hades | fast (4.0–6.0) | wide (7–10) | vivid, saturated |
76
+ | Minecraft | medium (2.5–3.5) | medium (6–8) | natural tones |
77
+ | Enter the Gungeon | fast (3.5–5.0) | wide (8–12) | neon accents |
78
+
79
+ ### Enemy Description → Stats
80
+ - "slow and tanky" → high hp (100–200), low speed (1.0–2.0), scale 1.4–1.8
81
+ - "fast and fragile" → low hp (20–40), high speed (4.5–6.5), scale 0.6–0.9
82
+ - "balanced" → medium hp (40–70), medium speed (2.5–3.5), scale 1.0
83
+
84
+ ---
85
+
86
+ ## How to Run
87
+
88
+ ```bash
89
+ pnpm install # from monorepo root
90
+ pnpm dev # starts client + server
91
+ ```
92
+
93
+ Client runs on http://localhost:5173 by default.
@@ -0,0 +1,125 @@
1
+ # Cell Visuals — AI Reference
2
+
3
+ Load this file when generating or modifying `apps/game-data/src/dungeon/cell-visuals.ts`.
4
+
5
+ ---
6
+
7
+ ## File Format
8
+
9
+ `cell-visuals.ts` exports a `CELL_VISUALS` constant — a record mapping every `GameCellType`
10
+ to a `CellVisual` object (or `null` for invisible cells).
11
+
12
+ ```typescript
13
+ import type { CellVisual } from '@loonylabs/gamedev-core';
14
+ import type { GameCellType } from './cell-types.js';
15
+
16
+ export const CELL_VISUALS: Record<GameCellType, CellVisual | null> = {
17
+ wall: { height: 2, color: 0x888888 },
18
+ floor: { height: 0.1, color: 0x444444 },
19
+ door: { height: 1.5, color: 0xcc7733 },
20
+ spawn: { height: 0.2, color: 0x44cc44 },
21
+ empty: null,
22
+ transition: { height: 0.15, color: 0xffcc00 },
23
+ npc: { height: 1.8, color: 0xffff00 },
24
+ fire: { height: 0.3, color: 0xff6600 },
25
+ };
26
+ ```
27
+
28
+ **Every key in `GameCellType` must be present.** Missing keys = TypeScript error.
29
+
30
+ ---
31
+
32
+ ## CellVisual Fields
33
+
34
+ | Field | Type | Description |
35
+ |-------|------|-------------|
36
+ | `height` | number | Box height in world units |
37
+ | `color` | number | Hex color as numeric literal (0xRRGGBB) |
38
+
39
+ `null` means: no mesh rendered for this cell type (use for `empty`).
40
+
41
+ ---
42
+
43
+ ## Color Format
44
+
45
+ Colors are **numeric hex literals**, not strings:
46
+ - ✅ `0x888888`
47
+ - ❌ `"#888888"`
48
+
49
+ To convert: remove `#`, prefix with `0x`. `#cc7733` → `0xcc7733`
50
+
51
+ ---
52
+
53
+ ## Height Guidelines
54
+
55
+ | Cell Type | Typical height | Notes |
56
+ |-----------|---------------|-------|
57
+ | wall | 2.0–3.0 | Should be clearly taller than player |
58
+ | floor | 0.05–0.15 | Near-flat |
59
+ | door | 1.2–1.8 | Shorter than wall, visually distinct |
60
+ | spawn | 0.1–0.3 | Subtle floor marker |
61
+ | transition | 0.1–0.2 | Subtle, distinct color |
62
+ | npc | 1.5–2.0 | Humanoid height |
63
+ | fire | 0.2–0.5 | Low, glowing |
64
+
65
+ ---
66
+
67
+ ## Palette Derivation from Mood/Reference Game
68
+
69
+ ### Dark Dungeon (Dark Souls, roguelike)
70
+ ```typescript
71
+ wall: { height: 2.5, color: 0x333333 },
72
+ floor: { height: 0.1, color: 0x222222 },
73
+ door: { height: 1.5, color: 0x664422 },
74
+ spawn: { height: 0.2, color: 0x336633 },
75
+ transition: { height: 0.15, color: 0x886600 },
76
+ npc: { height: 1.8, color: 0x998866 },
77
+ fire: { height: 0.3, color: 0xff4400 },
78
+ ```
79
+
80
+ ### Vivid Action (Hades, Enter the Gungeon)
81
+ ```typescript
82
+ wall: { height: 2.0, color: 0x554477 },
83
+ floor: { height: 0.1, color: 0x332244 },
84
+ door: { height: 1.5, color: 0xcc44ff },
85
+ spawn: { height: 0.2, color: 0x44ffaa },
86
+ transition: { height: 0.15, color: 0xffdd00 },
87
+ npc: { height: 1.8, color: 0xffaa44 },
88
+ fire: { height: 0.3, color: 0xff6600 },
89
+ ```
90
+
91
+ ### Natural World (Minecraft, survival)
92
+ ```typescript
93
+ wall: { height: 2.0, color: 0x556644 },
94
+ floor: { height: 0.1, color: 0x7a6a4a },
95
+ door: { height: 1.5, color: 0x886633 },
96
+ spawn: { height: 0.2, color: 0x88cc44 },
97
+ transition: { height: 0.15, color: 0xddcc55 },
98
+ npc: { height: 1.8, color: 0xffdd88 },
99
+ fire: { height: 0.3, color: 0xff6600 },
100
+ ```
101
+
102
+ ### Ice / Frost (cold, pale)
103
+ ```typescript
104
+ wall: { height: 2.5, color: 0x8899bb },
105
+ floor: { height: 0.1, color: 0x6677aa },
106
+ door: { height: 1.5, color: 0x99bbdd },
107
+ spawn: { height: 0.2, color: 0x44ffcc },
108
+ transition: { height: 0.15, color: 0xffffff },
109
+ npc: { height: 1.8, color: 0xccddff },
110
+ fire: { height: 0.3, color: 0x44ccff },
111
+ ```
112
+
113
+ ---
114
+
115
+ ## Deriving Palette from Description Keywords
116
+
117
+ | Keyword | Wall color | Floor color | Accent color |
118
+ |---------|-----------|-------------|--------------|
119
+ | dark, grim, underground | `0x333333` | `0x222222` | `0x664422` |
120
+ | fire, hell, volcanic | `0x442211` | `0x331100` | `0xff4400` |
121
+ | forest, nature, cave | `0x445533` | `0x556644` | `0x88cc44` |
122
+ | ice, frost, arctic | `0x8899bb` | `0x6677aa` | `0x99bbdd` |
123
+ | magic, arcane, purple | `0x442255` | `0x331144` | `0xcc44ff` |
124
+ | ancient, temple, stone | `0x887766` | `0x776655` | `0xccbb88` |
125
+ | toxic, slime, swamp | `0x334422` | `0x223311` | `0x44aa22` |
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>gamedev-ai-toolkit</title>
7
+ <link rel="stylesheet" href="/src/style.css" />
8
+ </head>
9
+ <body>
10
+ <canvas id="game-canvas"></canvas>
11
+ <div id="ui"></div>
12
+ <script type="module" src="/src/main.ts"></script>
13
+ </body>
14
+ </html>
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "gamedev-client",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build",
9
+ "preview": "vite preview",
10
+ "test": "vitest run"
11
+ },
12
+ "dependencies": {
13
+ "@loonylabs/game-data": "workspace:*",
14
+ "@loonylabs/gamedev-client": "workspace:*",
15
+ "@loonylabs/gamedev-core": "workspace:*",
16
+ "@loonylabs/gamedev-protocol": "workspace:*",
17
+ "@sveltejs/vite-plugin-svelte": "^4.0.4",
18
+ "howler": "^2.2.4",
19
+ "socket.io-client": "^4.7.0",
20
+ "svelte": "^5.55.1",
21
+ "three": "^0.160.0",
22
+ "valtio": "^1.13.0"
23
+ },
24
+ "devDependencies": {
25
+ "@types/howler": "^2.2.12",
26
+ "@types/three": "^0.160.0",
27
+ "typescript": "^5.0.0",
28
+ "vite": "^5.0.0",
29
+ "vitest": "^1.0.0"
30
+ }
31
+ }