I’m hoping someone can give me some advice on the smartest way to implement ambiences in a friend’s student project I’m working on as I’m new to Fmod and fairly new to Unity.
In the game you hop between people’s inner thought’s on a train, and each time time you enter someone’s head the train disappears and you’re transported to a different natural environment. Every character has a unique environment and you’re constantly jumping between character environment, train and back again.
I’ve designed all the the different ambiences including the train interior and set them up as individual events that loop in Fmod and just trying to wrap my head around how I’m going to implement this in Unity. Any advice or links to resources would be greatly appreciated!
There’s no “one true way” to do this.
That being said, it sounds like you want the player character to “teleport” abruptly from one location (with its own ambiance) to another on a regular basis. If you want to keep your game’s resource requirements down, I suggest starting each location’s ambiance only when the player character arrives at that location, and stopping the event instance when they leave.
If you find the transition from one ambiance to another too abrupt, I suggest adding an AHDSR modulator to the master track’s volume of each ambiance event so that they fade in or fade out over a short period of time whenever they’re started or stopped.
Thanks for the reply! This is probably the way to go, but after some thought I think I might try and keep the train ambience playing and then duck it when the characters environment comes up using snapshots.
It kind of makes sense aesthetically to have the train playing low in the background with some high frequencies rolled off as they’re technically still in the train (you still see the outline of windows etc). I’ve experimented with character environment events triggering a snapshot and put a AHDSR on the intensity so the train fades out as the environment fades in and this works well, but when I stop the environment event the train level jumps back abruptly even though the AHDSR has a release time set. Is there a better way to get this to work the way I want?
When an AHDSR modulator is placed on one of the properties of an instrument, the release period of that AHDSR modulator starts when that instrument is untriggered. When an AHDSR modulator is placed on one of the properties of an event, the release period of that AHDSR modulator starts when that event is stopped with fadeout. Stopping an event does not untrigger any of the instruments in that event. (If it did, an event with an AHDSR modulator on its master bus volume would normally fall silent immediately when stopped, instead of fading out gradually, due to its instruments all being untriggered at the same time.) This allows you to produce events with much more complex behavior than could otherwise be achieved.
A snapshot instrument is an instrument; thus, its release period begins when the instrument is untriggered, not when the event is stopped. If you want your snapshot’s release period to play out when the event is stopped, you must ensure that the snapshot is untriggered when the event is stopped.
The simplest way to do this is to play and stop the snapshot as an event in your game’s code, instead of through a snapshot instrument.
Alternatively, if your project requires snapshot instruments, you can ensure that each snapshot instrument is untriggered when the event is stopped by giving the snapshot instrument a parameter trigger condition, and placing an AHDSR modulator on the value of that parameter. Parameter values are event properties, so an AHDSR modulator on a parameter value does enter its release period when the event is stopped with fadeout.