mzsd
New Member
Posts: 10
Posts: 10
|
Post by mzsd on Jun 13, 2016 4:08:42 GMT
I read the manual section about DSG but couldn't exactly understand how it's working. For example a situation: I have a lot of various weapons in a game with multiplayer sessions and each session will have random weapons (depending on what players will choose). I understand that in this case I have to use DSG but how should I structure them? Should I create one general DSG object containing sound groups for all weapons and load them selectively? Or I have to create sepate DSG per weapon? And the second question, if I will be using Event sounds (as in this situation: link) to trigger these weapon sound groups, how can I use them in combination with DSG?
|
|
|
Post by DarkTonic Dev on Jun 13, 2016 15:54:25 GMT
You never "have to" use Dynamic SGC's. It's a choice, that makes sense if you don't want to have a huge amount of Sound Groups or if you want to use "audio skins".
A DGSC has to load all it's audio items, there is no selective load. It may make sense for you to use "audio skins" such as this: each weapon has a "weapon launch" and "weapon impact" Sound Group. You could place the DGSC on a game object that spawns when the weapon is activated.
EventSounds can play the sounds on a DGSC by copy/pasting the name of the Sound Group. Or you can place the DGSC in the Scene temporarily while you set up EventSounds (its Sound Groups will show up in the dropdown while it's in the Scene).
|
|
mzsd
New Member
Posts: 10
Posts: 10
|
Post by mzsd on Jun 14, 2016 3:06:09 GMT
Thanks for the answer. I understand about the DSGC now. But did't quite understand "audio skins". I tried to find about it in the manual but couldn't. Are you talking about some sort of switcher which can switch variations inside the same group via some tags or attributes? And I also have the second question. While I was trying to find info about "skins" I found this topic: darktonic.freeforums.net/thread/406/question-regarding-preloading-checkbox-persistencewhere you were writing that MA always unloads all audio clips from memory after clips finishing playing. Is it true? Because if it is, then how MA can handle very fast playing sounds where timing is crucial? For example fast weapon with randomly firing bursts? Constant load of unloaded sounds will cause delays which is impossible for normal weapon behaviour.
|
|
|
Post by DarkTonic Dev on Jun 14, 2016 3:50:10 GMT
Audio Skins means that you may have several versions of the same Sound Groups, each produced by a different Dynamic SGC. Each would be an audio skin. This is like the old WinAmp sound skins back in the day. For example, similar to what I described in the last post, you might have 4 different playable characters (think Mortal Kombat) each with their own Jump, Punch and Kick sounds. So each could have a DSGC that creates the Jump, Punch and Kick Sound Groups, each with different (if you want) audio clips. The code in all cases could play the Sound Groups by name and not need to worry about which audio skin has populated them with what. About the other thread, note that only audio clips that have "Preload audio data" = true (the default) can play immediately without latency, and those stay in memory forever until the Master Audio game object is destroyed, or if they are populated by a Dynamic SGC - then when it is disabled and the Sound Groups get removed from MA. You can also either turn off Preload audio data or configure Sound Groups using Resource files. Both of these options allow for memory savings because only while the sound is playing does it occupy memory, but it has latency while the sound is loaded prior to playing each time. How much latency is different per platform and depending on the size of the audio being loaded. Normally we play non-crucial or rarely played SFX from Resource files, and all music as well from Resource files. If you haven't, read these 2 pages of the documentation: 1) dl.dropboxusercontent.com/u/40293802/DarkTonic/MA_OnlineDocs/AudioMemoryAllocations.htm2) dl.dropboxusercontent.com/u/40293802/DarkTonic/MA_OnlineDocs/BestPractices.htmAudio skins are touched on near the top of this page: dl.dropboxusercontent.com/u/40293802/DarkTonic/MA_OnlineDocs/DynamicSoundGroupCreators.htm
|
|
mzsd
New Member
Posts: 10
Posts: 10
|
Post by mzsd on Jun 18, 2016 6:27:40 GMT
Thanks for the answer!
So, I think then I will choose a strategy with creating a separate DSGC for each weapon, store them somewhere as prefabs and play them via Eventsounds. And for non-delayed playback all weapon clips will have the checkbox "preload audio" on.
Btw do you have any experience working with large amount of DSGC objects in one scene? For example if I will have 50 or 100 of them in a scene for various purposes, can it become a problem for MA?
|
|
|
Post by DarkTonic Dev on Jun 18, 2016 16:16:25 GMT
It will become a problem at the point that you run out of audio memory. If you have a lot of them, you will need to use Resource files or Preload Audio Data on some I would think. Other than that, no problem.
|
|
mzsd
New Member
Posts: 10
Posts: 10
|
Post by mzsd on Jun 19, 2016 4:22:47 GMT
Of course I will be micro managing memory in this case. Some of them will be using streaming, others will be played without preload. Just wanted to know if the big amount of DSGC itself can become a problem. If not then everything is great Thanks for the help!
|
|
|
Post by DarkTonic Dev on Jun 19, 2016 6:51:28 GMT
Ok. Streaming I wouldn't use at all for SFX, too much possible load on the CPU. It's ok for 1 thing at a time, which can be ok for music.
Big amounts of DGSC's will be fine.
|
|