|
Post by sampenguin on Jul 11, 2019 19:42:42 GMT
First off, I've been using MA for years in many projects, so thank you for such a wonderful plugin that has continued to evolve beautifully! I've been encountering an issue with the default Randomized variation sequence setting that I think I just figured out. Basically, I'll have a set of say, 10-12 voice over clips that I want to randomly play but not repeat during a 60 second minigame (effectively, random narrator banter). Given the timing of my event triggering, you'll only end up hearing 3-4 during any session, so it certainly should not be repeating any of the selections... but it does sometimes. Today I realized my clips are set to probability to play of 30%, and it occurred to me that the clips are being *selected* (and thus removed) from the random pool, but then they don't play due to the probability check failing. So I'm guessing it is actually rotating through the whole pool at least once, it's just not actually playing most of the clips it selected. So my question is: is there any way to have the sequence pool not remove the selection unless it actually plays (i.e. passes the probability check)? or if not, could you point me towards where in the code this is handled and I could try to roll a custom solution for it? Thanks in advance. settings example
|
|
|
Post by sampenguin on Jul 11, 2019 20:51:40 GMT
After digging around, I found around line 1999 in MasterAudio.cs I could comment out a couple of lines and I think it does what I want now. Posting for ref if anyone else has similar need.
if (randomSource.Variation.probabilityToPlay < 100) {
if (UnityEngine.Random.Range(0, 100) >= randomSource.Variation.probabilityToPlay) {
if (loggingEnabledForGrp) {
LogMessage(string.Format("Child named '{0}' of {1} failed its Random number check for 'Probability to Play' to it so nothing will be played this time.", randomSource.Variation.name, sType));
}
/////////////////////////////////////////////
// #Hack if a sound fails its probability check, we don't want to remove it from the variation pool (until it actually plays once)
// RemoveClipAndRefillIfEmpty(group, isNonSpecific, randomIndex, choices, sType, pickedChoice, loggingEnabledForGrp, false);
// MaybeChainNextVar(isChaining, randomSource.Variation, volumePercentage, pitch, sourceTrans, attachToSource);
/////////////////////////////////////////////
return null;
// nothing played, it's silent. Don't take up voices because that could silence a Dialog Group that already has a real sound playing.
}
}
|
|
|
Post by DarkTonic Dev on Jul 13, 2019 3:14:39 GMT
That's cool. I will see if I can make that an option in the UI. Thanks!
|
|
|
Post by DarkTonic Dev on Jul 30, 2019 2:40:19 GMT
This has been added on the Master Audio Manager window as an option for the next update.
|
|