Sounds

Published July 11, 2009
Advertisement
No pictures again - still working on the sound system.

I've got the basics in place for my item-to-item collision sound system now. The basic idea is that everything has a "material" property, currently earth, wood and metal and there are a bunch of effects for the various combinations of collisions.

I then construct a 2D table that indexes the correct sound effect based on the two materials.

When debris receives a collision event, it submits it to the ImpactManager, which only stores it if there is not an existing event already stored that frame for the two IDs of the objects and as long as neither material is mtNone.

Then, at the end of the frame, the ImpactManager runs through the list and plays the sounds, modifying the volume based on the velocity of the impact.

The existing sound system then modulates the volume and pan of the sounds relative to Squishy's position.

The effects themselves are stored in AudioEffectRings, which basically duplicate the sound a certain number of times, then play them in a ring fashion, so that several instances of the same sound can be played at the same time. This is better than each object holding its own duplicated buffers, since that could get wildly out of control as we add more materials and lots of objects.

The system works really well, although the sound effects are a bit crap at the moment. You need to picture this - me sitting in my corner with a microphone, tapping a wooden spoon against a cheese grater while my girlfriend gives me strange and slightly concerned glances. Then again, she's the one watching the Katie Price/Piers Morgan interview, which to my mind is far, far more disturbing. [smile]
Previous Entry Update for the sake of it
Next Entry Distracted
0 likes 6 comments

Comments

rip-off
Can't wait to sample the results [grin]. Ok I'll stop now.
July 12, 2009 09:12 AM
Aardvajk
Quote:Original post by rip-off
Can't wait to sample the results [grin]. Ok I'll stop now.


*groan*
July 12, 2009 12:11 PM
Drilian
July 12, 2009 02:21 PM
HopeDagger
Quote:You need to picture this - me sitting in my corner with a microphone, tapping a wooden spoon against a cheese grater ...


Try not to worry about it -- this happens to me all of the time. And usually there isn't even a microphone involved. [grin]
July 13, 2009 07:55 AM
Aardvajk
Quote:Original post by HopeDagger
Quote:You need to picture this - me sitting in my corner with a microphone, tapping a wooden spoon against a cheese grater ...


Try not to worry about it -- this happens to me all of the time. And usually there isn't even a microphone involved. [grin]


[smile]
July 13, 2009 12:51 PM
Twisol
Wow, I haven't checked in here in quite a while. I'm impressed! It looks really fun, and I can't wait to see more :D
July 14, 2009 01:56 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement