Sound. Long.
Posted: 04 Dec 2006, 05:19
Very simply, we need more control over sounds, and I think it's high time it was all unified into one place.
Sounds are called in various places by Spring. Some of it is nearly perfect now. Some of it... er... not so perfect.
The sound code for weapons? It's nearly perfect. Volume control over distance works just wonderfully, once you know what you're doing.
Sound code for unit acknowledgements and other stuff? Not so great. It's globally controlled, has a global volume, and either drowns out everything else all the time, or is hard to hear.
Sound code that is working from the play-sound COB event? Well, it works, but control over distance is mysterious at best- we have one out've two variables with the weapon sounds to play with. This one thing, all by itself prevents us from having things like units that actually generate sounds during motion. I'd love to have turrets whine, feet stomp, hydraulics hiss, hear ammunition belts metalically slither as weapons reload... hear soldiers randomly say stuff to each other, (Unit One, running RestoreAfterDelay: "hey, did we get 'em all?" - Unit Two sights enemy, starts aimscript, "Look out! Here they come!") etc., etc., etc.
Good sound adds a LOT to a game's feel. I'd really like to increase the immersion factor for sound, but I lack the tools to do so.
What I think we need, frankly, is to have a section of Resources.tdf that deals with sounds and their parameters, and have all other things that can call sounds be directed back there... and from there, to the sound part of the engine. It's just like where we're going with bitmap data, and I think it would be awesome to go there with sound, and finally start moving away from the OTA-esque simplistic world of simple sound FX called by very discrete events.
How would this work? Well... you'd list all the sounds you'd use in your mod, just like all the bitmaps. Then you'd give them parameters, just like the parameters we can pass to sounds in Weapon files. Lastly, just like with bitmaps, you could call the same sound, give it two different aliases, and then call it in different contexts, using the different parameters for different things.
For example, you might have a very short, sharp "bang" that makes a great gun noise, and you want it to be loud and play over a long distance. But you might want to re-use that sound, and play it simultaneously, at a low volume and low distance, with some other sound, just to sharpen the tones a bit if people are close enough to the source- making the mixed sound have a bit of complex chunkiness to it, like real sounds do. The possibilities are nearly endless.
Doing things this way would have a lot of advantages. Sounds in COB scripts, and the sounds in the Interface code, could use the same aliases and parameters, which would probably be far more efficient than the current code.
And eventually, if we can move to a model for Features where they can execute a script, we could have things like ambient sounds by area, allowing us to do things like rushing water over a stream (with FX being called to suggest rapid water movement I swear I'm gonna keep saying that Features need to be able to execute COB scripts until somebody unifies them with Units and kills two birds with one stone) music loops being played at random over a city's lifeless streets, burning volcanoes putting out a pulsing, nearly-subsonic roar, etc...
Sounds are called in various places by Spring. Some of it is nearly perfect now. Some of it... er... not so perfect.
The sound code for weapons? It's nearly perfect. Volume control over distance works just wonderfully, once you know what you're doing.
Sound code for unit acknowledgements and other stuff? Not so great. It's globally controlled, has a global volume, and either drowns out everything else all the time, or is hard to hear.
Sound code that is working from the play-sound COB event? Well, it works, but control over distance is mysterious at best- we have one out've two variables with the weapon sounds to play with. This one thing, all by itself prevents us from having things like units that actually generate sounds during motion. I'd love to have turrets whine, feet stomp, hydraulics hiss, hear ammunition belts metalically slither as weapons reload... hear soldiers randomly say stuff to each other, (Unit One, running RestoreAfterDelay: "hey, did we get 'em all?" - Unit Two sights enemy, starts aimscript, "Look out! Here they come!") etc., etc., etc.
Good sound adds a LOT to a game's feel. I'd really like to increase the immersion factor for sound, but I lack the tools to do so.
What I think we need, frankly, is to have a section of Resources.tdf that deals with sounds and their parameters, and have all other things that can call sounds be directed back there... and from there, to the sound part of the engine. It's just like where we're going with bitmap data, and I think it would be awesome to go there with sound, and finally start moving away from the OTA-esque simplistic world of simple sound FX called by very discrete events.
How would this work? Well... you'd list all the sounds you'd use in your mod, just like all the bitmaps. Then you'd give them parameters, just like the parameters we can pass to sounds in Weapon files. Lastly, just like with bitmaps, you could call the same sound, give it two different aliases, and then call it in different contexts, using the different parameters for different things.
For example, you might have a very short, sharp "bang" that makes a great gun noise, and you want it to be loud and play over a long distance. But you might want to re-use that sound, and play it simultaneously, at a low volume and low distance, with some other sound, just to sharpen the tones a bit if people are close enough to the source- making the mixed sound have a bit of complex chunkiness to it, like real sounds do. The possibilities are nearly endless.
Doing things this way would have a lot of advantages. Sounds in COB scripts, and the sounds in the Interface code, could use the same aliases and parameters, which would probably be far more efficient than the current code.
And eventually, if we can move to a model for Features where they can execute a script, we could have things like ambient sounds by area, allowing us to do things like rushing water over a stream (with FX being called to suggest rapid water movement I swear I'm gonna keep saying that Features need to be able to execute COB scripts until somebody unifies them with Units and kills two birds with one stone) music loops being played at random over a city's lifeless streets, burning volcanoes putting out a pulsing, nearly-subsonic roar, etc...