@opengamehq/skills 1.4.0 → 1.5.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 (382) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +12 -4
  3. package/dist/.claude-plugin/marketplace.json +26 -0
  4. package/dist/skills/manifest.json +1406 -142
  5. package/dist/skills/opengame-accessibility/CHANGELOG.md +4 -0
  6. package/dist/skills/opengame-accessibility/SKILL.md +48 -32
  7. package/dist/skills/opengame-all-in-one/CHANGELOG.md +21 -0
  8. package/dist/skills/opengame-all-in-one/SKILL.md +195 -0
  9. package/dist/skills/opengame-all-in-one/references/opengame-accessibility/README.md +102 -0
  10. package/dist/skills/opengame-all-in-one/references/opengame-api/README.md +107 -0
  11. package/dist/skills/opengame-all-in-one/references/opengame-assets/README.md +168 -0
  12. package/dist/skills/opengame-all-in-one/references/opengame-assets/references/pipeline.md +164 -0
  13. package/dist/skills/opengame-all-in-one/references/opengame-audio/README.md +238 -0
  14. package/dist/skills/opengame-all-in-one/references/opengame-audio/helpers/audio-chain.js +325 -0
  15. package/dist/skills/opengame-all-in-one/references/opengame-audio/references/mix-notes.md +125 -0
  16. package/dist/skills/opengame-all-in-one/references/opengame-audio/references/qa-without-ears.md +177 -0
  17. package/dist/skills/opengame-all-in-one/references/opengame-capture/README.md +128 -0
  18. package/dist/skills/opengame-all-in-one/references/opengame-capture/references/pipeline.md +114 -0
  19. package/dist/skills/opengame-all-in-one/references/opengame-capture/references/threejs.md +161 -0
  20. package/dist/skills/opengame-all-in-one/references/opengame-characters/README.md +180 -0
  21. package/dist/skills/opengame-all-in-one/references/opengame-characters/references/first-person-body.md +108 -0
  22. package/dist/skills/opengame-all-in-one/references/opengame-characters/references/integration.md +144 -0
  23. package/dist/skills/opengame-all-in-one/references/opengame-characters/references/player-og.md +160 -0
  24. package/dist/skills/opengame-all-in-one/references/opengame-cli/README.md +189 -0
  25. package/dist/skills/opengame-all-in-one/references/opengame-deploy/README.md +223 -0
  26. package/dist/skills/opengame-all-in-one/references/opengame-deploy/references/json-events.md +63 -0
  27. package/dist/skills/opengame-all-in-one/references/opengame-deploy/references/manifest.md +89 -0
  28. package/dist/skills/opengame-all-in-one/references/opengame-deploy/references/packaging.md +119 -0
  29. package/dist/skills/opengame-all-in-one/references/opengame-depth/README.md +154 -0
  30. package/dist/skills/opengame-all-in-one/references/opengame-enemies/README.md +155 -0
  31. package/dist/skills/opengame-all-in-one/references/opengame-enemies/references/pacing-and-bots.md +108 -0
  32. package/dist/skills/opengame-all-in-one/references/opengame-enemies/references/threejs.md +193 -0
  33. package/dist/skills/opengame-all-in-one/references/opengame-front-end/README.md +185 -0
  34. package/dist/skills/opengame-all-in-one/references/opengame-front-end/references/launch.md +50 -0
  35. package/dist/skills/opengame-all-in-one/references/opengame-front-end/references/menus.md +81 -0
  36. package/dist/skills/opengame-all-in-one/references/opengame-game-feel/README.md +181 -0
  37. package/dist/skills/opengame-all-in-one/references/opengame-game-feel/helpers/spring.js +146 -0
  38. package/dist/skills/opengame-all-in-one/references/opengame-game-feel/references/feel-numbers.md +142 -0
  39. package/dist/skills/opengame-all-in-one/references/opengame-game-feel/references/killcam.md +88 -0
  40. package/dist/skills/opengame-all-in-one/references/opengame-jam/README.md +114 -0
  41. package/dist/skills/opengame-all-in-one/references/opengame-lighting/README.md +141 -0
  42. package/dist/skills/opengame-all-in-one/references/opengame-lighting/helpers/light-pool.js +185 -0
  43. package/dist/skills/opengame-all-in-one/references/opengame-loading/README.md +135 -0
  44. package/dist/skills/opengame-all-in-one/references/opengame-loading/helpers/loading-count.mjs +115 -0
  45. package/dist/skills/opengame-all-in-one/references/opengame-loading/references/threejs.md +141 -0
  46. package/dist/skills/opengame-all-in-one/references/opengame-look/README.md +181 -0
  47. package/dist/skills/opengame-all-in-one/references/opengame-look/references/matching-a-reference.md +73 -0
  48. package/dist/skills/opengame-all-in-one/references/opengame-look/references/painterly.md +69 -0
  49. package/dist/skills/opengame-all-in-one/references/opengame-look/references/post-and-lens.md +73 -0
  50. package/dist/skills/opengame-all-in-one/references/opengame-maps/README.md +74 -0
  51. package/dist/skills/opengame-all-in-one/references/opengame-maps/references/map-spec.md +77 -0
  52. package/dist/skills/opengame-all-in-one/references/opengame-mobile/README.md +86 -0
  53. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/README.md +183 -0
  54. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/briefs.md +293 -0
  55. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/day-one-questions.md +46 -0
  56. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/edge-cases.md +27 -0
  57. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/filmable.md +244 -0
  58. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/finishing.md +126 -0
  59. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/measure.md +282 -0
  60. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/montage-capture.md +151 -0
  61. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/montage-gates.md +84 -0
  62. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/montage-genres.md +198 -0
  63. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/montage-grammar.md +320 -0
  64. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/montage-ops.md +127 -0
  65. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/og-snipers-record.md +110 -0
  66. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/owner-eye.md +214 -0
  67. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/reference-study.md +293 -0
  68. package/dist/skills/opengame-all-in-one/references/opengame-montage-make/references/song.md +64 -0
  69. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/README.md +193 -0
  70. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/briefs.md +293 -0
  71. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/day-one-questions.md +46 -0
  72. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/filmable.md +244 -0
  73. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/measure.md +282 -0
  74. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/montage-capture.md +151 -0
  75. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/montage-gates.md +84 -0
  76. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/montage-genres.md +198 -0
  77. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/montage-grammar.md +320 -0
  78. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/montage-ops.md +127 -0
  79. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/og-snipers-record.md +110 -0
  80. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/owner-eye.md +214 -0
  81. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/reference-study.md +293 -0
  82. package/dist/skills/opengame-all-in-one/references/opengame-montage-plan/references/song.md +64 -0
  83. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/README.md +174 -0
  84. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/briefs.md +293 -0
  85. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/day-one-questions.md +46 -0
  86. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/filmable.md +244 -0
  87. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/finishing.md +126 -0
  88. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/measure.md +282 -0
  89. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/montage-capture.md +151 -0
  90. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/montage-gates.md +84 -0
  91. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/montage-genres.md +198 -0
  92. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/montage-grammar.md +320 -0
  93. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/montage-ops.md +127 -0
  94. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/og-snipers-record.md +110 -0
  95. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/owner-eye.md +214 -0
  96. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/reference-study.md +293 -0
  97. package/dist/skills/opengame-all-in-one/references/opengame-montage-review-and-improve/references/song.md +64 -0
  98. package/dist/skills/opengame-all-in-one/references/opengame-multiplayer/README.md +139 -0
  99. package/dist/skills/opengame-all-in-one/references/opengame-multiplayer/references/bot-lobbies.md +71 -0
  100. package/dist/skills/opengame-all-in-one/references/opengame-multiplayer/references/netcode.md +165 -0
  101. package/dist/skills/opengame-all-in-one/references/opengame-performance/README.md +177 -0
  102. package/dist/skills/opengame-all-in-one/references/opengame-performance/helpers/landing-pacer.mjs +86 -0
  103. package/dist/skills/opengame-all-in-one/references/opengame-performance/references/measuring.md +123 -0
  104. package/dist/skills/opengame-all-in-one/references/opengame-performance/references/webgpu.md +86 -0
  105. package/dist/skills/opengame-all-in-one/references/opengame-production/README.md +192 -0
  106. package/dist/skills/opengame-all-in-one/references/opengame-production/references/team.md +107 -0
  107. package/dist/skills/opengame-all-in-one/references/opengame-production/references/templates.md +153 -0
  108. package/dist/skills/opengame-all-in-one/references/opengame-quality-bar/README.md +170 -0
  109. package/dist/skills/opengame-all-in-one/references/opengame-quality-bar/references/cheap-tells.md +43 -0
  110. package/dist/skills/opengame-all-in-one/references/opengame-quality-bar/references/judges.md +95 -0
  111. package/dist/skills/opengame-all-in-one/references/opengame-quality-bar/references/review-prompt.md +32 -0
  112. package/dist/skills/opengame-all-in-one/references/opengame-rhythm/README.md +134 -0
  113. package/dist/skills/opengame-all-in-one/references/opengame-rhythm/references/charting.md +109 -0
  114. package/dist/skills/opengame-all-in-one/references/opengame-rhythm/references/timing.md +92 -0
  115. package/dist/skills/opengame-all-in-one/references/opengame-router/README.md +54 -0
  116. package/dist/skills/opengame-all-in-one/references/opengame-router/references/process.md +38 -0
  117. package/dist/skills/opengame-all-in-one/references/opengame-scene-audit/README.md +136 -0
  118. package/dist/skills/opengame-all-in-one/references/opengame-scene-audit/helpers/scene-audit.js +677 -0
  119. package/dist/skills/opengame-all-in-one/references/opengame-sdk/README.md +283 -0
  120. package/dist/skills/opengame-all-in-one/references/opengame-sdk/references/engines.md +93 -0
  121. package/dist/skills/opengame-all-in-one/references/opengame-sdk/references/frame.md +107 -0
  122. package/dist/skills/opengame-all-in-one/references/opengame-sdk/references/identity.md +111 -0
  123. package/dist/skills/opengame-all-in-one/references/opengame-sdk/references/leaderboards.md +115 -0
  124. package/dist/skills/opengame-all-in-one/references/opengame-sdk/references/radio.md +71 -0
  125. package/dist/skills/opengame-all-in-one/references/opengame-stability/README.md +112 -0
  126. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/README.md +160 -0
  127. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/archetypes.md +113 -0
  128. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/briefs.md +273 -0
  129. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/core.md +129 -0
  130. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/craft.md +299 -0
  131. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/edge-cases.md +27 -0
  132. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/filmable.md +244 -0
  133. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/finishing.md +126 -0
  134. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/gates.md +184 -0
  135. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/measure.md +282 -0
  136. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/music.md +148 -0
  137. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/og-clash-record.md +133 -0
  138. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/ops.md +154 -0
  139. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/owner-eye.md +214 -0
  140. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/review.md +141 -0
  141. package/dist/skills/opengame-all-in-one/references/opengame-trailer-make/references/title.md +92 -0
  142. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/README.md +172 -0
  143. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/archetypes.md +113 -0
  144. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/briefs.md +273 -0
  145. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/core.md +129 -0
  146. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/craft.md +299 -0
  147. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/edge-cases.md +27 -0
  148. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/filmable.md +244 -0
  149. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/finishing.md +126 -0
  150. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/gates.md +184 -0
  151. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/measure.md +282 -0
  152. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/music.md +148 -0
  153. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/og-clash-record.md +133 -0
  154. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/ops.md +154 -0
  155. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/owner-eye.md +214 -0
  156. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/reference-set.md +92 -0
  157. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/review.md +141 -0
  158. package/dist/skills/opengame-all-in-one/references/opengame-trailer-plan/references/title.md +92 -0
  159. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/README.md +141 -0
  160. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/archetypes.md +113 -0
  161. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/briefs.md +273 -0
  162. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/core.md +129 -0
  163. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/craft.md +299 -0
  164. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/edge-cases.md +27 -0
  165. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/filmable.md +244 -0
  166. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/finishing.md +126 -0
  167. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/gates.md +184 -0
  168. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/measure.md +282 -0
  169. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/music.md +148 -0
  170. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/og-clash-record.md +133 -0
  171. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/ops.md +154 -0
  172. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/owner-eye.md +214 -0
  173. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/review.md +141 -0
  174. package/dist/skills/opengame-all-in-one/references/opengame-trailer-review-and-improve/references/title.md +92 -0
  175. package/dist/skills/opengame-all-in-one/references/opengame-verification/README.md +197 -0
  176. package/dist/skills/opengame-all-in-one/references/opengame-verification/helpers/browser-evidence.mjs +74 -0
  177. package/dist/skills/opengame-all-in-one/references/opengame-weapons/README.md +179 -0
  178. package/dist/skills/opengame-all-in-one/references/opengame-weapons/references/handling-numbers.md +114 -0
  179. package/dist/skills/opengame-all-in-one/references/opengame-weapons/references/reloads-and-hands.md +96 -0
  180. package/dist/skills/opengame-all-in-one/references/opengame-weapons/references/sights-and-scopes.md +98 -0
  181. package/dist/skills/opengame-all-in-one/references/opengame-weapons/references/threejs.md +240 -0
  182. package/dist/skills/opengame-all-in-one/references/opengame-world-physics/README.md +141 -0
  183. package/dist/skills/opengame-all-in-one/references/opengame-world-physics/references/measured-failures.md +79 -0
  184. package/dist/skills/opengame-api/CHANGELOG.md +8 -0
  185. package/dist/skills/opengame-api/SKILL.md +39 -13
  186. package/dist/skills/opengame-assets/CHANGELOG.md +11 -0
  187. package/dist/skills/opengame-assets/SKILL.md +79 -31
  188. package/dist/skills/opengame-assets/references/pipeline.md +67 -0
  189. package/dist/skills/opengame-audio/CHANGELOG.md +11 -0
  190. package/dist/skills/opengame-audio/SKILL.md +129 -41
  191. package/dist/skills/opengame-audio/references/mix-notes.md +44 -1
  192. package/dist/skills/opengame-audio/references/qa-without-ears.md +177 -0
  193. package/dist/skills/opengame-capture/CHANGELOG.md +10 -0
  194. package/dist/skills/opengame-capture/SKILL.md +44 -20
  195. package/dist/skills/opengame-capture/references/pipeline.md +33 -1
  196. package/dist/skills/opengame-capture/references/threejs.md +17 -1
  197. package/dist/skills/opengame-characters/CHANGELOG.md +15 -0
  198. package/dist/skills/opengame-characters/SKILL.md +94 -39
  199. package/dist/skills/opengame-characters/references/first-person-body.md +108 -0
  200. package/dist/skills/opengame-characters/references/player-og.md +1 -1
  201. package/dist/skills/opengame-cli/CHANGELOG.md +12 -0
  202. package/dist/skills/opengame-cli/SKILL.md +11 -10
  203. package/dist/skills/opengame-deploy/CHANGELOG.md +20 -0
  204. package/dist/skills/opengame-deploy/SKILL.md +41 -21
  205. package/dist/skills/opengame-deploy/references/json-events.md +6 -5
  206. package/dist/skills/opengame-deploy/references/packaging.md +28 -26
  207. package/dist/skills/opengame-depth/CHANGELOG.md +8 -0
  208. package/dist/skills/opengame-depth/SKILL.md +61 -33
  209. package/dist/skills/opengame-enemies/CHANGELOG.md +10 -0
  210. package/dist/skills/opengame-enemies/SKILL.md +96 -40
  211. package/dist/skills/opengame-enemies/references/pacing-and-bots.md +108 -0
  212. package/dist/skills/opengame-enemies/references/threejs.md +59 -0
  213. package/dist/skills/opengame-front-end/CHANGELOG.md +4 -0
  214. package/dist/skills/opengame-front-end/SKILL.md +85 -39
  215. package/dist/skills/opengame-front-end/references/menus.md +42 -8
  216. package/dist/skills/opengame-game-feel/CHANGELOG.md +11 -0
  217. package/dist/skills/opengame-game-feel/SKILL.md +95 -47
  218. package/dist/skills/opengame-game-feel/references/feel-numbers.md +59 -0
  219. package/dist/skills/opengame-game-feel/references/killcam.md +88 -0
  220. package/dist/skills/opengame-jam/CHANGELOG.md +8 -0
  221. package/dist/skills/opengame-jam/SKILL.md +46 -31
  222. package/dist/skills/opengame-lighting/CHANGELOG.md +9 -0
  223. package/dist/skills/opengame-lighting/SKILL.md +85 -34
  224. package/dist/skills/opengame-loading/CHANGELOG.md +4 -0
  225. package/dist/skills/opengame-loading/SKILL.md +78 -38
  226. package/dist/skills/opengame-loading/helpers/loading-count.mjs +115 -0
  227. package/dist/skills/opengame-loading/references/threejs.md +32 -7
  228. package/dist/skills/opengame-look/CHANGELOG.md +9 -0
  229. package/dist/skills/opengame-look/SKILL.md +122 -51
  230. package/dist/skills/opengame-look/references/matching-a-reference.md +73 -0
  231. package/dist/skills/opengame-look/references/painterly.md +69 -0
  232. package/dist/skills/opengame-look/references/post-and-lens.md +10 -3
  233. package/dist/skills/opengame-maps/CHANGELOG.md +9 -0
  234. package/dist/skills/opengame-maps/SKILL.md +78 -0
  235. package/dist/skills/opengame-maps/references/map-spec.md +77 -0
  236. package/dist/skills/opengame-mobile/CHANGELOG.md +4 -0
  237. package/dist/skills/opengame-mobile/SKILL.md +18 -18
  238. package/dist/skills/opengame-montage-make/CHANGELOG.md +5 -0
  239. package/dist/skills/opengame-montage-make/SKILL.md +187 -0
  240. package/dist/skills/opengame-montage-make/references/briefs.md +293 -0
  241. package/dist/skills/opengame-montage-make/references/day-one-questions.md +46 -0
  242. package/dist/skills/opengame-montage-make/references/edge-cases.md +27 -0
  243. package/dist/skills/opengame-montage-make/references/filmable.md +244 -0
  244. package/dist/skills/opengame-montage-make/references/finishing.md +126 -0
  245. package/dist/skills/opengame-montage-make/references/measure.md +282 -0
  246. package/dist/skills/opengame-montage-make/references/montage-capture.md +151 -0
  247. package/dist/skills/opengame-montage-make/references/montage-gates.md +84 -0
  248. package/dist/skills/opengame-montage-make/references/montage-genres.md +198 -0
  249. package/dist/skills/opengame-montage-make/references/montage-grammar.md +320 -0
  250. package/dist/skills/opengame-montage-make/references/montage-ops.md +127 -0
  251. package/dist/skills/opengame-montage-make/references/og-snipers-record.md +110 -0
  252. package/dist/skills/opengame-montage-make/references/owner-eye.md +214 -0
  253. package/dist/skills/opengame-montage-make/references/reference-study.md +293 -0
  254. package/dist/skills/opengame-montage-make/references/song.md +64 -0
  255. package/dist/skills/opengame-montage-plan/CHANGELOG.md +5 -0
  256. package/dist/skills/opengame-montage-plan/SKILL.md +197 -0
  257. package/dist/skills/opengame-montage-plan/references/briefs.md +293 -0
  258. package/dist/skills/opengame-montage-plan/references/day-one-questions.md +46 -0
  259. package/dist/skills/opengame-montage-plan/references/filmable.md +244 -0
  260. package/dist/skills/opengame-montage-plan/references/measure.md +282 -0
  261. package/dist/skills/opengame-montage-plan/references/montage-capture.md +151 -0
  262. package/dist/skills/opengame-montage-plan/references/montage-gates.md +84 -0
  263. package/dist/skills/opengame-montage-plan/references/montage-genres.md +198 -0
  264. package/dist/skills/opengame-montage-plan/references/montage-grammar.md +320 -0
  265. package/dist/skills/opengame-montage-plan/references/montage-ops.md +127 -0
  266. package/dist/skills/opengame-montage-plan/references/og-snipers-record.md +110 -0
  267. package/dist/skills/opengame-montage-plan/references/owner-eye.md +214 -0
  268. package/dist/skills/opengame-montage-plan/references/reference-study.md +293 -0
  269. package/dist/skills/opengame-montage-plan/references/song.md +64 -0
  270. package/dist/skills/opengame-montage-review-and-improve/CHANGELOG.md +5 -0
  271. package/dist/skills/opengame-montage-review-and-improve/SKILL.md +178 -0
  272. package/dist/skills/opengame-montage-review-and-improve/references/briefs.md +293 -0
  273. package/dist/skills/opengame-montage-review-and-improve/references/day-one-questions.md +46 -0
  274. package/dist/skills/opengame-montage-review-and-improve/references/filmable.md +244 -0
  275. package/dist/skills/opengame-montage-review-and-improve/references/finishing.md +126 -0
  276. package/dist/skills/opengame-montage-review-and-improve/references/measure.md +282 -0
  277. package/dist/skills/opengame-montage-review-and-improve/references/montage-capture.md +151 -0
  278. package/dist/skills/opengame-montage-review-and-improve/references/montage-gates.md +84 -0
  279. package/dist/skills/opengame-montage-review-and-improve/references/montage-genres.md +198 -0
  280. package/dist/skills/opengame-montage-review-and-improve/references/montage-grammar.md +320 -0
  281. package/dist/skills/opengame-montage-review-and-improve/references/montage-ops.md +127 -0
  282. package/dist/skills/opengame-montage-review-and-improve/references/og-snipers-record.md +110 -0
  283. package/dist/skills/opengame-montage-review-and-improve/references/owner-eye.md +214 -0
  284. package/dist/skills/opengame-montage-review-and-improve/references/reference-study.md +293 -0
  285. package/dist/skills/opengame-montage-review-and-improve/references/song.md +64 -0
  286. package/dist/skills/opengame-multiplayer/CHANGELOG.md +15 -0
  287. package/dist/skills/opengame-multiplayer/SKILL.md +143 -0
  288. package/dist/skills/opengame-multiplayer/references/bot-lobbies.md +71 -0
  289. package/dist/skills/opengame-multiplayer/references/netcode.md +165 -0
  290. package/dist/skills/opengame-performance/CHANGELOG.md +8 -0
  291. package/dist/skills/opengame-performance/SKILL.md +106 -65
  292. package/dist/skills/opengame-performance/helpers/landing-pacer.mjs +86 -0
  293. package/dist/skills/opengame-performance/references/measuring.md +51 -0
  294. package/dist/skills/opengame-performance/references/webgpu.md +86 -0
  295. package/dist/skills/opengame-production/CHANGELOG.md +13 -0
  296. package/dist/skills/opengame-production/SKILL.md +119 -54
  297. package/dist/skills/opengame-production/references/team.md +107 -0
  298. package/dist/skills/opengame-production/references/templates.md +106 -16
  299. package/dist/skills/opengame-quality-bar/CHANGELOG.md +10 -0
  300. package/dist/skills/opengame-quality-bar/SKILL.md +94 -42
  301. package/dist/skills/opengame-quality-bar/references/cheap-tells.md +14 -7
  302. package/dist/skills/opengame-quality-bar/references/judges.md +95 -0
  303. package/dist/skills/opengame-quality-bar/references/review-prompt.md +10 -5
  304. package/dist/skills/opengame-rhythm/CHANGELOG.md +5 -0
  305. package/dist/skills/opengame-rhythm/SKILL.md +138 -0
  306. package/dist/skills/opengame-rhythm/references/charting.md +109 -0
  307. package/dist/skills/opengame-rhythm/references/timing.md +92 -0
  308. package/dist/skills/opengame-router/CHANGELOG.md +8 -0
  309. package/dist/skills/opengame-router/SKILL.md +14 -7
  310. package/dist/skills/opengame-scene-audit/CHANGELOG.md +15 -0
  311. package/dist/skills/opengame-scene-audit/SKILL.md +64 -47
  312. package/dist/skills/opengame-scene-audit/helpers/scene-audit.js +97 -19
  313. package/dist/skills/opengame-sdk/CHANGELOG.md +12 -0
  314. package/dist/skills/opengame-sdk/SKILL.md +26 -9
  315. package/dist/skills/opengame-sdk/references/engines.md +2 -2
  316. package/dist/skills/opengame-sdk/references/identity.md +10 -11
  317. package/dist/skills/opengame-stability/CHANGELOG.md +4 -0
  318. package/dist/skills/opengame-stability/SKILL.md +59 -27
  319. package/dist/skills/opengame-trailer-make/CHANGELOG.md +5 -0
  320. package/dist/skills/opengame-trailer-make/SKILL.md +164 -0
  321. package/dist/skills/opengame-trailer-make/references/archetypes.md +113 -0
  322. package/dist/skills/opengame-trailer-make/references/briefs.md +273 -0
  323. package/dist/skills/opengame-trailer-make/references/core.md +129 -0
  324. package/dist/skills/opengame-trailer-make/references/craft.md +299 -0
  325. package/dist/skills/opengame-trailer-make/references/edge-cases.md +27 -0
  326. package/dist/skills/opengame-trailer-make/references/filmable.md +244 -0
  327. package/dist/skills/opengame-trailer-make/references/finishing.md +126 -0
  328. package/dist/skills/opengame-trailer-make/references/gates.md +184 -0
  329. package/dist/skills/opengame-trailer-make/references/measure.md +282 -0
  330. package/dist/skills/opengame-trailer-make/references/music.md +148 -0
  331. package/dist/skills/opengame-trailer-make/references/og-clash-record.md +133 -0
  332. package/dist/skills/opengame-trailer-make/references/ops.md +154 -0
  333. package/dist/skills/opengame-trailer-make/references/owner-eye.md +214 -0
  334. package/dist/skills/opengame-trailer-make/references/review.md +141 -0
  335. package/dist/skills/opengame-trailer-make/references/title.md +92 -0
  336. package/dist/skills/opengame-trailer-plan/CHANGELOG.md +5 -0
  337. package/dist/skills/opengame-trailer-plan/SKILL.md +176 -0
  338. package/dist/skills/opengame-trailer-plan/references/archetypes.md +113 -0
  339. package/dist/skills/opengame-trailer-plan/references/briefs.md +273 -0
  340. package/dist/skills/opengame-trailer-plan/references/core.md +129 -0
  341. package/dist/skills/opengame-trailer-plan/references/craft.md +299 -0
  342. package/dist/skills/opengame-trailer-plan/references/edge-cases.md +27 -0
  343. package/dist/skills/opengame-trailer-plan/references/filmable.md +244 -0
  344. package/dist/skills/opengame-trailer-plan/references/finishing.md +126 -0
  345. package/dist/skills/opengame-trailer-plan/references/gates.md +184 -0
  346. package/dist/skills/opengame-trailer-plan/references/measure.md +282 -0
  347. package/dist/skills/opengame-trailer-plan/references/music.md +148 -0
  348. package/dist/skills/opengame-trailer-plan/references/og-clash-record.md +133 -0
  349. package/dist/skills/opengame-trailer-plan/references/ops.md +154 -0
  350. package/dist/skills/opengame-trailer-plan/references/owner-eye.md +214 -0
  351. package/dist/skills/opengame-trailer-plan/references/reference-set.md +92 -0
  352. package/dist/skills/opengame-trailer-plan/references/review.md +141 -0
  353. package/dist/skills/opengame-trailer-plan/references/title.md +92 -0
  354. package/dist/skills/opengame-trailer-review-and-improve/CHANGELOG.md +5 -0
  355. package/dist/skills/opengame-trailer-review-and-improve/SKILL.md +145 -0
  356. package/dist/skills/opengame-trailer-review-and-improve/references/archetypes.md +113 -0
  357. package/dist/skills/opengame-trailer-review-and-improve/references/briefs.md +273 -0
  358. package/dist/skills/opengame-trailer-review-and-improve/references/core.md +129 -0
  359. package/dist/skills/opengame-trailer-review-and-improve/references/craft.md +299 -0
  360. package/dist/skills/opengame-trailer-review-and-improve/references/edge-cases.md +27 -0
  361. package/dist/skills/opengame-trailer-review-and-improve/references/filmable.md +244 -0
  362. package/dist/skills/opengame-trailer-review-and-improve/references/finishing.md +126 -0
  363. package/dist/skills/opengame-trailer-review-and-improve/references/gates.md +184 -0
  364. package/dist/skills/opengame-trailer-review-and-improve/references/measure.md +282 -0
  365. package/dist/skills/opengame-trailer-review-and-improve/references/music.md +148 -0
  366. package/dist/skills/opengame-trailer-review-and-improve/references/og-clash-record.md +133 -0
  367. package/dist/skills/opengame-trailer-review-and-improve/references/ops.md +154 -0
  368. package/dist/skills/opengame-trailer-review-and-improve/references/owner-eye.md +214 -0
  369. package/dist/skills/opengame-trailer-review-and-improve/references/review.md +141 -0
  370. package/dist/skills/opengame-trailer-review-and-improve/references/title.md +92 -0
  371. package/dist/skills/opengame-verification/CHANGELOG.md +11 -0
  372. package/dist/skills/opengame-verification/SKILL.md +113 -48
  373. package/dist/skills/opengame-weapons/CHANGELOG.md +11 -0
  374. package/dist/skills/opengame-weapons/SKILL.md +129 -55
  375. package/dist/skills/opengame-weapons/references/handling-numbers.md +42 -0
  376. package/dist/skills/opengame-weapons/references/reloads-and-hands.md +96 -0
  377. package/dist/skills/opengame-weapons/references/sights-and-scopes.md +98 -0
  378. package/dist/skills/opengame-weapons/references/threejs.md +71 -0
  379. package/dist/skills/opengame-world-physics/CHANGELOG.md +9 -0
  380. package/dist/skills/opengame-world-physics/SKILL.md +55 -24
  381. package/dist/skills/opengame-world-physics/references/measured-failures.md +28 -1
  382. package/package.json +1 -1
@@ -0,0 +1,238 @@
1
+ > Carried from `opengame-audio` 1.1.0. Read it when: Make a browser game sound finished. Covers sound from the first press on every device, audio QA without ears, a person listening before shipping, the player's shot leading the mix, a weapons limiter, no delay, a quiet player body, harshness and loudness gates, sounds heard at range and played whole, loops, generated takes, voice casting and buses. Use when the person says the game is silent, delayed, harsh, thin or muddy, sounds cheap, cuts off, repeats, or needs sound or voices.
2
+
3
+
4
+ # Audio
5
+
6
+ Sound is most of the distance between a prototype and a game. Our three reference games
7
+ ship between 337 and 7,459 audio files; our first prototypes shipped 34. Count is not
8
+ the goal, though. Four hundred samples played without a chain, a voice budget and a
9
+ no-repeat rule sound worse than forty played through them.
10
+
11
+ Agents have no ears. In OC, LC and OS every level was set by meter, and each time the
12
+ owner was the first person to listen: OC's wonder weapon was "too aggressive", LC had
13
+ no rain at all under the browser's strict autoplay, and OS delayed every sound by about
14
+ 690 ms. So these rules keep two kinds of evidence apart: what a recording of the running
15
+ game measures, and what only a person who listened can decide. Every report says which
16
+ is which.
17
+
18
+ Rules carry five tags; `opengame-quality-bar` explains them and the game codes.
19
+ [helpers/audio-chain.js](helpers/audio-chain.js) builds the chain, the buses and the
20
+ voice pool; its `selfTest()` plants a bus that bypasses the limiter, a clip curve that
21
+ adds gain, a duck with no lead and an oldest-voice pool, and proves each is caught. How
22
+ to record and check a game's sound without ears, with code for the master-bus tap:
23
+ [references/qa-without-ears.md](references/qa-without-ears.md). Rhythm and music games:
24
+ `opengame-rhythm` owns the song clock, the charted attack heard in the final mix and
25
+ codec delay.
26
+
27
+ ## Rules
28
+
29
+ ### Sound from the first press, loading screen included
30
+ - **Invariant:** The game makes sound from the player's first press: the loading screen, the title and every menu have music or ambience, and the first shot of the first run is heard.
31
+ - **Technique:** A press-to-start screen over key art gives the browser the gesture it needs while the download runs. Create and resume one audio context inside that first key or pointer handler, with no separate "tap for sound" prompt. Load the menu set first, then the sounds the player makes (the equipped weapon's bank) ahead of the rest of the run's audio. Hand the loading music to the menu theme with a crossfade, and log when the theme is up so the two never overlap. Never swallow a refused `play()` or a suspended context: count each refusal and restart the stream on the next gesture. Inside OpenGame the frame boots muted under the poster and the page's Play press is the gesture, so start sound from `og.audio.onHostMute(false)` after `og.init()` (`opengame-sdk`). In three.js, call `THREE.AudioContext.getContext().resume()` in the handler; `AudioListener` uses that shared context.
32
+ - **Reference configuration:** OC: the press lands a hit on the music downbeat 60 ms after the key; loading music at -20 LUFS over a -27 LUFS bed, a tick for every 5% of progress and an anvil hit at 100%, then a 3 s music fade and a 5 s bed fade into the menu theme. Tiered sets: menu 10.4 MB, combat core 22 MB. A gun granted in the first 20 s of a run was silent for 11 to 16 s behind 35 MB of queued audio, until a trickle loader moved the first fire cue from 12.0 s to 2.1 s at 3 MB/s. The owner asked three times: "even our loading screen should have sfx and music and environmental ambience sounds too ... not just be silent". LC's every capture booted with autostart and a lenient autoplay flag; under the strict policy every streamed loop died at its first hand-over and 421 refused `play()` calls were swallowed, until the owner asked "i dont hear any rain?".
33
+ - **Applies when:** Every browser game with sound.
34
+ - **Verify:** In a fresh profile on a throttled connection, under the browser's strict autoplay policy, press a key on the first screen and record the tab: sound starts on the press, the loading screen is never silent, the first shot of the first run is audible, and the refusal counter reads zero.
35
+
36
+ ### The shipped build makes sound on every platform
37
+ - **Invariant:** On every device and browser the game ships to, the deployed build plays the menu, the player's weapon and the voices at the levels the mix intends, and a build that cannot play sound tells the player.
38
+ - **Technique:** For each device and browser in the test matrix, record the deployed build through real input (menu, first shot, reload, a voice line) and measure loudness per segment; a silent segment fails. Resume the audio context on every touch, on visibility change and after an interruption, and treat a suspended context as a fault, never as the player's mute. If a fallback build has no sound, show a notice. Prove a mute setting by measured loudness, not by the click that set it. Emulators and headless captures are muted or lie about audio, so they prove nothing here.
39
+ - **Reference configuration:** OC: real iPhones had no in-game sound across at least three builds ("when I started the game there was ZERO sound"; later "game audio was playing but NOT gunfire sounds") while emulation passed. OC's single-threaded build had no audio at all, so iPhones moved to the threaded build (R169). A latency clamp set below the mixer's lead garbled audio on every device and was reverted (R195). OC's proposed fix was a 1 s resume watchdog plus `navigator.audioSession.type = "playback"` before creating any context; the notes do not record whether the session type helped. On the gameplay montage the settings-menu mute clicks never landed, found only when loudness was measured (-24.5 against -37.4 dB), and all 9 segments were reshot. The owner raised iPhone sound about 7 times.
40
+ - **Applies when:** Every game with sound, and above all games that ship to phones.
41
+ - **Verify:** On a real iPhone and a real Android phone, open the live URL, play to the first reload and record: gunfire, reload and a voice line are each audible. Turn sound off in settings and measure the drop.
42
+
43
+ ### Agents measure; a person listens
44
+ - **Invariant:** Every sound in the build has been heard in the running game by a person before it ships. Until then, every report calls it measured, never heard, and says that nobody has listened. Meters gate a sound; a listener decides it.
45
+ - **Technique:** Meter first (loudness, peak, harshness, band levels), then render short named A/B clips of the change from one boot of the game, each named for what it is (new, as it was, not taken) and what to listen for, and send them to a person with a plain question. Keep a listened-by field per cue in the registry; a cue with no listener is reported as unheard. An agent opens every audio report with what nobody has heard and never writes "sounds" or "heard" about its own measurements. A spectrogram, a transcript and a model's score are evidence for a meter, not for taste.
46
+ - **Reference configuration:** OC on 16 Oct: "None of the audio has been listened to by a person: every pick was made by measurement." The wonder weapon's third sound was pushed to -12 LUFS with stacked crackle and whistle, marked "Not listened to by anyone", and rejected as "too aggressive" and "distorted"; its crest factor was 9.7 against the reference's 13.8. LC wrote "NOBODY HAS HEARD" 72 times across its audio notes; nine audio leads set every level by meter, and the owner, the first to listen, found no rain, "a really loud screehcing noise (that sounds female?)" and a flamethrower whose sound was "to harsh/loud/unpleasant", while reload sounds existed for every gun and nobody had heard one. OS moved its guns from -14 to -20 to -22 LUFS over four publishes with nobody listening, from "way too loud and distorted" to "too soft". In OH the owner was the only ear (`opengame-rhythm`).
47
+ - **Applies when:** Every game with sound, and every game built by agents.
48
+ - **Verify:** Every cue in the registry names who heard it and when, and links the in-game clip they heard; every agent report on sound opens with what is unheard.
49
+
50
+ ### Record the game's own output on the player's path
51
+ - **Invariant:** The mix is judged from recordings of the built game's master output, started the way a player starts it and aligned to the game's own events, against stated relationships between sounds; nothing is judged from the source files alone, and no master is ever deleted.
52
+ - **Technique:** Tap the master bus with an AudioWorklet that writes a WAV, and log game events on the audio clock beside it so each shot, step and line can be found in the recording. Boot the built game with no autostart, press a real key, and run under the browser's strict autoplay policy as well as the default. Render scripted scenes through the game's real audio code in an `OfflineAudioContext` for fast checks. Gate on relationships (the shot over an enemy voice, steps over rain, a bed's level in the band a laptop speaker plays), transcribe every spoken line, read spectrograms as images with the shipped file shown first, and decode and re-measure after every encode. A low cue with no harmonics is silent on a laptop. A screencast's clock is not real time, so prove sound against picture from the in-page log, never by counting video frames.
53
+ - **Reference configuration:** LC's gates: the shot at least 4 LU over an enemy voice at arm's length (it measured 1.2, then 5.9), footsteps at least 6 dB over the rain for most steps, the surge heard before it is seen, a fight at -16 LUFS ±1.5, a quiet night at -28 ±3 (later ruled -25), output under -2 dBTP, files under -6 dBTP. Its rain beds sat near -47 dBFS and passed because the check measured the whole quiet scene; it now fails if rain at rest in 200 Hz-6 kHz is under -33 dBFS. A heartbeat 97% below 150 Hz read -59 dBFS in 300 Hz-4 kHz until a parallel clipped path gave it harmonics. The recordings found a misread radio line, an 8 dB end fade, masked footsteps, a shot 1.2 LU over a throat and a 600 Hz tone in a lift that the audio check itself exempted. OS's tap, aligned to the engine log within about 0.2 s, exposed a 1.7 to 3.6 s skew behind wrong numbers. OH's screencast ran at 25 fps with a 1 to 4.6 s offset from the page, so judges who timed effects by counting frames were wrong.
54
+ - **Applies when:** Every game with sound, above all one built by agents.
55
+ - **Verify:** After every bank or mix change, a three-minute real run produces the gate table from the recording, and a planted fault (a muted bed, a swallowed `play()`) fails it.
56
+
57
+ ### Every sound reaches the speaker without delay, and nothing broken ever does
58
+ - **Invariant:** A sound waits only the device's own output latency plus a short mixing lead, in every phase of the game, and no NaN, out-of-range, runaway or garbage sample ever reaches the speakers. Static from the speakers counts as a crash.
59
+ - **Technique:** In Web Audio, start each sound at once on the context's clock and add no buffering of your own. Where a mixer is fed by a thread that can stall (a wasm engine, an AudioWorklet ring buffer), size its lead from the measured gap between writes, the longest recent gap plus a small margin inside a clamp; reset it after load stalls and never store it. Never trade latency for dropouts. Guard every bus against NaN, DC and bursts with bit tests that survive fast-math builds, keep a limiter under full scale, and prove the guard by injecting noise and NaNs.
60
+ - **Reference configuration:** An OS dropout fix grew the lead to 600 ms and stored it, so every sound waited about 690 ms: "audio / gun shot sounds are delayed now?... in latest build actualyl it seems all audio" and "we cant ever have delaye daudio ever in game anywhere" (owner). The adaptive lead (the longest engine write gap in the last 3 s plus 8 ms, within 30 to 100 ms) gave a 30 ms median with 13 underruns in 7 minutes, against 511 at a fixed 30 to 40 ms, and press-to-output of 67 ms against an 80 ms bar. A failed allocation wrote 5.3 MB of PCM, heard as "really loud static noise ... that really hurt my ears", because the NaN check had been compiled away. OC's latency clamp below the mixer's lead garbled every device.
61
+ - **Applies when:** Every game with sound; the lead sizing applies to a mixer fed by a thread that can stall.
62
+ - **Verify:** Log press-to-onset at each of the player's shots through two map loads, force 20 stalls of 150 ms, and inject +12 dB noise with NaNs: the output stays clean and the median stays near the device's base latency.
63
+
64
+ ### The player's shot leads the mix, measured as a hierarchy at the output
65
+ - **Invariant:** In the recorded output the player's own signature sound (a shot, a strike) with its echo is clearly louder than every bolt, reload, voice, rival shot and continuous sound, and a person listens before a change ships.
66
+ - **Technique:** Record the real output with music, ambience and ducks off, and measure the shot, bolt and reload of each weapon together in one table. Normalise percussive takes on their momentary maximum from masters trimmed to the transient, keep rivals well under the player's own shot, order weapons by calibre, and trim each spoken line by its loudest moment against the shot. Rebuild ducks from the live voices every audio frame, so a stuck duck cannot flatter the measurement. Targets per family can still invert the hierarchy, so check it across families at the output.
67
+ - **Reference configuration:** OS: a flat ±1 LU pass left bolts louder, "reload and bolt back sounds are defs louder than the gunshot sounds which shouldnt be the case" (owner). After: the own shot 4.8 LU over anything in a fight, rivals at least 6 dB under, bolts 9.5 to 28 LU under, reloads never within 6 LU, the announcer 2 to 3 LU under; momentary maximum put 13 of 16 guns within 0.8 dB where integrated loudness left 4.7 dB. A duck that skipped its reset flattered the check by 4 to 8 dB. A gunshot pack the owner supplied stayed once the owner signed it off ("Keep them for all the gunshots. Do not change them…"), and was only levelled, mixed and trimmed, with the shot 6 to 10 LU over foley; its licence had been flagged by an agent, which makes shipping it the owner's call (`opengame-assets`). LC orders by calibre: rifle at the ceiling, pistol -3 and SMG -4 dB, 12 dB over a zombie's throat within 3 m; each radio line trimmed so its loudest 150 ms lands 2 dB under the player's shot (lines levelled by integrated loudness stood 5.4 dB apart).
68
+ - **Applies when:** Any game with a signature action sound.
69
+ - **Verify:** A dry table per weapon with the shot on top in every row, a duck log reading 0 dB during the capture, and a clip a person has heard.
70
+
71
+ ### Weapons have their own limiter, and the mix makes room for each shot
72
+ - **Invariant:** Firing never pumps the rest of the mix: the weapons run through a limiter of their own, every other sound gives way briefly under each shot, nothing ducks the weapons, and automatic fire never becomes a wall of sound.
73
+ - **Technique:** A weapons bus with its own fast limiter ahead of the master. Each shot ducks the other buses briefly: fast down, a short hold, a slower return (the duck rule below covers a cause that sits inside the ducked bus). Keep non-shot sounds a few dB lower, cap overlapping shot bodies in automatic fire, put enemy voices through their own compressor, and use real recorded gunshots with a tail recorded for each place. A low thump with harmonics gives weight on small speakers.
74
+ - **Reference configuration:** LC's weapons limiter: -7 dBFS (-4 for real recordings), 20:1, 1 ms attack, 90 ms release; "with one shared limiter a burst took 8 dB off everything" (the dead, the radio and the storm). Each round ducks 10 dB, down in 5 ms, held 120 ms, back over 450 ms, measured at 12.4 dB with no pumping; non-shot sounds sit 3 dB lower; at most 2 shot bodies at once ("a burst becomes a wall"); the dead go through a compressor at -10 dB and 3.5:1, and a shot rises 4.9 to 6.7 dB out of 18 of them (it had risen 1 dB). An old voice duck had cut every round 6 dB for a run's first 20 s. CC0 recordings peak in 1.5 ms with a crest of 19 dB where generated shots peaked in 10 to 35 ms, "a rebuild, not a level change"; tails decay to -40 dB in 0.36 s in a room and 1.84 s in a vault; a sine thump falling from 125 to 50 Hz survives laptop speakers through its harmonics.
75
+ - **Applies when:** Shooters, and any game with a crowd under the player's action.
76
+ - **Verify:** Render a burst beside a near enemy offline: the shot stands about 12 dB over it, the duck holds and returns without pumping, and the weapons bus shows no gain reduction from anything but its own limiter.
77
+
78
+ ### Every sound is clean
79
+ - **Invariant:** No sound is harsh, distorted, clipped or unpleasant to sit through, including the ones that repeat fastest, and one harsh sound starts a sweep of its whole class.
80
+ - **Technique:** Batch-meter every file for true peak, loudness, crest factor, the share of energy in the upper-mid presence band and above it, narrow peaks, onset steepness, hiss, DC offset and clicks at the loop point, and flag outliers against their family. Fix at the file. When anyone calls one sound harsh, meter and audition every sound in its class. Rapid-fire weapons get a short sound per shot and a cap on overlapping shots. A soft tonal design beats stacked crackle, sizzle and whistle layers.
81
+ - **Reference configuration:** OC's owner: "the death machine SFX is OBNOXIOUS ... every sound needs to be elegant and clean and pleasant to the ear ... make sure no others like that!" Its 1.8 s file fired 25 times a second, about 12 dB louder than the Thompson, with 39% of its energy at 2-5 kHz (Thompson 12%); a 2 s in-game spray went from -13.0 LUFS and 23% to -17.7 LUFS and 5.4% (Thompson -16.4 and 9.7%, M1911 -17.2 and 5.5%). The sweep softened 54 more files and fixed 6 clicks at loop points (R167-R169). Gate: true peak at or under -1 dBTP, codec SNR at least 33 dB, 2,895 files with none clipped; rapid fire caps simultaneous shots at 2 and plays a casing every 6th round. LC's limits: 2-6 kHz at most -4 dB of the total, above 8 kHz at most -9 dB, narrow peaks at most 7 dB over their neighbours, onsets at most 12 dB/ms (90 for a shot).
82
+ - **Applies when:** Every game with sound; weapons and voices first.
83
+ - **Verify:** The batch meter prints every file's numbers and the outliers in each family; a person listens to every rapid-fire weapon held down and to the loudest ten seconds of the busiest fight.
84
+
85
+ ### The player's body is quiet
86
+ - **Invariant:** A person moving normally makes no sound with their mouth: no breathing at rest or at a walk, no groans while moving, and effort and pain sounds are short, clean and rare.
87
+ - **Technique:** Gate body vocals on state: breath only after a long sprint and briefly after it, a voiced blow at most once per short interval, a death as one short clean grunt. No breathy, moaning or groaning takes on a player character. Footsteps, kit and cloth carry the body instead.
88
+ - **Reference configuration:** LC's owner: "therse way too many player groan noises and breathing noises... we want some but nedes to be more realistic... and not weird groan noises when ur moving". After: no breath at rest or walk, breath only after at least 4 s of sprint and for 7 s, a blow voiced at most once per 2.2 s. OC's death groan "sounds sexual" and became a 210-240 ms "oof".
89
+ - **Applies when:** Games with a voiced player character, in first or third person.
90
+ - **Verify:** A three-minute recorded run with no fighting has zero mouth sounds; a sprint and a run of hits stay inside the gates.
91
+
92
+ ### Far sounds the player needs can be heard
93
+ - **Invariant:** Before anyone balances levels, every sound the player needs is audible at the distances the game is played at, and the mixer plays the cues the game sends.
94
+ - **Technique:** Check the distance model first: one falloff for every source makes the biggest sources inaudible at the distance they matter. Set reference distance and rolloff per sound family, keep the player's own hits above a floor, and count cues requested against cues played during a busy fight. In three.js, set `PositionalAudio.setRefDistance`, `setRolloffFactor` and `setDistanceModel` per family.
95
+ - **Reference configuration:** OC: one 3 m falloff left the boss at -28 dB. Per-family falloff became boss 30 m, explosions 12 m, zombies 6 m, impacts 5 m, with the player's own hits never below -8 dB. The mixer had been dropping 75% of cues (peak 41 voices, creature vocals capped at 4 with 13 dropped). The whole mix moved from -24.9 to -16.9 LUFS. The owner: "i dont hear any sfx really in game?" OS, where "a sniper game lives on hearing shots": a rival shot about 10 LU over wind and rain at 30 m, directional at 100 m, a distinct far crack and echo at 150-200 m, crack before boom at 343 m/s.
96
+ - **Applies when:** 3D games with positional sound.
97
+ - **Verify:** Stand at the far edge of the arena and trigger the boss's loudest attack; log requested against played cues over a minute of the busiest fight.
98
+
99
+ ### Enemies can be found by ear in the dark
100
+ - **Invariant:** With nothing visible, the player can tell an enemy is near and where it is from its steps and voice over the ambience, inside a stated range.
101
+ - **Technique:** Trigger footsteps by distance covered with a minimum gap; give voices and feet a flatter falloff than other sounds; let the ambience give way a few dB while an unseen enemy is close; put voices in the band the ambience leaves free; use HRTF panning with extra cut at the far ear; taper a crowd so many voices do not blur.
102
+ - **Reference configuration:** LC's bar, lamp off: the nearest zombie within 10 m at or over the rain in its own band (100 Hz-1 kHz) nine times in ten, at least 6 dB over inside 5 m, under it beyond 15 m; steps at least 90 ms apart; falloff 0.4x (voices) and 0.55x (feet) of inverse distance; the rain gives 4 dB while an unseen one is within 10 m; up to 6 dB more cut at the far ear; a crowd taper with six or more within 12 m; "what is heard through rain is a moan" (90-500 Hz). Measured: steps found 32 of 34, voices 14 of 14, bearing error 2 degrees.
103
+ - **Applies when:** Horror and stealth games, and any game with enemies out of sight.
104
+ - **Verify:** Log every sound with its true distance and bearing and its level against the ambience in its own band; the bar holds over a dark run.
105
+
106
+ ### Every sound the player needs plays whole, from where it happened
107
+ - **Invariant:** No audible sound ends before its file except by a named rule, echoes decay under the next shot rather than being cut, no queue or first use drops a shot or a cue, and every rival's sound comes from the rival.
108
+ - **Technique:** Voices over the cap keep advancing virtually and come back when there is room. Fade tails at their natural slope, never on a fixed clock, and continue a short tail with shaped noise at the measured slope. Size delayed-sound queues for the worst fight, load a weapon's far takes when its holder first appears, keep a stop ledger naming why each sound ended early, and play every rival's reload, bolt and step positionally. Duck weather briefly under each arriving far report.
109
+ - **Reference configuration:** OS's owner: "it feels like we're cutting off the echo on many gun shots prematurely?...". OS's voice limit cut 1,110 sounds in a 10-minute 31-bot fight, then 0 once stolen voices went virtual; fixed-clock fades ran up to 214 dB/s where tails decay at 20-40 dB/s to -60 dB in 2.3-3.7 s. A 32-entry queue dropped 30 of 109 rival reports, and "each rifle's first long-range shot of a match was silent". Rival reloads played centred at full level and were heard as the player's own reload never ending, until 71 cues were made positional. Rivals at 100 m went from -24 dB to 10 LU over storm rain.
110
+ - **Applies when:** Games with a voice cap, many players or many enemies.
111
+ - **Verify:** A busiest-fight capture whose stop ledger shows no unexplained early end, an audible first long-range shot in a fresh match, and a distance sweep with the louder ear on the correct side.
112
+
113
+ ### Gunfire beats groans
114
+ - **Invariant:** When the voice budget is full, the sounds the player causes and needs (their weapon, hits, interface, music, announcer) always play, and enemy vocals give way first.
115
+ - **Technique:** Priority classes in the voice pool. The player's weapon, hit confirmation, interface, music and announcer are never culled; enemy vocals are capped to the nearest few within a radius; everything else competes by audibility as in the stealing rule below. Phones keep the same classes with a smaller pool.
116
+ - **Reference configuration:** OC: player fire, hits, interface, music and announcer always mixed; enemy vocals capped to the nearest 6 within 20-30 m; about 40 voices in the mix. Before the classes existed, iPhones played "game audio ... but NOT gunfire sounds". LC shares no enemy voice within 14 m.
117
+ - **Applies when:** Games where many sounds overlap.
118
+ - **Verify:** Spawn the largest horde and hold the trigger; the pool log shows no player shot refused or stolen, and a recording of the fight has every shot in it.
119
+
120
+ ### Sound follows the animation beat by beat
121
+ - **Invariant:** Every sound tied to a visible action lands on the frame of its contact, beat by beat, on every weapon and action, and stops when the action is interrupted.
122
+ - **Technique:** Author multi-part actions (reloads, inspections, interactions) as named beats with times exported from the animation into one shared file. Start each beat's sound from the animation's own state in the frame that draws it, when its playhead crosses the beat, and place it on the audio clock at once; never run a second timeline on the audio side from the action's start, which drifts as soon as the animation is slowed, blended or cut. Cancel the remaining beats when the action is cancelled. Every weapon gets its full set, and a set shared by a family is checked on each gun it plays on. Subtitles take the clip's real length and close when the line is cut.
123
+ - **Reference configuration:** OC's fire cue rises within 3 ms of the shot, and its reload sounds land within 12 ms of hand contact after running up to 0.74 s late; the beat specs and per-gun numbers are in `opengame-weapons`. The owner: "sweat the details with micro sfx even for like each part of a reload animation". LC's reload sounds existed in ten families of six stages each, were timed only on pistols, and landed a median 443 ms before the hand, 108 of 109 more than 120 ms early; its rule became "every beat is begun by the picture's own value in the frame it shows it, never by a clock of audio's". The owner had asked "we should also have reload sfx for all guns too please... idk if we have them?".
124
+ - **Applies when:** Games with authored animations that make contact sounds. Rhythm games run the other way: the song clock drives the picture (`opengame-rhythm`).
125
+ - **Verify:** Frame-step a recording of every reload of every weapon beside its waveform and measure each beat's offset from the frame where the moving part makes contact.
126
+
127
+ ### Everything goes through one master chain
128
+ - **Invariant:** Every sound the game makes reaches the speakers through one chain that holds overlapping sounds together and puts a ceiling on the output.
129
+ - **Technique:** Master gain into a glue compressor, make-up gain before (not after) a limiter so its threshold is the real ceiling, then a soft clip for the transient the limiter's attack lets through. A `DynamicsCompressorNode` adds make-up gain of its own, so measure it and compensate. Route HTML audio and video through the same graph if they belong in the mix. `createMasterChain` in the helper.
130
+ - **Reference configuration:** AW and MC: glue at -15 dB, 4:1, knee 14, 6 ms attack, 180 ms release; limiter at -1.2 dB, 20:1, 1 ms, 60 ms; make-up 1.25 before the limiter (after it, the real ceiling rose to about +0.7 dBFS). SR glues more gently at -12 dB, 2:1. AW measured three 50 ms windows a minute peaking above 0 dBFS after the limiter alone. LC's master limiter is at -4.5 dBFS, 20:1, 220 ms release, with output under -2 dBTP, and it undoes the compressor node's automatic make-up of about (1/g)^0.6.
131
+ - **Applies when:** Every game with sound.
132
+ - **Verify:** `chainProperties(chain)` returns no failures, and a recording of the busiest moment in the game has no sample above the ceiling.
133
+
134
+ ### Buses with separate volume and duck
135
+ - **Invariant:** Music, ambience, effects, voice and interface sounds can each be turned down by the player and ducked by the game, and the two never fight.
136
+ - **Technique:** Each bus is a volume gain into a duck gain into the master. The player's slider writes the volume; the game's ducking writes the duck. Keep the player's weapons out of every voice and announcer duck (the weapons rule). Mute, pause and the page's own mute apply to every bus without changing the saved levels.
137
+ - **Reference configuration:** AW's buses are sfx, music, voice and ui, with ambience riding under the music slider but ducking on its own. OC ducks music 5 dB on big hits; its announcer ducks effects 4 dB and music and voice 6 dB. LC's rain ducks 8 dB under a radio line in 0.3 s, and an old voice duck that reached the weapons cut every round 6 dB. OH takes master gain under 0.01 within 0.5 s of the page's mute.
138
+ - **Applies when:** Every game with more than one kind of sound.
139
+ - **Verify:** Set the music slider to half, trigger a duck, let it release: the music returns to half, not to full.
140
+
141
+ ### A duck lets its cause be heard first
142
+ - **Invariant:** A sound that lowers the rest of the mix is itself heard at full level before the mix drops.
143
+ - **Technique:** Hold the ducked bus at unity for a short lead, then fade it down; overlapping ducks keep the deepest.
144
+ - **Reference configuration:** AW's concussion duck with no lead muffled the very gunshot that caused it, which made its loudest rifle the quietest weapon at its own shooter's ear. A 0.12 s lead recovered 4.8 LU and 7 dB of true peak on that shot and left every other case unchanged.
145
+ - **Applies when:** Any duck triggered by a game sound, such as concussions, voice lines or big impacts.
146
+ - **Verify:** `duckHoldsLead(chain)` is true; render the triggering sound with and without the duck and compare its loudness.
147
+
148
+ ### Busy moments steal the quietest voice, gently
149
+ - **Invariant:** When too many sounds play at once, the least audible one gives way, without a click, and information-bearing sounds are the last to go.
150
+ - **Technique:** A bounded voice pool; when full, fade the quietest unprotected voice over a few milliseconds and start the new one after it. A stolen voice the player still needs keeps its place virtually and returns when a voice frees (the rule on playing sounds whole). Reclaim voices by their scheduled end time, not by `onended`, which a busy event loop delivers late. Protect hit confirmation, warnings and voice. `createVoicePool` in the helper.
151
+ - **Reference configuration:** AW's 72-voice pool saturated in 0.16 s with twelve combatants. Taking the oldest voice with a hard stop retired voices as loud as the mix average (101%) and clicked; taking the quietest with a 6 ms fade retired voices at 46% of the mix average. OS's engine took the oldest unprotected voice, usually a gun's tail.
152
+ - **Applies when:** Any game where many sounds can overlap.
153
+ - **Verify:** `stealFailures(stealBehaviour(...))` is empty; drive the busiest fight and count voices stolen, refused and protected voices cut.
154
+
155
+ ### Takes in shuffled bags
156
+ - **Invariant:** A sound that repeats often never plays the same take twice in a row, and frequent actions have enough takes that the player stops hearing a sample.
157
+ - **Technique:** Several recorded takes per frequent event, played from a shuffled bag that empties before refilling. Spend the count where repetition is: footsteps per surface, impacts per material, actions at several strengths, beginnings, middles and ends. Voice lines also get a recurrence lockout and a chance to fire, so frequent events do not talk every time.
158
+ - **Reference configuration:** Our originals budget 50 to 400 recorded samples per game, spent where the game earns it. AW's hit, headshot and kill confirmations each have three takes in bags, so all three are heard before any repeats. Per-play variation of pitch 2 to 3% and gain 1.5 dB on top (DK, MC). OC's voice director: no-repeat bags, a 5-minute recurrence lockout, 8-15 s of quiet after any line, kill lines on 14% of kills and reload lines on 18%, 474-522 lines per character over 77 events, and 6-8 takes for frequent sounds. The owner had said "the character is also repeating stuff too much".
159
+ - **Applies when:** Every game with repeated actions.
160
+ - **Verify:** Log the take played for a hundred footsteps: no immediate repeats, and every take used.
161
+
162
+ ### Loops never repeat audibly
163
+ - **Invariant:** No bed or held sound has an audible period, no bed contains a sound the player will read as an event, and no continuous sound is as loud as the player's own action.
164
+ - **Technique:** Cut beds from long recordings, flatten swells, and fold the end over the start; check the envelope's circular autocorrelation; layer two beds of unequal length at random offsets. Build held sounds such as fire and engines from noise buffers of coprime lengths with moving bands rather than looping one file, and keep their top band narrow and free of fixed tones. Never prompt a generated bed with an event (steps, a door, a voice), because the player hears it as one; scan every bed for trains of footstep-like transients.
165
+ - **Reference configuration:** LC's rain beds run 38-97 s at an autocorrelation of 0.07 to 0.12 against a bar of 0.2 (a pulsed bed had read 0.58 at 2.1 s); open rain is two layers of 97 s and 71 s. The flamethrower moved from one 6 s file going round (self-likeness 1.00) to buffers of 9.7 and 13.1 s (0.18); after the owner's "to harsh/loud/unpleasant", four complaints in 27 hours, its 2.6 kHz whistle came out, its top was kept to 1.2-3 kHz and its held level went from -18.2 to -25.4 dBFS. OS's menu "footsteps", reported four times over three days, came last from a generated ambience bed prompted with "gravel crunching far away"; the transient-train scan took them from 4 to 0.
166
+ - **Applies when:** Ambience, weather, engines, fire and any held sound.
167
+ - **Verify:** Envelope autocorrelation of every bed under the bar, a spectrum check for fixed tones, and a transient-train scan of every bed that finds none.
168
+
169
+ ### Loudness is measured, per family
170
+ - **Invariant:** Every shipped audio file has a measured loudness and true peak, grouped by family and normalised to that family's target after the codec, and the measurements cover exactly the files that ship.
171
+ - **Technique:** Generate a loudness manifest from the files on disk, never by hand, with integrated or short-window loudness and true peak per file, and fail when a file and the manifest disagree in either direction. Normalise each family to its target (percussive takes on their momentary maximum), level-match takes within a class, and measure again after every re-encode. Then check the families against each other at the output (the shot rule above) and audition the assembled mix, because per-file numbers do not balance a game.
172
+ - **Reference configuration:** AW's manifest is generated from the library and its check reports how many files it measured, because an empty library and an empty manifest otherwise agree perfectly. AW's confirmation levels: hit about -25 LUFS, headshot -23, kill -21, measured over the loudest 200 ms. OC's targets: weapons -17 LUFS (-19 to -16), voice -19, steps -25, ambience loops -26, ceiling -1 dBTP, one-shots on their loudest 200 ms K-weighted window; takes within a class level-matched to 0.1 dB; a new gun at or below the existing ones; fire 13-15 dB over the ambient bed. OC generated 1,275 files for $11.70 at the start and shipped 2,895; spend and credit rates are in the mix notes. OS masters percussive takes to -14 LUFS momentary at most -1 dBTP, far takes near -22. LC's interface sounds are at -30 LUFS; a fight measured -17.2 LUFS, and a quiet night measured -22.5 against a ruling of -25.
173
+ - **Applies when:** Every game with recorded audio.
174
+ - **Verify:** The manifest check prints a file count equal to the number of shipped audio files, and every family's median is on its target.
175
+
176
+ ### Generated takes are bought once, mastered and screened
177
+ - **Invariant:** Every generated sound is made once from a recorded spec, mastered, encoded, decoded and measured again, and screened by measurement before anyone listens; a take that fails is rejected with a reason and never patched, and masters are kept.
178
+ - **Technique:** Buy only on the person's own account, after they have said yes to the cost (`opengame-assets`). Keep a manifest of specs and hash each one, so the generator skips a spec it has made before. Check the cap and the balance first, read the provider's cost for each call from its response, and write it to a sidecar file beside the take; stop when the service fails. Buy a few takes per cue. Master each take (trim to the transient, de-clip, tame harshness, notch whines, limit onsets, normalise loudness in two passes under a true-peak ceiling), encode, decode and re-measure. Reject clipped, thin, whining, clicking, shrill-for-its-character, cut-off and unsteady takes and fall back to the next; never re-pitch a bad one. Run every spoken line through the game's final chain into a local speech recogniser and a phoneme check, and reword what they mishear. Read spectrograms with the shipped file first, because metrics alone prefer synthetic beeps.
179
+ - **Reference configuration:** LC turned 1,891 takes into 520 sounds (24.6 MB) for $24.18; the cost in each response showed sound effects at 11 credits a second, not the 40 assumed. About half of its generated takes were rejected (598 of 1,230 zombie readings kept, 381 shipped); shrill takes fell from 144 of 243 to 0 of 236 once a throat stopped being prompted as a woman's; a takeoff carried a 656 Hz tone 28 dB over its surroundings; lines misheard through the radio ("take an arm from Iraq" 11 of 12) were reworded. Its rejects: clipped over 64 samples or 1.2% at the ceiling, thin over 30 dB down under 180 Hz, a steady 11-19 kHz tone, shrill a fundamental over 300 Hz ("a 1.3 kHz tone played an octave down is still a tone"); a 10 ms lead absorbs Opus pre-echo. OS's single-pass normaliser fell into an automatic-gain mode and added 22-32 ms lead-ins ("theres a werid noise first and a delay", owner); masters now start within 2 ms of the transient, and "exact" is proved by correlation (0.56 to 0.9997). OS's recogniser passed two invented names that a phoneme check caught, and could not tell /laɪv/ from /lɪv/, which the owner heard.
180
+ - **Applies when:** Every game using generated sound or voice.
181
+ - **Verify:** The rejection log per bank, a re-measure of every shipped file after decoding, and recogniser word accuracy on every line through the final chain at 85% or more in a fight.
182
+
183
+ ### Voices are cast by measurement, and the owner chooses by listening
184
+ - **Invariant:** A character voice is picked on intelligibility and fit across the whole script, from voices the game has a licence for and never cloned from another game's character; the owner hears samples and picks before the lines become the default; and a voice the owner approved is never replaced or deleted without asking.
185
+ - **Technique:** Audition the same few lines across several licensed voices; measure pitch, harmonics-to-noise, words per minute and recogniser word errors through the game's own chain (radio, helmet, distance); record the whole script with the top two; send the owner short samples; keep the runner-up one command away. Ask before deleting any named voice or line set, even one nothing calls yet.
186
+ - **Reference configuration:** LC auditioned 6 lines across 7 voices: the audition pick lost words on 34 of 159 readings through the radio and the runner-up on 14, so the pick was not cast; operator pitch 76-109 Hz; radio band 300 Hz-3.4 kHz; "nothing is cloned". Asked for two characters' voices that the account did not hold, LC recast from licensed library voices against a written character brief, cloning nothing ($3.17), and never put the 18 samples in front of the owner: the failure to avoid. An OS agent deleted the announcer's voice as "unused", so 46 of 71 lines shipped on a stand-in; once it was back, the owner: "annoucner voice is perfect so dont chang ehtat".
187
+ - **Applies when:** Any voiced character, narrator or announcer.
188
+ - **Verify:** The owner's pick is recorded with the samples they heard before the line set becomes the default, and the recogniser table covers the whole script.
189
+
190
+ ### A listener model is a compass, not proof
191
+ - **Invariant:** No music or sound ships on a model's score alone, and the owner hears a sample of each style before it is made in bulk.
192
+ - **Technique:** Score at equal loudness, leave stems out or play them alone to find what moves the score, score section by section, and treat any difference smaller than the model's own scatter as no difference.
193
+ - **Reference configuration:** OH: a synthesised snare cost about 0.27 of a listener model's score; leads pitched an octave high cost 0.4 to 0.9, and moving them into register lifted one song from 6.50 to 7.42; the model disliked jazz guitar everywhere; a text-audio model scored two different styles 0.9995 alike and was useless. OS kept its paid sound judge only as a method: a hearing test to admit a judge, shuffled ids, anchors and a median.
194
+ - **Applies when:** Generating music or sound at volume.
195
+ - **Verify:** An owner listen per style, logged before the batch is made.
196
+
197
+ ### One ranked confirmation channel
198
+ - **Invariant:** Hit, headshot and kill confirmations never pile up; a stronger verdict replaces a weaker one, and a weaker one never plays over a stronger one.
199
+ - **Technique:** Treat confirmations as one priority channel on a dry, protected interface bus with no world position. A new cue of equal or higher rank fades its predecessor out quickly; a lower one waits. Collapse duplicate reports from one frame.
200
+ - **Reference configuration:** AW: kill over headshot over hit, a 12 ms fade on replacement, a 28 ms floor for ordinary hits and 45 ms for headshots and kills, with a 100-event burst test.
201
+ - **Applies when:** Games with hit confirmation.
202
+ - **Verify:** Fire a shotgun into a target that dies: one kill cue plays, no hit cues under it.
203
+
204
+ ### Distance is authored, not filtered
205
+ - **Invariant:** A far sound is a different sound, not the near one made quieter, and every sound has the reverb of the space it happened in.
206
+ - **Technique:** Distant takes for loud sources, plus physically based air absorption that removes high frequencies with distance, attenuation from current positions, occlusion, and a reverb per zone sent from the source's own zone. Keep interface sounds and narrators out of the world.
207
+ - **Reference configuration:** AW: at 300 m, 8 kHz is 45 dB down while 250 Hz loses 0.3 dB; its distant weapon set varies by duration and low-frequency content, from a pistol's 0.22 s to a launcher's 0.70 s. AAA bar values: gain `ref / (ref + k (d - ref))`, a low-pass from 16 to 20 kHz near to 1.5 kHz at 40 m, occlusion about 0.43 of gain, zone reverbs from 0.38 s (courtyard) to 2.2 s (hall). LC, after "the sfx should echo like they are part of the map apporopiratley" (owner): eight impulse responses built in a Worker (Sabine RT60 = 0.161 V/A, first reflection at 2d/343), wetter with distance, at most two far reverbs, air low-pass 20 kHz x exp(-d/110), delay d/343, one occlusion ray a frame (900 Hz, -5 dB); a hut answers 2.7-3.0 dB over the open.
208
+ - **Applies when:** 3D games with sounds at distance.
209
+ - **Verify:** Record the same source at near, mid and far range, and behind a wall; each is audibly different in tone, not only level.
210
+
211
+ ### The audio clock schedules sound
212
+ - **Invariant:** Every sound that must land at a time is scheduled on the audio context's clock, not on a timer.
213
+ - **Technique:** Schedule against `AudioContext.currentTime`. Where a long sequence must not reserve voices up front, wake a little early with a timer and place each cue exactly on the audio clock. Cancel both the scheduled sources and the pending wake-ups. A sound tied to a picture takes its trigger from the picture and its placement from this clock (the beat rule above).
214
+ - **Reference configuration:** AW's reload reserved one voice per phase for its whole length, 132 voices against a pool of 72 at twelve combatants, until it moved to a 120 ms look-ahead. AW found four separate faults from gating sound on a clock other than the audio clock. LC's reloads ran their own audio-side timeline and drifted off the hands.
215
+ - **Applies when:** Every game with timed or sequenced sound.
216
+ - **Verify:** Grep for `setTimeout` near a `start(` or `play(` call; each one is a look-ahead wake-up, not the timing itself.
217
+
218
+ ### Every file has a caller, and music streams
219
+ - **Invariant:** Every audio file in the build is reachable from a call site, a file nothing calls is wired up or reported rather than deleted, and long music never sits decoded in memory.
220
+ - **Technique:** One cue registry that names each file and the event that triggers it, and preload derived from that registry. Report an unreached file to the owner; never delete a named voice or set to pass the check (the casting rule). A game made from another game ships its own sound, and a check fails on any file inherited from the parent that the owner has not kept. Stream music through a media element routed into the music bus; keep short cues in a bank that decodes on first use, warm the first use of a rare sound the round before it plays, and disconnect idle voices.
221
+ - **Reference configuration:** AW shipped 35 weapon files no weapon reached. A decoded sound is float PCM, about 23 MiB per stereo minute; ST found one game spending 134 MiB that way before its first frame of play. AW measured 266.9 MB of decoded audio against a 200 MB budget. In OC the first play of a rare sound was silent until warmed. OS replaced all 1,194 sounds it had inherited after its owner's "not same voices and music and sfx NONE of it the same there pls!", and once served new fire files while 14 of 16 rifles still triggered another cue. LC took decoded audio from 403 to 188 MB with nothing heard within 10 m below 44.1 kHz, and disconnecting voices idle for 0.5 s took the audio thread from 0.41 to 0.22 of a core at rest.
222
+ - **Applies when:** Every game with recorded audio.
223
+ - **Verify:** List audio files and grep each name in source; list decoded buffers at runtime and sum their sizes.
224
+
225
+ ### Open the front door once
226
+ - **Invariant:** Every public method of the game's audio engine runs without throwing on a live engine.
227
+ - **Technique:** A smoke test that calls each method once with plausible arguments against a real or stub context and counts the sources it started, so a run where everything early-returns cannot pass.
228
+ - **Reference configuration:** AW's audio had five green checks while a deleted constant threw on the first footstep, inside the frame update, which players reported as the game jittering.
229
+ - **Applies when:** Every game with an audio module.
230
+ - **Verify:** The smoke test reports zero errors and a non-zero count of sources started.
231
+
232
+ ## Further reading
233
+
234
+ Where the reference numbers came from, the soft-clip measurement, the sound families a
235
+ shooter needs, what OC's, LC's and OS's libraries cost and LC's generation pipeline:
236
+ [references/mix-notes.md](references/mix-notes.md). The master-bus tap, the owner-path
237
+ capture, the offline mix render and the other checks an agent can run without ears:
238
+ [references/qa-without-ears.md](references/qa-without-ears.md).
@@ -0,0 +1,325 @@
1
+ /**
2
+ * A master chain, buses with separate volume and duck gains, and a voice pool that
3
+ * steals the quietest voice with a short fade. Copy this file into the game; it imports
4
+ * nothing and builds every node once.
5
+ *
6
+ * import { createMasterChain, createVoicePool, selfTest } from "./audio-chain.js";
7
+ * const ctx = new AudioContext();
8
+ * const chain = createMasterChain(ctx); // buses: sfx, music, ambience, voice, ui
9
+ * const voices = createVoicePool(chain, { max: 48 });
10
+ * voices.play(buffer, { bus: "sfx", gain: 0.8, priority: 1 });
11
+ * voices.play(hitConfirm, { bus: "ui", protect: true });
12
+ * chain.setVolume("music", 0.6); // the player's slider
13
+ * chain.duck("music", 6, 0.5); // under a voice line, after the lead
14
+ *
15
+ * The order matters and each stage has one job:
16
+ * master gain -> glue compressor -> make-up gain -> limiter -> soft clip -> output
17
+ * The glue compressor holds overlapping sounds together without pumping. Make-up gain
18
+ * sits BEFORE the limiter so the limiter's threshold is the real ceiling. A
19
+ * DynamicsCompressorNode is not a brickwall: its attack lets the first millisecond of a
20
+ * transient through, so a soft clip after it rounds what escapes. The clip here is
21
+ * unity below its knee, so quiet sounds pass unchanged.
22
+ *
23
+ * Reference configuration: World at War and Modern Claudefare's mix (glue -15 dB, 4:1,
24
+ * knee 14, 6 ms, 180 ms; limiter -1.2 dB, 20:1, 1 ms, 60 ms). Run `selfTest()` after
25
+ * editing; it plants each defect this file prevents and fails unless it is caught.
26
+ */
27
+
28
+ export const CHAIN_DEFAULTS = Object.freeze({
29
+ buses: ["sfx", "music", "ambience", "voice", "ui"],
30
+ glue: { threshold: -15, knee: 14, ratio: 4, attack: 0.006, release: 0.18 },
31
+ makeupDb: 1.94,
32
+ limiter: { threshold: -1.2, knee: 0, ratio: 20, attack: 0.001, release: 0.06 },
33
+ clip: { knee: 0.6, ceiling: 0.97 },
34
+ duck: { leadSeconds: 0.12, attackSeconds: 0.06, releaseSeconds: 0.35 },
35
+ });
36
+
37
+ export const dbToGain = (db) => Math.pow(10, db / 20);
38
+
39
+ /**
40
+ * Unity below `knee`, then a tanh shoulder that approaches `ceiling` and never passes
41
+ * it. Continuous in value and slope at the knee, so it adds no click of its own.
42
+ */
43
+ export function softClipCurve({ knee, ceiling } = CHAIN_DEFAULTS.clip, samples = 4097) {
44
+ const curve = new Float32Array(samples);
45
+ const span = ceiling - knee;
46
+ for (let i = 0; i < samples; i++) {
47
+ const x = (i / (samples - 1)) * 2 - 1;
48
+ const a = Math.abs(x);
49
+ const y = a <= knee ? a : knee + span * Math.tanh((a - knee) / span);
50
+ curve[i] = Math.sign(x) * y;
51
+ }
52
+ return curve;
53
+ }
54
+
55
+ function setAll(param, values) { for (const [key, value] of Object.entries(values)) param[key].value = value; }
56
+
57
+ export function createMasterChain(ctx, options = {}) {
58
+ const config = { ...CHAIN_DEFAULTS, ...options };
59
+ const master = ctx.createGain();
60
+ const glue = ctx.createDynamicsCompressor();
61
+ setAll(glue, config.glue);
62
+ const makeup = ctx.createGain();
63
+ makeup.gain.value = dbToGain(config.makeupDb);
64
+ const limiter = ctx.createDynamicsCompressor();
65
+ setAll(limiter, config.limiter);
66
+ const clip = ctx.createWaveShaper();
67
+ clip.curve = softClipCurve(config.clip);
68
+ clip.oversample = "4x";
69
+ master.connect(glue); glue.connect(makeup); makeup.connect(limiter); limiter.connect(clip); clip.connect(ctx.destination);
70
+
71
+ const buses = {}, ducks = {}, duckUntil = {};
72
+ for (const name of config.buses) {
73
+ const volume = ctx.createGain(), duck = ctx.createGain();
74
+ volume.connect(duck); duck.connect(master);
75
+ buses[name] = volume; ducks[name] = duck; duckUntil[name] = 0;
76
+ }
77
+ const bus = (name) => {
78
+ if (!Object.hasOwn(buses, name)) throw new Error(`no bus named ${name}`);
79
+ return buses[name];
80
+ };
81
+
82
+ return {
83
+ ctx, master, glue, makeup, limiter, clip, buses, ducks,
84
+ /** Where a source connects. Volume and ducking live on separate gains so they never fight. */
85
+ input: bus,
86
+ setVolume(name, value) { bus(name).gain.setTargetAtTime(Math.max(0, value), ctx.currentTime, 0.015); },
87
+ /**
88
+ * Lowers a bus by `db` for `seconds`, starting after `leadSeconds` so the sound that
89
+ * caused the duck is heard at full level first. Overlapping ducks keep the deepest.
90
+ */
91
+ duck(name, db, seconds, { leadSeconds = config.duck.leadSeconds, attackSeconds = config.duck.attackSeconds, releaseSeconds = config.duck.releaseSeconds } = {}) {
92
+ bus(name);
93
+ const gain = ducks[name].gain, now = ctx.currentTime;
94
+ const start = now + leadSeconds, low = dbToGain(-Math.abs(db));
95
+ const until = start + attackSeconds + seconds;
96
+ if (duckUntil[name] > now && gain.value < low && until <= duckUntil[name]) return; // a deeper duck already holds
97
+ gain.cancelScheduledValues(now);
98
+ gain.setValueAtTime(gain.value, now);
99
+ gain.setValueAtTime(gain.value, start);
100
+ gain.linearRampToValueAtTime(low, start + attackSeconds);
101
+ gain.setValueAtTime(low, until);
102
+ gain.linearRampToValueAtTime(1, until + releaseSeconds);
103
+ duckUntil[name] = until + releaseSeconds;
104
+ },
105
+ dispose() {
106
+ for (const node of [master, glue, makeup, limiter, clip, ...Object.values(buses), ...Object.values(ducks)]) node.disconnect();
107
+ },
108
+ };
109
+ }
110
+
111
+ /**
112
+ * A bounded pool of one-shot voices. When full, the quietest unprotected voice is
113
+ * faded over `stealFadeSeconds` and replaced; protected voices (hit confirmation,
114
+ * announcer, warnings) go last. Voices are reclaimed by the time they were scheduled to
115
+ * end, not by `onended`, because the event loop that delivers `onended` is the thing a
116
+ * busy game starves.
117
+ */
118
+ export function createVoicePool(chain, { max = 48, stealFadeSeconds = 0.006 } = {}) {
119
+ const ctx = chain.ctx;
120
+ const voices = new Set();
121
+ const stats = { played: 0, stolen: 0, refused: 0 };
122
+
123
+ function release(voice, at) {
124
+ voice.gain.gain.cancelScheduledValues(at);
125
+ voice.gain.gain.setValueAtTime(voice.gain.gain.value, at);
126
+ voice.gain.gain.linearRampToValueAtTime(0, at + stealFadeSeconds);
127
+ try { voice.source.stop(at + stealFadeSeconds); } catch { /* already stopped */ }
128
+ voice.until = at + stealFadeSeconds;
129
+ voice.released = true;
130
+ }
131
+ function reap(now) { for (const voice of voices) if (voice.until > 0 && voice.until <= now) { voices.delete(voice); voice.gain.disconnect(); } }
132
+ /** Loudness as heard: the voice's own gain times its bus volume, after its scheduled fades. */
133
+ const heard = (voice) => voice.gain.gain.value * chain.input(voice.bus).gain.value;
134
+
135
+ return {
136
+ stats,
137
+ get active() { return voices.size; },
138
+ play(buffer, { bus = "sfx", gain = 1, rate = 1, when = 0, priority = 0, protect = false } = {}) {
139
+ const now = ctx.currentTime;
140
+ reap(now);
141
+ const live = [...voices].filter((voice) => !voice.released);
142
+ let stoleNow = false;
143
+ if (live.length >= max) {
144
+ const candidates = live.filter((voice) => !voice.protect && (voice.priority <= priority || protect));
145
+ const pool = candidates.length ? candidates : protect ? live.filter((voice) => voice.priority <= priority) : [];
146
+ if (!pool.length) { stats.refused++; return null; }
147
+ const quietest = pool.reduce((a, b) => (heard(b) < heard(a) ? b : a));
148
+ release(quietest, now);
149
+ stats.stolen++;
150
+ stoleNow = true;
151
+ }
152
+ const source = ctx.createBufferSource();
153
+ source.buffer = buffer;
154
+ source.playbackRate.value = rate;
155
+ const amp = ctx.createGain();
156
+ amp.gain.value = gain;
157
+ source.connect(amp); amp.connect(chain.input(bus));
158
+ const start = Math.max(now, when);
159
+ const voice = { source, gain: amp, bus, priority, protect, released: false,
160
+ until: buffer && !source.loop ? start + buffer.duration / Math.max(rate, 1e-3) : 0 };
161
+ // The stolen voice fades first; the new one starts after it so the two never sum.
162
+ source.start(stoleNow ? Math.max(start, now + stealFadeSeconds) : start);
163
+ voices.add(voice);
164
+ stats.played++;
165
+ return { stop: () => release(voice, ctx.currentTime), voice };
166
+ },
167
+ stopAll() { const now = ctx.currentTime; for (const voice of voices) if (!voice.released) release(voice, now); },
168
+ };
169
+ }
170
+
171
+ /* ------------------------------------------------------------------------------------
172
+ * Self-test. A small recording stand-in for an AudioContext: it keeps the graph and the
173
+ * scheduled automation so the properties can be measured without a sound card. The same
174
+ * checks run against a real context's chain in a browser, because they only read what
175
+ * this file built.
176
+ * ---------------------------------------------------------------------------------- */
177
+
178
+ class FakeParam {
179
+ constructor(value) { this.value = value; this.events = []; }
180
+ setValueAtTime(v, t) { this.events.push({ type: "set", v, t }); if (t <= 0) this.value = v; return this; }
181
+ linearRampToValueAtTime(v, t) { this.events.push({ type: "ramp", v, t }); return this; }
182
+ setTargetAtTime(v) { this.value = v; return this; }
183
+ cancelScheduledValues(t) { this.events = this.events.filter((e) => e.t < t); return this; }
184
+ /** Evaluates set and linear-ramp automation at time t. */
185
+ at(t) {
186
+ let value = this.value, time = -Infinity;
187
+ for (const e of [...this.events].sort((a, b) => a.t - b.t)) {
188
+ if (e.t > t) { if (e.type === "ramp") return value + (e.v - value) * ((t - time) / (e.t - time)); break; }
189
+ value = e.v; time = e.t;
190
+ }
191
+ return value;
192
+ }
193
+ }
194
+ class FakeNode {
195
+ constructor(kind) { this.kind = kind; this.outputs = new Set(); }
196
+ connect(node) { this.outputs.add(node); return node; }
197
+ disconnect() { this.outputs.clear(); }
198
+ }
199
+ export function createFakeAudioContext() {
200
+ const ctx = { currentTime: 0, destination: new FakeNode("destination") };
201
+ ctx.createGain = () => Object.assign(new FakeNode("gain"), { gain: new FakeParam(1) });
202
+ ctx.createDynamicsCompressor = () => Object.assign(new FakeNode("compressor"), Object.fromEntries(["threshold", "knee", "ratio", "attack", "release"].map((k) => [k, new FakeParam(0)])));
203
+ ctx.createWaveShaper = () => Object.assign(new FakeNode("shaper"), { curve: null, oversample: "none" });
204
+ ctx.createBufferSource = () => Object.assign(new FakeNode("source"), { buffer: null, loop: false, playbackRate: new FakeParam(1), startedAt: null, stoppedAt: null,
205
+ start(t) { this.startedAt = t; }, stop(t) { this.stoppedAt = t; } });
206
+ return ctx;
207
+ }
208
+
209
+ /** Every route from `node` to the destination, as lists of nodes. */
210
+ function routes(node, destination, path = []) {
211
+ if (node === destination) return [[...path, node]];
212
+ if (path.includes(node)) return [];
213
+ return [...node.outputs].flatMap((next) => routes(next, destination, [...path, node]));
214
+ }
215
+
216
+ /**
217
+ * The properties a mix depends on, read from a built chain. Returns failures.
218
+ * `ctx` must be the context the chain was built on.
219
+ */
220
+ export function chainProperties(chain) {
221
+ const failures = [];
222
+ const { ctx } = chain;
223
+ for (const [name, input] of Object.entries(chain.buses)) {
224
+ const all = routes(input, ctx.destination);
225
+ if (!all.length) failures.push(`bus ${name} never reaches the output`);
226
+ for (const route of all) {
227
+ const li = route.indexOf(chain.limiter), ci = route.indexOf(chain.clip);
228
+ if (li < 0 || ci < 0 || ci < li) failures.push(`bus ${name} reaches the output without passing the limiter and then the soft clip`);
229
+ }
230
+ }
231
+ if (routes(chain.makeup, chain.limiter).length === 0) failures.push("make-up gain is not before the limiter, so the limiter threshold is not the ceiling");
232
+ const curve = chain.clip.curve;
233
+ if (!curve) failures.push("soft clip has no curve");
234
+ else {
235
+ let previous = -Infinity, peak = 0;
236
+ for (const y of curve) { if (y < previous - 1e-7) { failures.push("soft clip curve is not monotonic"); break; } previous = y; peak = Math.max(peak, Math.abs(y)); }
237
+ if (peak > 0.98) failures.push(`soft clip reaches ${peak.toFixed(3)}; it should stay below its ceiling`);
238
+ const quiet = Math.pow(10, -8 / 20), index = Math.round(((quiet + 1) / 2) * (curve.length - 1));
239
+ const x = (index / (curve.length - 1)) * 2 - 1, gainDb = 20 * Math.log10(curve[index] / x);
240
+ if (Math.abs(gainDb) > 0.1) failures.push(`soft clip changes a -8 dBFS signal by ${gainDb.toFixed(2)} dB; it should pass quiet sound unchanged`);
241
+ }
242
+ return failures;
243
+ }
244
+
245
+ /** True when a duck leaves the causing sound at full level until its lead has passed. */
246
+ export function duckHoldsLead(chain, bus = "music", leadSeconds = CHAIN_DEFAULTS.duck.leadSeconds) {
247
+ chain.ctx.currentTime = 10;
248
+ chain.duck(bus, 9, 0.5);
249
+ const param = chain.ducks[bus].gain;
250
+ return Math.abs(param.at(10 + leadSeconds * 0.8) - 1) < 1e-6 && param.at(10 + leadSeconds + 0.2) < 0.5;
251
+ }
252
+
253
+ /** Fills a six-voice pool, plays one more, and reports which voice was stolen and how. */
254
+ export function stealBehaviour(makePool, chain) {
255
+ const pool = makePool(chain);
256
+ const buffer = { duration: 2 };
257
+ chain.ctx.currentTime = 1;
258
+ const gains = [0.9, 0.2, 0.7, 0.05, 0.8, 0.6];
259
+ const handles = gains.map((gain, i) => pool.play(buffer, { bus: i === 3 ? "ui" : "sfx", gain, protect: i === 3 }));
260
+ pool.play(buffer, { bus: "sfx", gain: 1 });
261
+ const stolen = handles.filter((h) => h && h.voice.released).map((h) => h.voice);
262
+ const victim = stolen[0];
263
+ const now = chain.ctx.currentTime;
264
+ return {
265
+ count: stolen.length,
266
+ gain: victim ? victim.gain.gain.value : null,
267
+ protectedStolen: stolen.some((v) => v.protect),
268
+ fadeSeconds: victim ? (victim.source.stoppedAt ?? now) - now : null,
269
+ fadeEndsAtZero: victim ? victim.gain.gain.at(now + 0.0061) === 0 && victim.gain.gain.at(now + 0.003) > 0 : false,
270
+ };
271
+ }
272
+
273
+ /** What a player would hear wrong in a steal: the wrong voice, a protected one, or a click. */
274
+ export function stealFailures(steal) {
275
+ const failures = [];
276
+ if (steal.count !== 1) failures.push(`stealing released ${steal.count} voices for one new sound`);
277
+ if (steal.gain !== 0.2) failures.push(`stole a voice at gain ${steal.gain}; the quietest unprotected voice was 0.2`);
278
+ if (steal.protectedStolen) failures.push("stole a protected voice while unprotected ones were playing");
279
+ if (!(Math.abs(steal.fadeSeconds - 0.006) < 1e-9) || !steal.fadeEndsAtZero) failures.push("a stolen voice was not faded to zero over 6 ms before stopping");
280
+ return failures;
281
+ }
282
+
283
+ /** The pool most games start with: the oldest voice goes, with a hard stop. */
284
+ function plantedOldestPool(chain) {
285
+ const played = [];
286
+ return {
287
+ play(buffer, { bus = "sfx", gain = 1, protect = false } = {}) {
288
+ const now = chain.ctx.currentTime;
289
+ if (played.length >= 6) {
290
+ const first = played.shift();
291
+ first.voice.released = true;
292
+ first.voice.gain.gain.setValueAtTime(0, now);
293
+ first.voice.source.stop(now);
294
+ }
295
+ const source = chain.ctx.createBufferSource(), amp = chain.ctx.createGain();
296
+ amp.gain.value = gain; source.connect(amp); amp.connect(chain.input(bus)); source.start(now);
297
+ const handle = { voice: { source, gain: amp, protect, released: false } };
298
+ played.push(handle);
299
+ return handle;
300
+ },
301
+ };
302
+ }
303
+
304
+ export function selfTest() {
305
+ const failures = [];
306
+ const fresh = (options) => createMasterChain(createFakeAudioContext(), options);
307
+
308
+ // Planted: a bus wired straight to the output, around the limiter.
309
+ const bypass = fresh(); bypass.ducks.sfx.connect(bypass.ctx.destination);
310
+ if (!chainProperties(bypass).some((f) => f.includes("bus sfx"))) failures.push("planted bus bypass was not caught");
311
+ // Planted: a tanh curve scaled to its ceiling, which adds about 4.5 dB to quiet sound.
312
+ const loud = fresh(); const K = 1.6, norm = 0.97 / Math.tanh(K);
313
+ loud.clip.curve = Float32Array.from({ length: 4097 }, (_, i) => Math.tanh(((i / 4096) * 2 - 1) * K) * norm);
314
+ if (!chainProperties(loud).some((f) => f.includes("-8 dBFS"))) failures.push("planted gain-adding clip curve was not caught");
315
+ // Planted: a duck with no lead.
316
+ if (duckHoldsLead(fresh({ duck: { ...CHAIN_DEFAULTS.duck, leadSeconds: 0 } }))) failures.push("planted duck without a lead was not caught");
317
+ // Planted: the oldest voice stolen with a hard stop.
318
+ if (!stealFailures(stealBehaviour(plantedOldestPool, fresh())).length) failures.push("planted oldest-voice pool was not caught");
319
+
320
+ // The real chain.
321
+ failures.push(...chainProperties(fresh()));
322
+ if (!duckHoldsLead(fresh())) failures.push("duck lowers the bus before its lead has passed");
323
+ failures.push(...stealFailures(stealBehaviour((chain) => createVoicePool(chain, { max: 6 }), fresh())));
324
+ return { ok: failures.length === 0, examined: 7, failures };
325
+ }