Blog homepage

Audio Tools and Experiments in UE4, using Wwise: A Spline Based Audio Emitter / Volumetric Audio Emitter For Custom Shapes

Sound Design / Wwise Tips & Tools

 

Hello people! This is the first entry in a series of small blog posts about audio tools, experiments, and fun using Unreal Engine 4 in combination with Wwise. Hopefully they can get us all thinking and talking, and in the end become better developers. I really want to just share stuff with the community and I’d LOVE to hear you folks' opinions on the topics that we touch upon. As this is the very first entry from my series, I find it appropriate to very briefly introduce myself. My name is Troels, and I’m what you would probably refer to as a technical sound designer, and I am also composer.

Over the last year and a half, I’ve spent countless evenings and weekends learning Unreal Engine 4, making game prototypes, and working on very non-commercial projects, and I just can’t stop! Now, I also started picking up Unreal Blueprint in my professional work and some of the things that I have learnt have been related to audio tools, which (among other things) made we want to write this blog. So here I am!

Now let’s unveil the first topic! I present to you...

The Spline Based Audio Emitter, probably better known as a Volumetric Audio Emitter.

My colleague and I started creating this tool because we couldn’t find an existing tool or solution for creating custom audio emitting area shapes in UE4.

 

Spline

What is it useful for?

The tool makes it easy to block out large, non-cubic, boxy, or spheric areas in UE4, inside or outside of which you’d like to add audio, such as a forest or swamp area. Please note, a simple shape version can easily be derived from the Spline based version and already exists.

Why would anyone use this?

Because you can make your ambience sounds fade in / out the closer you get to an area shape that you have defined, and so you aren’t tied to using basic shapes only. It can save lots of time, especially when prototyping and when the level / environment is changing rapidly. Additionally, if you have an encapsulated area with entrances, and the AkComponent has occlusion enabled, it will also make the inside / outside ambience play through the entrance without playing through the walls, so more convincing. Also, it only uses one emitter, and this can potentially keep your voice count down as well. Here’s a video on how it works. Note that this video is a very brief overview of its core functionality. Additional functionality not covered: inside / outside States, follow player height, and area fade distance RTPC for use with 2D or 3D sounds with user-defined position source.

 

What it does:

  • The Spline Based Emitter uses a closed spline loop. It locates the point on the spline curve closest to the player and places an audio emitter at that point. The audio emitter location is updated continuously.
  • The Spline Based Emitter has two states: Outside State and Inside State. When the player moves into the closed loop, the State changes to Inside and from that point the audio emitter location is now set to follow the listener as well as its orientation. The moment the player moves outside the spline loop, then State changes to Outside and the location of the audio emitter is once again “attached” to the spline curve and is continuously set to be positioned at the point (on the curve) closest to the player.

How it works:

To get an understanding of how the tool works, you could go through the Blueprint in UE4 - it’s thoroughly documented. Note that the tool also has several publicly exposed variables that makes it a bit more versatile. You can download it here.

The two main ingredients / node functions this tool relies on are:

  • Get closest point on spline curve (for emitter location).
  • Dot product (for knowing if we're inside or outside our closed spline loop).

 

How to use it:

  • Place the Blueprint in your scene and create the shape you need. Personally, I prefer to change to Top view during this process.
  • In the exposed variables in the details panel, add your sound and inform the Blueprint what RTPC you use for Area Fade.

You need to be aware of two points that might break the tool:

  • V / concave shapes can be troublesome if the emitter attenuation is too long. I really want to come up with a solution to this issue. If you make a concave shape and locate the listener in the center between the two sides (as seen in the image below), you’ll end up with the emitter immediately jumping from one side to the other when the player moves across or within in the V shape.
  • Make sure not to make any points in the spline loop cross one another. The relationship between the spline points’ rotation is essential for the Inside / Outside State to work.

 

Image 2 ConcaveNotGood

Optimization:

Since I expect the CPU time for this Blueprint to be considerably longer compared to the already existing ambience shapes / tools, we added a little optimization to it. When the player / listener gets X distance away from the closest point on the spline curve the tick rate of the Blueprint is drastically reduced.

Troels Nygaard

Technical Sound Designer and Composer

Investigate North

Troels Nygaard

Technical Sound Designer and Composer

Investigate North

Troels Nygaard is a technical sound designer and composer with a BA in Sound Design (2014) and a MSc in game design with focus on audio integration and user experience (2016). Additionally, Troels is a Wwise Certified Instructor, and music producer.

nordictones.com

Comments

JungKun Park

August 02, 2018 at 02:38 am

That's Cool! I'm just sparking my curiosity about knowing if the listener is inside or outside. Could you tell me more how to work it?

Troels Nygaard

August 02, 2018 at 02:49 pm

Hi Jungkun, yes! :) Though I'd suggest you had a look at the BP itself. You can download it from the article. Inside is determined by the value of a Dot product function (it's a node function in UE4 BP) The Dot Product takes the relationship between to vectors (Player and Spline point's right (y) vector) and returns a number between -1 and 1. 1 means left of the point and therefore inside and -1 means on the right side of the spline point's right vector and therefore outside. 0 would be exactly on top of each other. Please don't ask me about the details on how it's calculated, I'm not that good at the math ! :0)

Parag Oswal

August 02, 2018 at 02:40 am

Nice One!!!!

Zac S

August 02, 2018 at 04:12 pm

What version is this being implemented in?

Troels Nygaard

August 06, 2018 at 07:49 am

We've been using this tool in both UE4.18, 19. The initial tool was created in UE4.18. The BP and content was migrated from 4.19.1. It won't work OOB, you'll have to replace some cast nodes and character references to fit with your game :) Don't worry, it will complain until all of that has been fixed and it's pretty straight forward

Hannah Lee

August 06, 2018 at 09:19 pm

This was extremely helpful! Thank you. :) I've checked out the uploaded BP and it was quite easy to understand too, thanks to the detailed comments. I do have one question though.. When the player is outside of the spline curve and you set the emitter to follow player's elevation, it seemed like the emitter location is set to the pawn's exact location instead of the closest spline curve location. Is this maybe to give it sort of a 2D effect?

Troels Nygaard

August 24, 2018 at 06:33 am

Hi Hannah, so sorry about the slow response here. It is possible that I made a mistake and the location is set to the player's exact location. It could also be that only the debug speaker is on the exact location and the emitter is actually at the correct location on the spline curve's X+Y. As I mentioned to Colin I'll check later today and then I'll get back to you with a solution and link to an updated generic BP that will work with any character. Regardless what is going on it should be a relatively easy fix I think :)

Troels Nygaard

August 24, 2018 at 03:08 pm

Hi again Hannah, it appears that I made a mistake in the BP, sorry about that. However, the fix was very simple, just 2 connections need to be replaced from already existing nodes. Here's an image that shows the correct setup: https://www.dropbox.com/s/0ixftzohgi3naes/Correction.JPG?dl=0 And the updated version of the BP + a static mesh based version can be downloaded from my Dropbox (I'll also ask Audiokinetic to update the link in the blog): https://www.dropbox.com/s/tf6txyb6fimcok3/UpdatedSplineEmitterPlusMeshEmitter.zip?dl=0

Hannah Lee

August 26, 2018 at 10:23 pm

Hi Troels, thanks a lot for the update!

Mitchell Kenny

August 08, 2018 at 10:55 am

Any advice on how to import the .uassets into a project? Unreal seems to not recognise its own file format.

Hannah Lee

August 21, 2018 at 08:07 pm

You can put the file into the desired folder using windows explorer and it will work immediately.

Troels Nygaard

August 24, 2018 at 06:28 am

Hey Mitchell, as Hannah suggests you should be able to use it if you copy it to the Content folder of your UE4 project. Please note that if you're using an older version of UE4 (Below 4.18) It might not want to load as intended

colin bale

August 09, 2018 at 10:55 am

does this work on the Z plane as well as X and Y please? i.e is it always directional when outside of it even when above or below? I wonder how useful it would be for a game where you can float around for example. thanks

Troels Nygaard

August 24, 2018 at 06:20 am

Hi Colin, sorry about the slow response. In the details panel of the BP there's a checkbox 'Follow player elevation'. The intention of this is to set the emitter's Z world location to be the same as the player's. So, X + Y follow the spline curve, while it elevates with the player's Z location. However, HANNAH LEE made me aware that I might made a mistake in the BP and the checkbox 'Follow player elevation' will unintentionally set the location of the emitter to the player's exact location. Later today I'll research this and if it's broken I'll fix it. Please let me get back to you on this (will do as a response here). Have a great day

Troels Nygaard

August 24, 2018 at 03:10 pm

Hi again Collin, please download the new fixed version with working 'Follow player elevation' here. Appears that I made a mistake related to the bool, sorry about that: https://www.dropbox.com/s/tf6txyb6fimcok3/UpdatedSplineEmitterPlusMeshEmitter.zip?dl=0

Russell Shaw

February 07, 2019 at 08:10 am

Excellent post, Troels. I designed something along these lines myself a good few years back for Fable. We implemented a paintable layer in Unreal using different colours for different ambience types (forest, running water, shoreline, scrubland, desert etc.) when the camera was directly over a coloured block I made the associated ambience head-relative which took care of immersion.

Leave a Reply

Your email address will not be published.

More articles

Life is Strange - Dynamic Music Positioning

Music and sound are some of the most important elements when it comes to DONTNOD video games.

1.11.2016 - By Sébastien Gaillard & Yannick Tassin

VR Regatta Sound Design : Immersion and Guidance via Sound

VR is the new black. That is what everyone is saying. VR is certainly an interesting new technology,...

6.9.2017 - By Stephan Schütze

Using Wwise for Theatre:  Adaptive soundscape for Theatre Play Le Léthé

If we imagine that a theater set is comparable to a virtual game world, wouldn’t Wwise succeed in...

12.9.2017 - By Pierre-Marie Blind

Loudness Processing Best Practice, Chapter 3: Scalable Loudness Processing for Games

Translator's Note: This is the finale of the three-piece series Loudness Processing Best Practice...

7.11.2017 - By Jie Yang (Digimonk)

Dehumaniser Live: An innovative technology focused on voice processing

In the world of games, there are many characters that are completely fictitious. Characters like...

21.11.2017 - By Masato Ushijima

A New Multiband Compressor Plug-in for Wwise: Polyspectral MBC joins the Audiokinetic Community Partner Program!

Polyspectral MBC is a new multi-band compressor plug-in for Wwise. I’m excited to be releasing it...

26.6.2018 - By Ethan Fenn

More articles

Life is Strange - Dynamic Music Positioning

Music and sound are some of the most important elements when it comes to DONTNOD video games.

VR Regatta Sound Design : Immersion and Guidance via Sound

VR is the new black. That is what everyone is saying. VR is certainly an interesting new technology,...

Using Wwise for Theatre:  Adaptive soundscape for Theatre Play Le Léthé

If we imagine that a theater set is comparable to a virtual game world, wouldn’t Wwise succeed in...