Sign in to follow this  

Sound Management and Priority

This topic is 4374 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, I'm attempting to gain a high-level perspective of how sound resources (buffers, sources) should be managed in my game. I'd appreciate if anyone wouldn't mind poking holes in my logic :) (Eventually I see this also taking place with textures and models, so it's definitely something I want to address early on in the development stages.) 1 - We define a set of sound priorities (for purposes of this example, let's say critical > high > medium > low). 2 - Each time a sound or set of sounds are called upon, its load is assigned a priority, which represents how quickly its memory is recycled. 3 - At application launch-time, each "critical" priority sound is loaded into memory. We expect to keep these sounds around for the entire duration the application is active. Such sounds would usually be things like interface clicks, and anything specific to the application that might be needed at any point during the game. 4 - At game-load time (since it's a networked game, essentially when the client-state is sent from the server), any sounds that the player will likely use due to race, class, current equipment, current spells memorized, etc, are loaded with "high" priority. 5 - Every time a new sound source (e.g. creature/object) appears in the game (e.g. let's say our hero is walking through a town rife with NPCs), each sound that the source uses is loaded, and assigned "medium" priority. Once a creature/object moves out of earshot, its associated sounds are unloaded. 6 - Any other sounds required by the game (for example, one-shot events like explosions, a trap goes off, the character levels up, etc) are loaded on-demand, played, and recycled immediately after play-completion. Your thoughts?

Share this post


Link to post
Share on other sites
You're on the right track, but there can be performance issues there.

So a better way would be...

It would be a good idea to unify your resources into one system.

1. Like you say. Load all critical resources at startup. e.g.. Interface and resources common across most areas/maps.
2. At area/map transition compare non-critical resources between the 2 areas/maps then unload the resources that don't exist in the destination area/map and keep the resources that are required for the destination area/map. This way you reduce unneeded unloading/loading. Then finally load the additional resources which are in the destination area/map.
3. Any one-time only resources can be immediately unloaded. e.g.. Something an NPC says, or a building that gets destroyed.

I'm sure this method isn't perfect either. But I find it suits my needs very well.

Regards,
RaveniX.

Share this post


Link to post
Share on other sites
That's also a possibility, however in the game we're working on, there aren't any levels per se; since the map is tile-based, as a character traverses across the map, objects are loaded and unloaded on the fly.

I see what you're saying though; perhaps a 'halfway' method would be to keep sounds around for a period of time, and unload them if the perceived timeout in which they might be needed, expires.

Share this post


Link to post
Share on other sites

This topic is 4374 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this