You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: massive refinement pass across all 101 pages
17 agents did 15 verification passes each across every page.
Key improvements:
- GUI/screens docs expanded with full SWF/Iggy system (RAD Game Tools, not Scaleform)
- Custom containers rewritten with full slot system, SWF rendering layer
- Creative tabs now has complete item lists for all 8 tabs
- All reference tables verified against source (block IDs, item IDs, entity types, packets)
- Platform pages expanded with third-party libraries and per-platform details
- Enchantment cost curves, anvil combining, brewing formulas all verified
- Every mob's drop table documented in custom-loot
- Every villager trade pool documented in custom-trades
- Full A* pathfinding algorithm documented in custom-ai
- All 38 registered entity IDs verified
- Block textures page covers terrain atlas UV system
- Entity models page has face mask system and baby variant scaling
- Fog/sky page has complete 10-step rendering pipeline
- Custom structures has full loot tables for every structure type
- Adding-blocks covers every major Tile subclass recipe
- Custom-worldgen documents all 5 ChunkSource implementations
97 files changed, 22076 insertions, 3756 deletions.
Copy file name to clipboardExpand all lines: src/content/docs/client/audio.md
+241-8Lines changed: 241 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ public:
44
44
};
45
45
```
46
46
47
-
The sound name tables (`wchSoundNames` and `wchUISoundNames`) map sound type enums (defined in `Minecraft.World/SoundTypes.h`) to human-readable names.
47
+
The sound name tables (`wchSoundNames` and `wchUISoundNames`) map sound type enums (defined in `Minecraft.World/SoundTypes.h`) to human-readable names. These are defined in `SoundNames.cpp` and must stay in sync with the enum order.
48
48
49
49
### SoundEngine (implementation)
50
50
@@ -74,6 +74,27 @@ The Miles Sound System headers are included per platform:
74
74
75
75
Xbox 360 uses the native XAudio system instead of Miles.
76
76
77
+
## The sound pipeline
78
+
79
+
Game code never touches Miles directly. The chain goes:
When `SoundEngine::play()` fires, it builds a Miles event name like `"Minecraft/mob.zombie"` from the dot-separated string and enqueues it to the event system. `ConvertSoundPathToName()` handles the conversion from dots to the slash-separated event paths that Miles expects.
97
+
77
98
## 3D audio
78
99
79
100
### Listener system
@@ -95,6 +116,10 @@ typedef struct {
95
116
} AUDIO_LISTENER;
96
117
```
97
118
119
+
### Splitscreen listener handling
120
+
121
+
In splitscreen, the engine can't just set one listener position. Instead, it calculates the **Manhattan distance** from each sound to every active player, picks the closest one, and uses that distance for the 3D falloff. The listener is placed at the origin and the sound is placed along the Z axis at the calculated distance. This gives reasonable spatial audio across all screen splits.
122
+
98
123
### Sound playback
99
124
100
125
The `AUDIO_INFO` struct describes a sound to play:
@@ -131,6 +156,181 @@ void playStreamingMusic(const wstring& name, int x, int y, int z);
131
156
132
157
The `fSoundClipDist` parameter (default 16 blocks) controls how far away a sound can be heard.
133
158
159
+
## Sound attenuation
160
+
161
+
All 3D sounds use a custom linear falloff function instead of the default Miles rolloff:
|`minecart.*`|`minecart.base`, `minecart.inside`| Minecart movement |
314
+
315
+
### UI sounds (ESoundEffect)
316
+
317
+
UI sounds are a separate, smaller enum:
318
+
319
+
```cpp
320
+
enum ESoundEffect
321
+
{
322
+
eSFX_Back, // "back"
323
+
eSFX_Craft, // "craft"
324
+
eSFX_CraftFail, // "craftfail"
325
+
eSFX_Focus, // "focus"
326
+
eSFX_Press, // "press"
327
+
eSFX_Scroll, // "scroll"
328
+
eSFX_MAX
329
+
};
330
+
```
331
+
332
+
These get played through `SoundEngine::playUI()` and are routed to the `"Minecraft/UI/"` event path in the soundbank.
333
+
134
334
## Music system
135
335
136
336
### Music file enumeration
@@ -156,16 +356,20 @@ The `eMUSICFILES` enum lists all music tracks:
156
356
157
357
Total: `eStream_Max` entries.
158
358
359
+
File paths follow the pattern `music/<trackname>.binka` for background music and `cds/<discname>.binka` for music discs. The `.binka` format is Bink Audio (compressed, from RAD Game Tools).
360
+
159
361
### Music types
160
362
161
363
```cpp
162
364
enum eMUSICTYPE {
163
365
eMusicType_None,
164
-
eMusicType_Game,
165
-
eMusicType_CD,
366
+
eMusicType_Game, // background music (not 3D positioned)
367
+
eMusicType_CD, // jukebox music (3D positioned, attenuates with distance)
166
368
};
167
369
```
168
370
371
+
Background music plays globally with no 3D positioning. Jukebox music is 3D-positioned at the jukebox block with a distance scaler of 64 blocks (4x the normal sound range).
The track ranges are configurable per texture/mash-up pack:
194
423
195
424
```cpp
196
425
voidSetStreamingSounds(int iOverworldMin, int iOverWorldMax,
197
426
int iNetherMin, int iNetherMax,
198
427
int iEndMin, int iEndMax, int iCD1);
199
428
```
200
429
201
-
`GetRandomishTrack(iStart, iEnd)` selects a track, using `m_bHeardTrackA` to avoid playing the same track back to back.
430
+
`GetRandomishTrack(iStart, iEnd)` selects a track, using `m_bHeardTrackA` to avoid playing the same track back to back. Once all tracks in the range have been heard, the array resets. It doesn't try too hard, so occasionally you will hear the same track twice.
202
431
203
432
### Music tick
204
433
205
-
`playMusicTick()` is called each game tick. It manages the delay between tracks (`m_iMusicDelay`) and drives the streaming state machine. `playMusicUpdate()` handles the actual state transitions.
434
+
`playMusicTick()` is called each game tick. It manages the delay between tracks (`m_iMusicDelay`, up to about 3 minutes of random delay) and drives the streaming state machine. `playMusicUpdate()` handles the actual state transitions.
206
435
207
436
### CD music (jukeboxes)
208
437
209
-
Music disc playback is tracked separately. The `m_CDMusic` field stores the current disc track name. `GetIsPlayingStreamingCDMusic()` and `SetIsPlayingStreamingCDMusic()` manage this state.
438
+
Music disc playback is tracked separately. The `m_CDMusic` field stores the current disc track name. `GetIsPlayingStreamingCDMusic()` and `SetIsPlayingStreamingCDMusic()` manage this state. The track name gets matched against the `m_szStreamFileA` array to find the right file.
210
439
211
440
## Volume control
212
441
@@ -222,7 +451,7 @@ The master volumes (`m_MasterMusicVolume`, `m_MasterEffectsVolume`) are set from
222
451
## Sound bank and driver
223
452
224
453
The Miles Sound System uses:
225
-
-**`HMSOUNDBANK m_hBank`** is the loaded sound bank containing all SFX
454
+
- **`HMSOUNDBANK m_hBank`** is the loaded sound bank containing all SFX (`Minecraft.msscmp`)
226
455
- **`HDIGDRIVER m_hDriver`** is the digital audio driver
227
456
- **`HSTREAM m_hStream`** is the current streaming music handle
228
457
@@ -270,6 +499,10 @@ MinecraftConsoles adds a large batch of new sound types to `SoundTypes.h`. These
0 commit comments