Sound Paths

Published July 07, 2009
Advertisement
Ran some in-game profiling over the past couple of days and found sound pathing tracing taking more time than I'd like.

Ancient Galaxy has a system to trace sounds from their source through portals into other cells, and then to the listener itself. This has the effect of making sounds appear to come through portals rather than a straight shot from the sound source if the listener is at least one room away from the sound.

It works really well most of the time, but can be a bit expensive to trace the sound paths from room to room every so often.

I was considering adding a precomputed data structure to speed this up. Basically the sound path goes

SoundSource->Portal->Through Cell->Portal->Through Cell->Portal->Listener

The paths are re-computed every so often, if the sound source moves or the sound is a looping sound.

I realized, though, that only the SoundSource->Portal and Portal->Listener parts need to be recomputed. The interior part, which could be 7-12 rooms longin some cases, doesn't need to be recomputed, and could actually be cached or completely precomputed. Each Cell or Portal could store its potentially connected portals, up the the limit of some level-specific sound distance cut-off. That way, only the ends of the sound path would by dynamic.

It turned out, though, that looped sounds were getting recomputed every frame, rather than only several times per second, so after fixing that, it doesn't look like I will need to speed things up any further in this regard.

In the future, I'd like to revisit this part of the engine and add environmental effects.

Also sped up the particle system, a couple of camera tweaks, and confirmed that the re-factored AI is still working well...


Previous Entry Stately Progress
Next Entry AI & Camera Tweaks
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

1.2 Almost ready...

1122 views

Sound Paths

1339 views

Stately Progress

1140 views

State Lines

1290 views

Pulsing

875 views

Return to The Ship!

1014 views

Cameras & Boxes

1132 views
Advertisement