[gameprogrammer] Re: Sound Manager System

Let the sound play out. Otherwise if you entered the max distance and left and entered again before the sound was done it would sound strange. If it's a short looping sound you might just stop it entirely.

To have every entity check against every sound is O(n*m), or an exponential cost. I would use some kind of scene manager for fast culling. As 3D engines already have scene managers, you could tie into that. If you want to use your own, RakNet actually has one that is freely available found in Source/GridSectorizer.h/.cpp. It's a 2D grid that allows you to find all nearby objects given an existing object at an O(1) cost to lookup and populate (though O(n) for all your objects). It also supports object size.

Husam Zakaria wrote:
Hi every one . . .
I am working on a SoundManager System for my game engine with DirectSound in C++ . . . I have built a sound playing system ( 2D ) and ( 3D ) with support for streaming if the sound file is big, and link it with a resource manager for the sound files so I don't have to reload the same wave file for every sound that use the same file. for every 3D sound we have min distance and max distance so I can not here this sound if the distance between the listener and the 3D sound is bigger than the max distance of the sound my question is do I have in this case to only pause the sound and then play the sound when I enter the range agine? or I should stop it ( reset the sound to the beginning ) until I enter the range so play the sound from the beginning? what other game engines do for this case? another question is when I have the 3D sound entities in the level, do I have to built a scene manager system for those entities for distance checking in every frame update? or just iterate through all the 3D sounds entities and check for there distance from the listener? hope I can find a good help. thank you.
greeting...

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: