
For the past few years I’ve been working on reverse engineering and remaking an almost 40 year old DOS game. Despite its age, I’m often surprised by the complexity and little tricks the game used, one of which is sound priority.
Here’s the deal: the game, Crystal Caves, uses PC speaker audio, an extremely primitive, single-channel technology that was mostly used for simple beeps and boops. In practice this meant you could only play one sound at a time. So what happens if two sound-emitting events happen together, like jumping while a rocket hits an enemy?
Well, every sound in Crystal Caves has a priority field, a number representing its relative importance. A sound will interrupt another that’s already playing only if its priority is higher. Simple and effective, and the player barely notices that only one sound is playing at a time.
Fast forward to 2006’s Company of Heroes, an RTS that boasts 128 “voices” (depending on game settings), and many sound emitters: infantry rifle cracks, tracked vehicle rumbles, unit shouts, distant artillery rumbles, rocket screeches, all on top of music and UI noises. With dozens of units possible onscreen and more offscreen, this can easily become an overwhelming cacophony, and yet the game’s audio is designed so that the player never misses the most important audio cues.
There’s an entire field of study on how this is made possible.
Read more

