@zigrivers/scaffold 3.4.0 → 3.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 (194) hide show
  1. package/README.md +411 -7
  2. package/content/knowledge/game/game-accessibility.md +328 -0
  3. package/content/knowledge/game/game-ai-patterns.md +542 -0
  4. package/content/knowledge/game/game-asset-pipeline.md +359 -0
  5. package/content/knowledge/game/game-audio-design.md +342 -0
  6. package/content/knowledge/game/game-binary-vcs-strategy.md +396 -0
  7. package/content/knowledge/game/game-design-document.md +260 -0
  8. package/content/knowledge/game/game-domain-patterns.md +297 -0
  9. package/content/knowledge/game/game-economy-design.md +355 -0
  10. package/content/knowledge/game/game-engine-selection.md +242 -0
  11. package/content/knowledge/game/game-input-systems.md +357 -0
  12. package/content/knowledge/game/game-level-content-design.md +455 -0
  13. package/content/knowledge/game/game-liveops-analytics.md +280 -0
  14. package/content/knowledge/game/game-localization.md +323 -0
  15. package/content/knowledge/game/game-milestone-definitions.md +337 -0
  16. package/content/knowledge/game/game-modding-ugc.md +390 -0
  17. package/content/knowledge/game/game-narrative-design.md +404 -0
  18. package/content/knowledge/game/game-networking.md +391 -0
  19. package/content/knowledge/game/game-performance-budgeting.md +378 -0
  20. package/content/knowledge/game/game-platform-certification.md +417 -0
  21. package/content/knowledge/game/game-project-structure.md +360 -0
  22. package/content/knowledge/game/game-save-systems.md +452 -0
  23. package/content/knowledge/game/game-testing-strategy.md +470 -0
  24. package/content/knowledge/game/game-ui-patterns.md +475 -0
  25. package/content/knowledge/game/game-vr-ar-design.md +313 -0
  26. package/content/knowledge/review/review-art-bible.md +305 -0
  27. package/content/knowledge/review/review-game-design.md +303 -0
  28. package/content/knowledge/review/review-game-economy.md +272 -0
  29. package/content/knowledge/review/review-netcode.md +280 -0
  30. package/content/knowledge/review/review-platform-cert.md +341 -0
  31. package/content/methodology/custom-defaults.yml +25 -0
  32. package/content/methodology/deep.yml +25 -0
  33. package/content/methodology/game-overlay.yml +145 -0
  34. package/content/methodology/mvp.yml +25 -0
  35. package/content/pipeline/architecture/ai-behavior-design.md +87 -0
  36. package/content/pipeline/architecture/netcode-spec.md +86 -0
  37. package/content/pipeline/architecture/review-netcode.md +78 -0
  38. package/content/pipeline/foundation/performance-budgets.md +91 -0
  39. package/content/pipeline/modeling/narrative-bible.md +84 -0
  40. package/content/pipeline/pre/game-design-document.md +89 -0
  41. package/content/pipeline/pre/review-gdd.md +74 -0
  42. package/content/pipeline/quality/analytics-telemetry.md +98 -0
  43. package/content/pipeline/quality/live-ops-plan.md +99 -0
  44. package/content/pipeline/quality/platform-cert-prep.md +129 -0
  45. package/content/pipeline/quality/playtest-plan.md +83 -0
  46. package/content/pipeline/specification/art-bible.md +87 -0
  47. package/content/pipeline/specification/audio-design.md +96 -0
  48. package/content/pipeline/specification/content-structure-design.md +141 -0
  49. package/content/pipeline/specification/economy-design.md +104 -0
  50. package/content/pipeline/specification/game-accessibility.md +82 -0
  51. package/content/pipeline/specification/game-ui-spec.md +97 -0
  52. package/content/pipeline/specification/input-controls-spec.md +81 -0
  53. package/content/pipeline/specification/localization-plan.md +113 -0
  54. package/content/pipeline/specification/modding-ugc-spec.md +116 -0
  55. package/content/pipeline/specification/online-services-spec.md +104 -0
  56. package/content/pipeline/specification/review-economy.md +87 -0
  57. package/content/pipeline/specification/review-game-ui.md +73 -0
  58. package/content/pipeline/specification/save-system-spec.md +116 -0
  59. package/dist/cli/commands/adopt.d.ts.map +1 -1
  60. package/dist/cli/commands/adopt.js +25 -0
  61. package/dist/cli/commands/adopt.js.map +1 -1
  62. package/dist/cli/commands/adopt.test.js +28 -1
  63. package/dist/cli/commands/adopt.test.js.map +1 -1
  64. package/dist/cli/commands/build.test.js +3 -0
  65. package/dist/cli/commands/build.test.js.map +1 -1
  66. package/dist/cli/commands/init.d.ts +1 -0
  67. package/dist/cli/commands/init.d.ts.map +1 -1
  68. package/dist/cli/commands/init.js +6 -0
  69. package/dist/cli/commands/init.js.map +1 -1
  70. package/dist/cli/commands/init.test.js +12 -1
  71. package/dist/cli/commands/init.test.js.map +1 -1
  72. package/dist/cli/commands/knowledge.test.js +8 -0
  73. package/dist/cli/commands/knowledge.test.js.map +1 -1
  74. package/dist/cli/commands/next.d.ts.map +1 -1
  75. package/dist/cli/commands/next.js +19 -5
  76. package/dist/cli/commands/next.js.map +1 -1
  77. package/dist/cli/commands/next.test.js +56 -0
  78. package/dist/cli/commands/next.test.js.map +1 -1
  79. package/dist/cli/commands/rework.d.ts.map +1 -1
  80. package/dist/cli/commands/rework.js +11 -2
  81. package/dist/cli/commands/rework.js.map +1 -1
  82. package/dist/cli/commands/rework.test.js +5 -0
  83. package/dist/cli/commands/rework.test.js.map +1 -1
  84. package/dist/cli/commands/run.d.ts.map +1 -1
  85. package/dist/cli/commands/run.js +54 -4
  86. package/dist/cli/commands/run.js.map +1 -1
  87. package/dist/cli/commands/run.test.js +384 -0
  88. package/dist/cli/commands/run.test.js.map +1 -1
  89. package/dist/cli/commands/skip.test.js +3 -0
  90. package/dist/cli/commands/skip.test.js.map +1 -1
  91. package/dist/cli/commands/status.d.ts.map +1 -1
  92. package/dist/cli/commands/status.js +16 -3
  93. package/dist/cli/commands/status.js.map +1 -1
  94. package/dist/cli/commands/status.test.js +55 -0
  95. package/dist/cli/commands/status.test.js.map +1 -1
  96. package/dist/cli/output/auto.d.ts +3 -0
  97. package/dist/cli/output/auto.d.ts.map +1 -1
  98. package/dist/cli/output/auto.js +9 -0
  99. package/dist/cli/output/auto.js.map +1 -1
  100. package/dist/cli/output/context.d.ts +6 -0
  101. package/dist/cli/output/context.d.ts.map +1 -1
  102. package/dist/cli/output/context.js.map +1 -1
  103. package/dist/cli/output/context.test.js +87 -0
  104. package/dist/cli/output/context.test.js.map +1 -1
  105. package/dist/cli/output/error-display.test.js +3 -0
  106. package/dist/cli/output/error-display.test.js.map +1 -1
  107. package/dist/cli/output/interactive.d.ts +3 -0
  108. package/dist/cli/output/interactive.d.ts.map +1 -1
  109. package/dist/cli/output/interactive.js +76 -0
  110. package/dist/cli/output/interactive.js.map +1 -1
  111. package/dist/cli/output/json.d.ts +3 -0
  112. package/dist/cli/output/json.d.ts.map +1 -1
  113. package/dist/cli/output/json.js +9 -0
  114. package/dist/cli/output/json.js.map +1 -1
  115. package/dist/config/loader.d.ts.map +1 -1
  116. package/dist/config/loader.js +3 -2
  117. package/dist/config/loader.js.map +1 -1
  118. package/dist/config/schema.d.ts +641 -15
  119. package/dist/config/schema.d.ts.map +1 -1
  120. package/dist/config/schema.js +26 -1
  121. package/dist/config/schema.js.map +1 -1
  122. package/dist/config/schema.test.js +192 -1
  123. package/dist/config/schema.test.js.map +1 -1
  124. package/dist/core/assembly/overlay-loader.d.ts +24 -0
  125. package/dist/core/assembly/overlay-loader.d.ts.map +1 -0
  126. package/dist/core/assembly/overlay-loader.js +190 -0
  127. package/dist/core/assembly/overlay-loader.js.map +1 -0
  128. package/dist/core/assembly/overlay-loader.test.d.ts +2 -0
  129. package/dist/core/assembly/overlay-loader.test.d.ts.map +1 -0
  130. package/dist/core/assembly/overlay-loader.test.js +106 -0
  131. package/dist/core/assembly/overlay-loader.test.js.map +1 -0
  132. package/dist/core/assembly/overlay-resolver.d.ts +15 -0
  133. package/dist/core/assembly/overlay-resolver.d.ts.map +1 -0
  134. package/dist/core/assembly/overlay-resolver.js +58 -0
  135. package/dist/core/assembly/overlay-resolver.js.map +1 -0
  136. package/dist/core/assembly/overlay-resolver.test.d.ts +2 -0
  137. package/dist/core/assembly/overlay-resolver.test.d.ts.map +1 -0
  138. package/dist/core/assembly/overlay-resolver.test.js +246 -0
  139. package/dist/core/assembly/overlay-resolver.test.js.map +1 -0
  140. package/dist/core/assembly/overlay-state-resolver.d.ts +26 -0
  141. package/dist/core/assembly/overlay-state-resolver.d.ts.map +1 -0
  142. package/dist/core/assembly/overlay-state-resolver.js +63 -0
  143. package/dist/core/assembly/overlay-state-resolver.js.map +1 -0
  144. package/dist/core/assembly/overlay-state-resolver.test.d.ts +2 -0
  145. package/dist/core/assembly/overlay-state-resolver.test.d.ts.map +1 -0
  146. package/dist/core/assembly/overlay-state-resolver.test.js +256 -0
  147. package/dist/core/assembly/overlay-state-resolver.test.js.map +1 -0
  148. package/dist/core/assembly/preset-loader.d.ts +1 -0
  149. package/dist/core/assembly/preset-loader.d.ts.map +1 -1
  150. package/dist/core/assembly/preset-loader.js +2 -0
  151. package/dist/core/assembly/preset-loader.js.map +1 -1
  152. package/dist/core/dependency/eligibility.test.js +3 -0
  153. package/dist/core/dependency/eligibility.test.js.map +1 -1
  154. package/dist/e2e/game-pipeline.test.d.ts +10 -0
  155. package/dist/e2e/game-pipeline.test.d.ts.map +1 -0
  156. package/dist/e2e/game-pipeline.test.js +298 -0
  157. package/dist/e2e/game-pipeline.test.js.map +1 -0
  158. package/dist/e2e/init.test.js +3 -0
  159. package/dist/e2e/init.test.js.map +1 -1
  160. package/dist/project/adopt.d.ts +3 -1
  161. package/dist/project/adopt.d.ts.map +1 -1
  162. package/dist/project/adopt.js +29 -1
  163. package/dist/project/adopt.js.map +1 -1
  164. package/dist/project/adopt.test.js +51 -1
  165. package/dist/project/adopt.test.js.map +1 -1
  166. package/dist/types/config.d.ts +50 -4
  167. package/dist/types/config.d.ts.map +1 -1
  168. package/dist/types/config.test.d.ts +2 -0
  169. package/dist/types/config.test.d.ts.map +1 -0
  170. package/dist/types/config.test.js +97 -0
  171. package/dist/types/config.test.js.map +1 -0
  172. package/dist/utils/eligible.d.ts +3 -2
  173. package/dist/utils/eligible.d.ts.map +1 -1
  174. package/dist/utils/eligible.js +18 -4
  175. package/dist/utils/eligible.js.map +1 -1
  176. package/dist/utils/errors.d.ts +4 -0
  177. package/dist/utils/errors.d.ts.map +1 -1
  178. package/dist/utils/errors.js +31 -0
  179. package/dist/utils/errors.js.map +1 -1
  180. package/dist/utils/errors.test.js +4 -1
  181. package/dist/utils/errors.test.js.map +1 -1
  182. package/dist/wizard/questions.d.ts +4 -0
  183. package/dist/wizard/questions.d.ts.map +1 -1
  184. package/dist/wizard/questions.js +59 -1
  185. package/dist/wizard/questions.js.map +1 -1
  186. package/dist/wizard/questions.test.js +178 -4
  187. package/dist/wizard/questions.test.js.map +1 -1
  188. package/dist/wizard/wizard.d.ts +1 -0
  189. package/dist/wizard/wizard.d.ts.map +1 -1
  190. package/dist/wizard/wizard.js +4 -1
  191. package/dist/wizard/wizard.js.map +1 -1
  192. package/dist/wizard/wizard.test.js +102 -4
  193. package/dist/wizard/wizard.test.js.map +1 -1
  194. package/package.json +1 -1
@@ -0,0 +1,342 @@
1
+ ---
2
+ name: game-audio-design
3
+ description: Wwise vs FMOD selection, bus hierarchy, spatial audio, adaptive music systems, VO pipeline, and platform loudness targets
4
+ topics: [game-dev, audio, fmod, wwise, spatial-audio, adaptive-music]
5
+ ---
6
+
7
+ Game audio is not background decoration — it is a primary feedback channel that communicates game state, spatial awareness, emotional tone, and mechanical timing to the player. A gunshot tells the player where the enemy is, how far away they are, and what weapon they are using. Adaptive music builds tension before the player consciously recognizes danger. Missing or poorly mixed audio creates a hollow, unfinished experience that players feel even if they cannot articulate why. Audio architecture decisions (middleware, bus hierarchy, adaptive systems) must be made early because they affect content pipelines, memory budgets, and CPU budgets throughout production.
8
+
9
+ ## Summary
10
+
11
+ ### Middleware Decision: Wwise vs FMOD
12
+
13
+ Both Wwise and FMOD are professional audio middleware that replace the engine's built-in audio system with far more capable tools. Choosing between them affects the audio team's workflow, licensing costs, and available features.
14
+
15
+ **FMOD Studio:**
16
+ - Lower learning curve; audio designers can be productive within days
17
+ - Generous indie licensing (free under $200K revenue)
18
+ - Clean C API with strong Unity and Unreal integration
19
+ - Event-based authoring with timeline and parameter-driven transitions
20
+ - Adequate spatial audio with listener-based panning and occlusion
21
+ - Good for indie through AA productions
22
+
23
+ **Wwise:**
24
+ - Steeper learning curve; full productivity takes weeks of training
25
+ - More complex licensing (free under $150K budget with limited sound count; tiered pricing above)
26
+ - Industry standard for AAA — most senior audio programmers have Wwise experience
27
+ - Superior spatial audio with Wwise Spatial Audio including room/portal modeling
28
+ - More powerful interactive music system (Music Segments, Stingers, Transitions)
29
+ - Advanced profiling tools (Wwise Profiler) for runtime debugging
30
+ - SoundSeed plugins for procedural audio (wind, impact, grain)
31
+
32
+ **Decision framework:**
33
+ - Team size 1–5 audio designers, budget under $500K: **FMOD**
34
+ - Team has AAA audio designers with Wwise experience: **Wwise**
35
+ - Game relies heavily on adaptive music and spatial audio as core mechanics: **Wwise**
36
+ - Rapid prototyping or game jam: **FMOD** (faster setup)
37
+ - Both are correct choices — the wrong choice is using the engine's built-in audio for a production game
38
+
39
+ ### Bus / Mixer Hierarchy
40
+
41
+ Audio buses (mixer groups) organize sounds into categories for independent volume control, effects processing, and ducking. A well-designed bus hierarchy is the foundation of a clean mix.
42
+
43
+ Standard hierarchy:
44
+ - **Master** (output)
45
+ - **Music** — adaptive score, menu music, stingers
46
+ - **SFX** — gameplay sound effects
47
+ - **Weapons** — gunshots, impacts, reload
48
+ - **Footsteps** — per-surface, per-character
49
+ - **Environment** — ambient beds, wind, rain, machinery
50
+ - **UI** — button clicks, notifications, menu transitions
51
+ - **Abilities** — spell effects, power-ups, special moves
52
+ - **Voice** — dialogue, barks, VO
53
+ - **Dialogue** — scripted narrative VO
54
+ - **Barks** — contextual combat/exploration callouts
55
+ - **Announcer** — game state announcements
56
+ - **Cinematics** — pre-rendered or in-engine cutscene audio (overrides normal mix)
57
+
58
+ Each bus should have: volume fader, mute/solo, low-pass/high-pass filter, compressor, and ducking sidechain inputs.
59
+
60
+ ### Loudness Standards
61
+
62
+ Platform holders and distribution channels enforce loudness standards. Non-compliant audio may cause certification failures.
63
+
64
+ - **Console (PlayStation, Xbox, Switch)**: -24 LUFS integrated, +/- 2 LU tolerance
65
+ - **PC (Steam, Epic)**: No enforcement, but -23 LUFS is the professional standard
66
+ - **Mobile (iOS, Android)**: Target -18 LUFS integrated (compensates for noisy environments and small speakers)
67
+ - **Streaming/Trailer**: -14 LUFS for YouTube/Twitch (louder to compete for attention)
68
+ - **VR**: -24 LUFS with very tight dynamic range (loud sounds in headphones cause discomfort)
69
+
70
+ Measure loudness with integrated LUFS metering over a representative gameplay session, not just peak levels. A game that averages -24 LUFS but has gunshots hitting -6 LUFS true peak will clip and distort.
71
+
72
+ ### Spatial Audio Fundamentals
73
+
74
+ Spatial audio places sounds in 3D space relative to the listener (camera or player character). It enables the player to locate threats, allies, and objectives by ear.
75
+
76
+ Key concepts:
77
+ - **Attenuation**: Sound volume decreases with distance. Linear, logarithmic, or custom curves.
78
+ - **Panning**: Stereo or surround placement based on angle to listener.
79
+ - **Occlusion**: Sounds behind walls are muffled (low-pass filtered and attenuated).
80
+ - **Obstruction**: A partial barrier between source and listener (e.g., crate) partially filters the sound.
81
+ - **Reverb zones**: Different environments (cave, hallway, outdoor) apply different reverb characteristics.
82
+ - **HRTF (Head-Related Transfer Function)**: Simulates how human ears perceive directionality. Essential for headphone playback and VR.
83
+
84
+ ## Deep Guidance
85
+
86
+ ### Adaptive Music Systems
87
+
88
+ Adaptive music responds to gameplay state in real-time, creating a dynamic soundtrack that matches the player's experience rather than looping a fixed track.
89
+
90
+ **Horizontal re-sequencing:**
91
+ - Music is composed in segments (intro, low tension, high tension, victory, defeat)
92
+ - The music system selects and sequences segments based on game state
93
+ - Transitions between segments use crossfades, transition segments, or beat-synced cuts
94
+ - Example: exploration segment loops until combat starts, then transitions to combat segment on the next bar line
95
+
96
+ **Vertical layering (additive mixing):**
97
+ - A single musical passage has multiple layers recorded simultaneously (drums, bass, melody, strings, percussion)
98
+ - Layers are added or removed based on game intensity
99
+ - Exploration: drums + bass only. Approaching danger: add melody. Full combat: all layers
100
+ - Advantages: seamless transitions (no segment switch), consistent harmonic content
101
+ - Disadvantages: all layers must work in every combination, limiting compositional freedom
102
+
103
+ **Stingers:**
104
+ - Short musical phrases triggered by specific game events (boss appearance, treasure found, death)
105
+ - Play over the current music, typically ducking the score briefly
106
+ - Must be composed in a compatible key/tempo or be atonal enough to work over anything
107
+ - Budget 10–30 stingers per game; overuse makes them less impactful
108
+
109
+ **Implementation pattern:**
110
+
111
+ ```csharp
112
+ // Adaptive music controller — vertical layering with FMOD parameters
113
+ // Attach to a persistent game object that survives scene loads
114
+
115
+ using UnityEngine;
116
+ using FMODUnity;
117
+ using FMOD.Studio;
118
+
119
+ public class AdaptiveMusicController : MonoBehaviour
120
+ {
121
+ [SerializeField] private EventReference musicEvent;
122
+
123
+ private EventInstance _musicInstance;
124
+ private PARAMETER_ID _intensityParamId;
125
+ private PARAMETER_ID _dangerParamId;
126
+
127
+ // Intensity: 0.0 = calm exploration, 1.0 = full combat
128
+ // Danger: 0.0 = safe, 1.0 = boss fight
129
+ // These drive vertical layer activation in the FMOD event
130
+
131
+ private float _currentIntensity;
132
+ private float _targetIntensity;
133
+ private const float IntensityLerpSpeed = 0.5f; // Smooth transitions
134
+
135
+ private void Start()
136
+ {
137
+ _musicInstance = RuntimeManager.CreateInstance(musicEvent);
138
+
139
+ // Cache parameter IDs for efficient per-frame updates
140
+ EventDescription desc;
141
+ _musicInstance.getDescription(out desc);
142
+
143
+ PARAMETER_DESCRIPTION paramDesc;
144
+ desc.getParameterDescriptionByName("Intensity", out paramDesc);
145
+ _intensityParamId = paramDesc.id;
146
+ desc.getParameterDescriptionByName("Danger", out paramDesc);
147
+ _dangerParamId = paramDesc.id;
148
+
149
+ _musicInstance.start();
150
+ }
151
+
152
+ private void Update()
153
+ {
154
+ // Smooth intensity transitions — avoid jarring mix changes
155
+ _currentIntensity = Mathf.Lerp(
156
+ _currentIntensity,
157
+ _targetIntensity,
158
+ IntensityLerpSpeed * Time.deltaTime
159
+ );
160
+ _musicInstance.setParameterByID(_intensityParamId, _currentIntensity);
161
+ }
162
+
163
+ // Called by combat system when threat level changes
164
+ public void SetCombatIntensity(float intensity)
165
+ {
166
+ _targetIntensity = Mathf.Clamp01(intensity);
167
+ }
168
+
169
+ // Called when entering/exiting boss encounters
170
+ public void SetDangerLevel(float danger)
171
+ {
172
+ _musicInstance.setParameterByID(_dangerParamId, danger);
173
+ }
174
+
175
+ // Trigger a stinger (one-shot musical phrase over the current score)
176
+ public void PlayStinger(EventReference stingerEvent)
177
+ {
178
+ // FMOD handles ducking the score via sidechain in the mixer
179
+ RuntimeManager.PlayOneShot(stingerEvent);
180
+ }
181
+
182
+ private void OnDestroy()
183
+ {
184
+ _musicInstance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
185
+ _musicInstance.release();
186
+ }
187
+ }
188
+ ```
189
+
190
+ ### Voice-Over Pipeline
191
+
192
+ Voice-over (VO) production is one of the most expensive and logistically complex aspects of game audio. A well-structured pipeline prevents re-records, miscast lines, and late-stage localization disasters.
193
+
194
+ **Pipeline stages:**
195
+ 1. **Script finalization**: Lock dialogue text before casting. Every change after recording costs studio time.
196
+ 2. **Casting**: Audition voice actors for each character. Record sample lines in the target emotional range.
197
+ 3. **Recording sessions**: Professional studio with consistent microphone and room treatment. Record at 48 kHz / 24-bit WAV minimum.
198
+ 4. **Editing**: Remove breaths (or reduce, not eliminate — breathless VO sounds robotic), normalize levels, remove noise. Apply consistent EQ per character.
199
+ 5. **Implementation**: Import into middleware, assign to dialogue events, set up subtitles, configure lip-sync data.
200
+ 6. **Localization**: Record all supported languages. Budget localization time equal to original language recording time.
201
+ 7. **QA**: Playthrough with every language enabled, checking for missing lines, incorrect triggers, subtitle mismatches, and audio clipping.
202
+
203
+ **File naming convention:**
204
+ - `{character}_{scene}_{lineID}_{take}.wav`
205
+ - Example: `npc_merchant_shop_0042_01.wav`
206
+ - Consistent naming enables automated import pipelines and batch processing
207
+
208
+ **Memory management for VO:**
209
+ - VO is typically the largest single audio asset category (hours of recorded dialogue)
210
+ - Stream from disk rather than loading into memory (except for combat barks that need instant playback)
211
+ - Pre-load upcoming dialogue lines during gameplay based on narrative triggers
212
+ - Compress with Vorbis/Opus at 96–128 kbps for production, 48 kbps for low-memory platforms
213
+ - Unload VO banks when leaving a narrative area
214
+
215
+ ### Audio Compression Per Platform
216
+
217
+ Different platforms have different memory, storage, and CPU constraints that affect audio format selection:
218
+
219
+ **Console (PS5, Xbox Series X, Switch):**
220
+ - Format: Platform-native compressed (Atrac9 on PlayStation, XMA on Xbox, ADPCM or Opus on Switch)
221
+ - Wwise/FMOD handle platform-specific encoding automatically during build
222
+ - Sample rate: 48 kHz for music and VO, 24 kHz acceptable for ambient SFX
223
+ - Channels: 5.1 or 7.1 master output for home theater; stereo for handheld Switch
224
+
225
+ **PC:**
226
+ - Format: Vorbis or Opus for compressed, PCM for low-latency SFX
227
+ - Sample rate: 48 kHz standard
228
+ - Channels: Support stereo, 5.1, and 7.1 output; detect and configure at runtime
229
+ - PC has the most memory headroom — use higher quality compression settings
230
+
231
+ **Mobile:**
232
+ - Format: AAC (iOS native), Vorbis/Opus (Android), ADPCM for low-latency SFX
233
+ - Sample rate: 44.1 kHz or 24 kHz to save memory
234
+ - Channels: Stereo only (mono for non-spatial SFX to halve memory)
235
+ - Aggressive compression: 64–96 kbps for music, 48 kbps for VO
236
+ - Budget total audio memory at 50–100 MB (compared to 500+ MB on console)
237
+
238
+ ### Sound Design Patterns for Gameplay
239
+
240
+ **Layered SFX construction:**
241
+ - Build complex sounds from multiple simple layers: a gunshot = transient (click/snap) + body (boom/crack) + tail (reverb/echo) + mechanical (bolt action)
242
+ - Each layer can vary independently for variety: 5 transients x 5 bodies x 3 tails = 75 unique combinations from 13 assets
243
+ - Randomize pitch (+/- 2 semitones) and volume (+/- 2 dB) per playback for further variation
244
+ - Never play the same exact sound twice in a row — the brain detects repetition instantly
245
+
246
+ **Priority and voice stealing:**
247
+ - Audio hardware has a limited number of simultaneous voices (typically 32–256 virtual voices)
248
+ - When the limit is reached, the system must steal the lowest-priority voice
249
+ - Priority order (highest to lowest): player weapon fire > VO dialogue > nearby enemy SFX > music > distant ambient
250
+ - Implement a priority system in middleware; configure max instances per event type (e.g., max 4 simultaneous footstep voices)
251
+
252
+ **Ducking and sidechain:**
253
+ - When important audio plays (VO, critical UI), duck less important buses (music, ambient)
254
+ - Implement via sidechain compression on the music bus keyed to the VO bus
255
+ - Duck by 6–12 dB during dialogue; fade duck in/out over 200–500 ms to avoid pumping artifacts
256
+ - Avoid ducking SFX during gameplay — players need spatial awareness from SFX even during dialogue
257
+
258
+ ### Reverb and Environment Design
259
+
260
+ ```yaml
261
+ # Reverb zone presets — configure per-area in the game world
262
+ # Values are approximate starting points; tune by ear in-game
263
+
264
+ reverb_presets:
265
+ outdoor_open:
266
+ decay_time: 0.8s
267
+ pre_delay: 10ms
268
+ wet_mix: 0.15
269
+ diffusion: 0.7
270
+ hf_damping: 0.3
271
+ notes: "Minimal reverb; sounds dissipate quickly"
272
+
273
+ outdoor_canyon:
274
+ decay_time: 2.5s
275
+ pre_delay: 40ms
276
+ wet_mix: 0.35
277
+ diffusion: 0.5
278
+ hf_damping: 0.4
279
+ notes: "Distinct echoes, longer decay, directional reflections"
280
+
281
+ indoor_small_room:
282
+ decay_time: 0.5s
283
+ pre_delay: 5ms
284
+ wet_mix: 0.25
285
+ diffusion: 0.8
286
+ hf_damping: 0.5
287
+ notes: "Tight, intimate; voices feel close"
288
+
289
+ indoor_large_hall:
290
+ decay_time: 3.0s
291
+ pre_delay: 25ms
292
+ wet_mix: 0.45
293
+ diffusion: 0.9
294
+ hf_damping: 0.3
295
+ notes: "Cavernous; footsteps echo, VO needs ducking"
296
+
297
+ underground_cave:
298
+ decay_time: 4.0s
299
+ pre_delay: 15ms
300
+ wet_mix: 0.55
301
+ diffusion: 0.6
302
+ hf_damping: 0.6
303
+ notes: "Heavy reverb, muffled high end, dripping emphasis"
304
+
305
+ underwater:
306
+ decay_time: 0.3s
307
+ pre_delay: 0ms
308
+ wet_mix: 0.7
309
+ diffusion: 1.0
310
+ hf_damping: 0.9
311
+ low_pass_cutoff: 800Hz
312
+ notes: "Extreme LPF, muted, disorienting"
313
+
314
+ metal_corridor:
315
+ decay_time: 1.2s
316
+ pre_delay: 8ms
317
+ wet_mix: 0.35
318
+ diffusion: 0.4
319
+ hf_damping: 0.1
320
+ notes: "Bright, ringing, metallic character"
321
+
322
+ # Implementation notes:
323
+ # - Blend between presets when crossing zone boundaries (over 0.5-1 second)
324
+ # - Use ray-traced or portal-based occlusion for realistic transitions
325
+ # - Wwise Rooms/Portals automate zone blending; FMOD uses snapshot blending
326
+ # - Apply reverb as a send effect, not an insert, to maintain dry signal clarity
327
+ ```
328
+
329
+ ### Audio Testing Checklist
330
+
331
+ Before shipping, verify the following across all target platforms:
332
+
333
+ 1. **Loudness compliance**: Measure integrated LUFS over a 30-minute representative session. Must be within platform tolerance.
334
+ 2. **Clipping/distortion**: Play the loudest possible gameplay scenario (explosion chain, multiple weapons, full music). No digital clipping on the master bus.
335
+ 3. **Missing audio**: Walk through every game state and transition. No silent gaps where audio should play.
336
+ 4. **Spatial accuracy**: Can the player locate enemies by sound alone with eyes closed? Test with headphones and speakers.
337
+ 5. **Ducking behavior**: Is dialogue always audible? Does music duck appropriately? Do critical gameplay sounds cut through?
338
+ 6. **Memory budget**: Monitor audio memory throughout a full play session. No leaks, no budget overruns.
339
+ 7. **CPU budget**: Audio should consume less than 10% of a single CPU core. Profile during the most audio-dense gameplay moment.
340
+ 8. **Platform output**: Test stereo, 5.1, 7.1, and headphone output on each platform. Verify surround panning works correctly.
341
+ 9. **Interruption handling**: On mobile, verify correct behavior when a phone call, alarm, or notification interrupts. Audio should pause and resume cleanly.
342
+ 10. **Localization**: Every localized VO line plays correctly, subtitles match, lip-sync is acceptable in all supported languages.