Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

Way to lower priority of game object during its playback for long-tailed sounds

0 votes

I'd like to seek advice on a scheme of lowering priority of a game object during playback which I'd like to use in my game.

 
The idea is, I think it would be great for long-tailed sounds (weapon shots, explosions) to change their priority while their tail (volume) is gradually decreasing. But with the condition that priority offset at distance for these objects is also working.
 
Since there is such a probability like “set game parameter” in event actions and the possibility to change priority of the sound with RTPC, I have constructed the next scheme:
 
first – RTPC game parameter to change priority of a sound
and second – an event with the next three consecutive actions:
1 - reset game parameter (to restore priority of a game object after a previous “set game parameter” action)
2 - play shot sound (with slight action delay, e.g., 0.01 sec)
3 - set priority parameter (with fade in time to lower absolute value and also with action delay, slightly bigger than previous, e.g., 0.1 sec)
 
And my question is, is this scheme is a correct solution for my idea or maybe I have a mistake somewhere? I have tested it in Soundcaster and everything worked correctly, but who knows, maybe there are some pitfalls.
 
I guess I can also use a side-chain function with RTPC driven by weapon shot peak meter for more accurate values, but the main question is the cooperation of reset and set game parameter actions with distance offset and, the reasonableness of the whole scheme.
asked May 19, 2013 in General Discussion by Robert (390 points)
edited May 22, 2013 by Bernard R. (Audiokinetic)

1 Answer

0 votes
 
Best answer
It could be working, but there are some potential issues with driving priority with RTPC this way.

The RTPC value is per game object and not per sound instance, meaning that if you have the same game object playing an old and a new sound of the same type, both will be bound to the same priority value. Still it will work if you reset the RTPC at every playback but some old sound will be preserved with high priority if the same game object is playing new sounds. There could be a worst case scenario when a game object is playing a lot of sounds, but since a game object has same position all the time, sounds will have same distance priority offset and you should then specify in the priority options "when priority is equal, discard oldest sound".
answered May 22, 2013 by Alexandre L. (Audiokinetic) (1,520 points)
selected Jul 24, 2013 by Robert
Thank you for your comment, Alexandre.
Of course I will be using the options ""when priority is equal, discard oldest sound", I forgot to write about that.
I am a little bit confused with this your sentence: “Still it will work if you reset the RTPC at every playback but some old sound will be preserved with high priority if the same game object is playing new sounds.”
Could you explain it in more detail? I thought if I will use the action “gradually lower priority” and “reset previous priority” for each new sound than it will has bigger priority value than an old one.
RTPC values are per game object and not per sound instance.
for example, you have two characters walking around you in the level. each character is a game object.

The sound they are playing are footsteps. they are at similar distance from listener.
time 1: character 1 plays footstep first instance
time 2: character 2 plays footstep second instance
time 3: character 1 plays footstep third instance

We have 3 sounds palying, the first sound started to fade out, but since sound 3 was on same game object as sound 1, sound 3 will have the same priority RTPC offset as sound 1 since they both share the same game object, therefore soudn 2 will have lowest priority in your system.
Oh, now I understand, thanks a lot!
And because RTPC is per game object, sound 3 in your example will kill not sound 1 but sound 2, if there would be playback limit.
But, I guess it is not such a scary scenario in case if those two objects are using similar sounds.
...