This is an embarrassing post. Some days are there to simply remind you that you don’t really know what you are doing. I spent two days trying to track down why my networking scripts were not working when I ran them in the editor. Turns out that the editor makes it’s own internal network stack when running a project which does not connect to the normal ethernet ports on your machine.
Top Tip ! Build you project and run it natively if you are using TCP/IP connections ! Don’t try and run it in the editor (not even for quick checks or small simple projects) it simply won’t work.
The really nice thing is after I got it all working I built a touch screen controller for Android phones that can be used as input in a Unity game.
Quick Tip: I have been working on a TCP/IP Networking project using a client/server architecture. The client (and the server for that matter) are both relatively small code bases and the UI and object count are really low in the scene. I had been struggling with CPU load in the project and feverishly trying to work out why my code was baking the CPU (and GPU!). I’d assumed it was something stupid I had done in a loop with the networking structures I was not that familiar with. It’s really not easy to concentrate on new code when your laptop fan is literally screaming at you! I’d hit Play and the CPU would spike almost immediately. So I would switch to my local terminal and scrape through the open ports and network connections looking for a smoking gun. Turns out it was the default frame rate in the Editor trying to deliver the fastest graphics performance it could on my PC – and with such a low object count and and very simple graphics being asked for it was running like a Formula One race car when all I wanted was an old jalopy.
Solution: Set Target Frame Rate!
A Unity project will attempt to run your project as fast as possible. Frames will be rendered as quickly as they can (limited by your display device’s refresh rate).
There are two ways to control frame rate:
Application.targetFrameRate – controls the frame rate by specifying the number of frames your game tries to render per second. (I wrote a script to use this – see below).
QualitySettings.vSyncCount – specifies the number of screen refreshes to allow between frames. (look for it in the Editor Settings). For a 60Hz display, setting vSyncCount=2 will cause Unity to render at 30fps in sync with the display.
Note that mobile platforms ignore QualitySettings.vSyncCount and use Application.targetFrameRate to control the frame rate.
The default value of Application.targetFrameRate is -1. (the platform’s default target frame rate)
I set mine using the script to 20 and when I hit Play got this result:
public class SetFrameRate : MonoBehaviour
[SerializeField] // Just so you can check it in the inspector
private int FrameRate = 20; // 20 is really low but got my CPU down to < 10% - 30 is the target for mobile and was < 20% CPU usage
//private int FrameRate = -1; // reset to default
private void Awake()
Application.targetFrameRate = FrameRate;
I attached it to my Camera object.
One interesting behavior of setting this using a script in Unity 2020.3.26f1 was that once it was attached to the Camera object and Play was initiated for the first time it must have set the frame rate somewhere internally in the Engine. When I removed the script (for testing) the frame rate did not automatically reset to -1. I had to re-attach the script and update it to set the frame rate back to the default. I had a search of the settings in the Inspector and Preferences and couldn’t find a visible reference to it anywhere so you have to be careful if you are going to put this on a Production build that you reset it before releasing otherwise you might end up with a lower frame rate than what the platform could achieve by default.
Enough procrastination – back to sockets, ports and buffers.
How to make use of a message bus in Unity. This is a good solution to decouple components and logically organise how your game runs. Instead of doing all the dragging in the editor of game objects and components into scripts the message bus works a bit like a proxy for the communication between scripts. This is good (makes complex things easier to manage – ie. no noodling of dependencies everywhere – and no heavy FindObject calls – plus I get to make a funny bus pun.
When using Events your Objects become Subscribers and Publishers of actions. When you subscribe (or listen) to a particular event channel you get notified when something changes. These notifications go out to every object that is listening on the bus and each object script can respond to the message in their own way.
You can make this as complex as you like but it gets harder the more complex the data is that you are passing around on the bus. This example uses just four components and our events are nice and simple:
An enum that lists the Events on the Bus.
The YellowBus class that handles subscribtions and publishing (by using a dictionary of events)
A BigYellowBusController script that is attached to our bus game object and subscribes to all the “bus” events like starting, stopping at stops, taking on passengers, etc.
A PassengerController that is attached to the Bus Rider game objects (the coloured circles) which subscribes and reacts to rider type events like calling the bus, getting on and off, and ringing the bell when you want to get off.
This is just a simple collection of named constants that are meaningful for our events.
public enum EventsOnTheBus
CALL_BUS, ALL_ABOARD, START_ENGINE, NEXT_STOP_PLEASE, STOP_ENGINE, EMERGENCY_STOP, END_O_THE_LINE
It exposes the Subscribe, Unsubscribe, and Publish methods.
Notice the using UnityEngine.Events directive at the top.
public class YellowBus
private static readonly IDictionary<EventsOnTheBus, UnityEvent>
Events = new Dictionary<EventsOnTheBus, UnityEvent>();
public static void Subscribe(EventsOnTheBus eventType, UnityAction listener)
if (Events.TryGetValue(eventType, out thisEvent))
thisEvent = new UnityEvent();
public static void Unsubscribe(EventsOnTheBus type, UnityAction listener)
if (Events.TryGetValue(type, out thisEvent))
public static void Publish(EventsOnTheBus type)
if (Events.TryGetValue(type, out thisEvent))
The controller on the bus is a subscriber to the events that it needs to react to and defines private methods of handling those events when they are broadcast. You can have any number of subscribers listening in to your events. In this example we only got two: The YellowBus and the Rider.
The Rider Controller does pretty much the same as the Big Yellow Bus Controller but only listens to those events that relate to the riders (some of which it shares with the Big Yellow Bus Controller). Now here is where it gets interesting… look at the NEXT_STOP_PLEASE parts. Start with the OnGui() method below on line 75 where a button press will publish the NEXT_STOP_PLEASE event. In the OnEnable() method our Subscription code calls the PressTheBell() private method (line 17) that let’s our game object handle the call and produce the text message. BUT the YellowBus Controller also subscribes to this event and handles it with the NeedToGetOff() method so that it knows it has to stop and let the passenger off (line 21, 59 and 95 in the BigYellowBusController script above). AAANNDDDD responds by triggering the STOP_ENGINE event and the END_O_THE_LINE event. See how they can chain together into larger behaviours and complex interactions between different game objects without actually entangling them at the script reference level.
Also be aware that on these scripts there is a subscription in OnEnable() and an Unsubscribe in OnDisable() (so we are not holding on to the listener when the game object disappears) the thing to note here is that we are listening to our own events. For example the RiderController triggers the CALL_BUS event and both our own script and the BigYellowBusController script react to it.
public class RiderController : MonoBehaviour
private bool _lightMeGUIup;
private string _message;
private GameObject _bus;
private void Start()
_bus = GameObject.Find("BigYellowBus");
private void PressTheBell()
_message = "I need to get off the bus !!";
_lightMeGUIup = true;
private void HopOnTheBus()
_message = "I need to get on the bus please!!";
_lightMeGUIup = true;
private void JumpOn()
_message = "Hi Driver!";
transform.parent = _bus.transform;
transform.position = new Vector3(0f, 0.2f, 0f);
private void JumpOff()
_message = "Thanks a lot!";
transform.parent = null;
transform.position = new Vector3(0f, -3f, 0f);
private void OnGUI()
if (GUI.Button(new Rect(160, 10, 100, 30), "Call Bus"))
if (GUI.Button(new Rect(160, 50, 100, 30), "Bell Press"))
GUI.color = Color.blue;
GUI.Label(new Rect(300, 40, 200, 20), "..." + _message);
private IEnumerator DropGUI()
yield return new WaitForSeconds(2f);
_lightMeGUIup = false;
The other thing to note is that this message bus is like a party line – all messages are broadcast to anyone listening. All the passengers respond to the NEXT_STOP_PLEASE event as they all share the same code…but of course they could implement different controller scripts per player and all handle this event differently. It’s pretty powerful stuff.
The code above was modified from an example in Game Development Patterns with Unity 2021: Explore practical game development using software design patterns and best practices in Unity and C#, 2nd Edition by David Baron – I recommend buying a copy it is the best book of this type that I have read – take yourself from a beginner to an intermediate Unity programmer. 🙂
This week for my game called The Gap I’ve been doing some house components. The game is set in the suburbs and there will be a lot of house interiors. In what I envision to be the opening scene of the game your main character wakes in his or her bedroom alive with excitement and ready to explore the world. Which has little to do with cornices but it’s these details that make the game look like a world and adds to the immersion.
So here is an example of a cornice that I have made in Blender using the Bevel Modifier.
This starts as a cube with about a quarter cut out of the form and a reduced height. But any straight edge will do. First use the edge select to assign all the relevant parts you want to bevel into a Vector Group. (Select the edge and in the object data panel use the “assign” button under the Vector Group section). Then you add the Bevel Modifier and as you can see in the image above you use the Limit Method by Vector Group and then add your new Vector Group you just assigned. Choose Custom Bevel and use either one of the presets or use the graphing tool window at the bottom to create your own bevel shape. There are a couple of nice cornice style presets in that section to get you started. (It helps to play round with the Amount and Segments section at the top to improve the look – also try Smooth Shading on the object).
Below is a Window frame I used the same technique on but with a different profile. I used ctrl+R to make some loop cuts around the inside of my window frame and used the edge select to assign the cuts to a Vector Group. Then again I used a Bevel Modifier to make a custom set of ridges around the window frame to make it look like the fittings of the aluminium framing around the glazing of the window.
You can see I also added a normal Bevel Modifier to the edge of Window Sill to create the outer wall shape where the rain runs away from the window frame.
I did a quick mock up in Unity to see how they performed under the often difficult lighting environment of the game engine. As you can see below by the shadows on the walls and spot light on the floor it’s not an ideal set up and the cornices are looking pretty crap. At the top of the room on the back wall I have two longer cornice pieces and a corner piece is visible as well. The two at the back are picking up different light sources and one looks lighter than the other. They are clearly three separate objects and not one nice clean line. It might help to add some more surface geometry to the longer pieces so they are not just one long face (loop cuts or subdivisions). Alternatively I could measure them out to fit the room exactly and meet in the corners – but then I would have to make multiple lengths instead of a more modular re-usable approach.
The other thing I did this week that was actually productive is some more character designs. This one is Hippo Boy catching a football and a couple of different shading styles (still playing with Clip Studio and still enjoying it). Next up I’m thinking about all the ways I can program a mugby style football game.
This is more concept art for a protagonist in the new project called The Gap. Okapi Boy – I have always loved Okapi’s. They are shy and remained hidden from the world in the deepest parts of the jungle until they were discovered in the 50’s. Beautiful Zebra like patterns on skin like a Deer. This is a deeply peaceful animal with large soulful eyes. He dreams and offers advice but you have to seek him out and finding him is not always easy or straightforward. In The Gap you get the chance to play as the Okapi for part of the story.
There used to be a great example of this rare creature in the Melbourne Museum Taxidermy collection (which I used to love but has now sadly been taken off the exhibit floor). You can take a virtual tour of the old “Wild” exhibition here.
I have a LOT more concept art to do as I want to get a very clear picture of my characters before I start modelling.
I also stared working on the programming for the game. One element I want to include in the story is a “mini-game” called Fox and Geese. It’s played on a chess board and was one of the first games I remember my dad teaching me how to play. It’s pretty straightforward and uses a chess board and pawns. Four white pawns are the Geese who can only move forward and diagonally one row at a time. The Fox is a black pawn that can move diagonally one space at a time in any direction. Moves are taken in turn and the aim of the game is for either the Fox to break the line of Geese or the Geese to “capture” the Fox so that he cannot move.
It’s early days yet with only the board set up and pawn selection scripts started but it was actually pretty fun setting up the programming that took care of the board. When you learn programming you get to do lots of arrays and nothing screams “ARRAY” like a chess board. So it’s kind of nice to use one of those basic skills that you use in all programming in such a nice simple example. You get to add a little interest to the basic array with the inclusion of alternating colours. Here is the code below:
public class FnG_MakeBoard : MonoBehaviour
public GameObject boardPiece;
public Vector3 positions;
// Start is called before the first frame update
positions = new Vector3;
float start_x_pos = -1.75f;
float start_y_pos = -1.75f;
float rowcount = 0f;
float linecount = 0f;
for (int i = 0; i < positions.Length; i++)
positions[i] = new Vector3(start_x_pos, start_y_pos, 0f);
start_x_pos += 0.5f;
rowcount += 1;
if (rowcount == 8)
start_x_pos = -1.75f;
start_y_pos += 0.5f;
rowcount = 0f;
Instantiate(boardPiece, positions[i], Quaternion.identity);
Color32 myRed = new Color32(185, 48, 48, 255);
Color32 myGray = new Color32(106, 106, 106, 255);
if (i % 2 == 0)
if (linecount % 2 == 0)
boardPiece.GetComponent<SpriteRenderer>().color = myGray;
if (linecount % 2 != 0)
boardPiece.GetComponent<SpriteRenderer>().color = myRed;
if (i % 2 != 0)
if (linecount % 2 == 0)
boardPiece.GetComponent<SpriteRenderer>().color = myRed;
if (linecount % 2 != 0)
boardPiece.GetComponent<SpriteRenderer>().color = myGray;
It’s really nice to get a game finally published. Endless Elevator is now on the Google Play Store so I’ve been planning and experimenting and just plain playing around with Unity and Game Ideas before I start a new project. It’s kind of like a holiday.
I like maths and I also like visualising it with Unity. This little project is one of the simplest types of maths that is generally associated with game programming and that’s adding and subtracting vectors and getting the distance between two vectors.
These sorts of functions are endlessly useful. They answer questions like: How far away is my target? Is my Player going to fall off the platform? Can I jump between two platforms? And so on and so on.
What I like about this one is that it highlights two things. 1. The difference between a player and a target’s perspective (in this project I nominate the circle as the player and the cylinder as the target), and 2. calculating the magnitude or distance between them.
To calculate the distance (magnitude) between two points you take the square root of the square of the x and y values. Which sounds a little complicated but is really just making a square the size and length of your x, and adding that to a square the size of your y, and then getting the square root of the total size of that square.
This is how it looks in the Scene View:
The project is really easy to set up. All you need is an Empty Game Object to hold the script and two other objects. I used a Capsule and a Sphere. Drag the two objects into the public Transform components on the script.
Here is the reproduced script below:
public class GridGizmo : MonoBehaviour
public Transform circle;
public Transform capsule;
public Vector3 differenceToCapsule;
public Vector3 differenceToCircle;
public float magnitude;
differenceToCapsule = capsule.position - circle.position;
differenceToCircle = circle.position - capsule.position;
Magnitude of a Vector (Length of the Vector)
We use Pythagoras' theorem to calculate it:
|a| = √( x2 + y2 )
magnitude = Mathf.Sqrt(Mathf.Pow(differenceToCapsule.x, 2) + Mathf.Pow(differenceToCapsule.y, 2));
public void OnDrawGizmos()
// Grid Number Labels
for (int i = -10; i < 11; i++)
UnityEditor.Handles.Label(new Vector3(0f, i, 0f), "" + i);
for (int i = -20; i < 21; i++)
UnityEditor.Handles.Label(new Vector3(i, 0f, 0f), "" + i);
// Labels of Objects
UnityEditor.Handles.Label(new Vector3(circle.position.x + 1, circle.position.y, circle.position.z), "POSI: " + circle.transform.position);
UnityEditor.Handles.Label(new Vector3(circle.position.x + 1, circle.position.y - 0.5f, circle.position.z), "DIFF: " + differenceToCapsule);
UnityEditor.Handles.Label(new Vector3(circle.position.x + 1, circle.position.y - 1f, circle.position.z), "Magnitude: " + magnitude);
UnityEditor.Handles.Label(new Vector3(capsule.position.x + 1, capsule.position.y, capsule.transform.position.z), "POSI: " + capsule.transform.position);
UnityEditor.Handles.Label(new Vector3(capsule.position.x + 1, capsule.position.y - 0.5f, capsule.transform.position.z), "DIFF: " + differenceToCircle);
// The line
Gizmos.color = Color.blue;
As I mentioned above I do like mathy things in Unity. Here are some of the other one’s I’ve done which are a bit more complicated. I find them really really useful to cement those ideas that I should know back to front but always forget exactly how they work.
I had this problem during a build this week and figured I’d better document it 1. In case anyone else needs to do it and 2. So I don’t forget it myself for next time.
I’m running Unity 2019.4.1f1 and doing the final few Beta builds for the game I’m just about to release called Endless Elevator. (If you want a quick peek before it’s released the beta has a few more days to run). I uploaded a new build to the Google Play Developer Console and noticed a new message saying something along the lines that API 20 Support was going to be discontinued soon and to check my API minimum levels. I did this and also noticed that I hadn’t updated my game’s API support for the latest releases (API 29 and 30) .
I tried to update it from within the Player Settings of Unity:
… and after some time got a pop up message:
“Unable to update the SDK. Please run the SDK Manager manually to make sure you have the latest set of tools and the required platforms installed.”
I had not idea what it meant by “manually” so I went into my local copy of the Android Development Studio and performed a full update of all the APIs’ and Tool packs. This didn’t help. Probably because I’d forgotten that the Unity version I was running had it’s own set of API’s in another location.
This is where I found it: C:\Program Files\Unity\Hub\Editor\2019.4.1f1\ Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin\
This is how I ran it manually from the Windows Command Prompt (cmd.exe):
First time I ran this I had to accept the licence agreement (Y|n) from the command prompt and it seems that this was the problem. I’m guessing that the internal Unity update function didn’t allow for the licence prompt and was timing out.
I did some googling around and found a few examples of this issue – one person said they had to create a repositories.cfg file in their C:\<users>\.android folder (I already had one so not sure if this step is required).
Anyway fun days and looking forward to releasing the game later next week.
I’d like to thank the wonderful Beta Testers who have signed up for our Open Beta of Endless Elevator over the last month. I was really surprised how many people responded to our call and very grateful to all those who provided feedback.
Your feedback helps us make a better game – thank you!
One feature of our Beta Testing was opening multiple channels to provide users to get back to us. Not only did we use the Google Play Beta Feedback and Stars system but we also took feedback on email and through social media. One new thing we did was to incorporate a chat channel on our Beta Landing Page where users could provide anonymous feedback directly on to our web site. I feel that the anonymity of this format was a really important source of quality comments for us.
To start with I wanted to do a general investigation into Wwise the integrated audio package for Unity by AudioKinetic. When I started working through it I figured it would be more interesting to look at Wwise in comparison to Unity’s own audio API and mixer components which have been around since Unity 5.
To do that I’m going to compare a game in three different builds. Build one is it’s original state with simple scripts that run an AudioSource.Play() method. The Second build I will add another layer of complexity by using the Unity built in Mixer and see if there are any differences or advantages. Lastly I’ll redo the project with the Wwise API and investigate how that impacts build size and project complexity and weigh it up against the previous two builds. Mostly I’m looking for difference in performance between the three builds, build size and complexity, and weighing that up against ease of implementation and flexibility.
I refreshed an old project called “MusicVisualiser”that I started for my Five Games in Ten Weeks Challenge. The game is like a singing solar system. There is a bunch of “planets” in the night sky that play a set piece of music when clicked. It’s a really simple concept and project but I think it will work for this comparison as the parameters can be limited to just a few audio tracks but we can play with spacing and roll-off and other advanced audio features.
Let’s have a look at the game first.
These “planets” are simple native Unity sphere meshes with an Audio Source component and a particle system that’s triggered when it’s clicked. You can see in the Audio Source that we are not using a Mixer for Output and all the Audio sources compete for resources and play at their default volume and priority.
The PlayMe script just takes in the AudioSource and plays it:
public AudioSource my_sound;
target = GetClickedObject(out hitInfo);
if (target != null && target.name == my_name)
_mouseState = true;
screenSpace = Camera.main.WorldToScreenPoint(target.transform.position);
offset = target.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenSpace.z));
my_sound.Play(); // This is the Audio Component!
var expl1 = GetComponent<ParticleSystem>();
Pretty simple right. This is what the project looks like in the Profiler when it’s running and being actively engaged with. At that point we are looking at two Audio Sources are playing:
This is the build size from the Editor Log with our Audio Files broken out:
Used Assets and files from the Resources folder, sorted by uncompressed size: 204.3 kb 0.5% Assets/SomethingLurks_AAS.wav 164.5 kb 0.4% Assets/Step2Down_AAS.wav 136.9 kb 0.3% Assets/Underwater_AAS.wav 41.8 kb 0.1% Assets/M1_M12_37_ThumPiano_Aflat1.wav
Unity Audio with Mixer
Now we add in the Mixer component to the project:
Then add a couple of Channels to the Mixer to split the audio between left and right. Then the Audio Sources are dropped into one or another of the Mixer Channels:
Next for bit more interest I added some effects in the Mixer. Here is where we see the advantages of using the Unity Mixer. Sounds can be manipulated in complex ways and the Audio Output chain be defined with presets and levels etc.
If we have a look at our Profiler while running with the new component we cannot really see any great differences. The ‘Others’ section of the CPU Usage is a bit higher and the Garbage Collector in the Memory is pumping regularly but the Audio Stats look pretty much unchanged:
Mind you this is a fairly low utilising game so we might get wildly different stats if we were really putting the system under the pump but I’m not performance testing here just comparing run states between the two builds.
Next if we build the game and have a look at the Editor Log the only thing that’s changed here is that the “Other Assets” size is a KB higher (Complete size has not been changed):
Next we are going to add Wwise to the Project. This is the basic workflow. In the Wwise Launcher we register our project and on the first tab we are presented with three Hierarchies.
The Master-Mixer Hierarchy – does what it says. The Actor-Mixor Hierarchy – where most of your game audio develops (use the SoundSFX defaults). Interactive Music Hierarchy – other stuff we won’t get into.
The next tab along is the events tab where you link your audio to game events. You can define your event here (use the default work unit).
Once you got the event there you can associate the event with the audio in the Action List.
Next you generate a SoundBank with Wwise that includes your audio and the code for the API calls to trigger sounds. You export that SoundBank into your game engine and link up the calls in your code.
To Get Started with Wwise
To get started make an account with Audiokinetic and download the Wwise Launcher. The Integration package for Unity can be downloaded and installed directly from the WWise Launcher.
In the Wwise Launcher there is a WWISE tab that you can install and start the application from. Once you open it up you need to register your project within the launcher so Wwise can track you 🙂 ( click on the key icon next to your Wwise project and select ‘Register your Project to obtain a License’). Wise will run in Trial mode which restricts the SoundBank content to 200 media assets and cannot be used for Commercial purposes. Pricing for licensing is on their site but this is not a sales piece so if you want it you can look it up.
There are a bunch of plugins by Audiokinetic and their partners available and also Community offerings like AudioRain a dedicated rain synth with 60 procedurally generated presets for rain. What’s not to love about that!
There is a Wwise SDK for authoring your own plugins and a Wwise API which allows you to integrate into any engine, tool or application.
Basically in Wwise you let the Launcher do all the setting up for you. You will install the Wwise binaries from here and manage your platform versions. Projects can be integrated here and if you don’t have the necessary plugins installed the Wwise Launcher will install them for you.
That’s basically it for the set up of Wwise and Integration with your Project. Next up we will have a look at what this has done to the Unity Console.
Wwise in Unity
First thing we see is a bunch of errors that can be safely ignored. As we did not perform any configuration of our project in Wwise with audio files and events there was no SoundBank to generate yet.
In the Unity Console we have a new tab in our editor. The Wwise Picker Tab contains all the elements of the Wwise project that have been imported with the project integration. There is also a Wwise Global Game Object in the Unity Hierarchy and all the Wwise folders in the Assets folder.
Under the Component pull down there is a whole slew of Ak (AudioKinetic) options.
I know there has been a lot of “show and tell” in this post but I’m going to keep going and show the process of importing the audio into the Wwise Project, creating Events, and Generating the SoundBank.
Working in Wwise
In the Wwise Project Explorer I right click on the Default Work Unit and import the audio files that were part of my project. (I’ve stripped the raw files out of my project for now and removed all the Mixer components and etc.).
Finally a SoundBank is generated from which the Unity project can access the sound files through the AudioKinetic API.
Wwise Audio in Unity
When we go back to our Unity Editor and Refresh the Project and Generate SoudBanks we are presented with the following in the Wwise Picker. We can now access these files and and drag them on to our game objects directly. It’s that simple. Drag a sound from the Picker onto a Game Object and it automagically creates a component that is immediately accessible from within the editor.
Below the Play_Underwater_AAS event and audio file has been added to the Sphere Game Object.
The Trigger, Actions, and Callbacks can all be configured and access through the API. In my case I easily integrated the functionality I wanted with only one line change to my attached PlayMe.cs script that we looked at above. So now instead of my audio coming from the AudioSource component referenced by my_sound the audio is played by the AKSoundEngine.PostEvent.
Actually getting Wwise installed and set up and integrated with my Project was very very easy but not without bumps. It takes a very long time for packages to download and I had a bit of trouble upgrading my Wwise Launcher from an old version (it got stuck! and I had to remove it by hand and re-install). When I did have issues I got some very excellent help from AudioKinetic and after logging a case was emailed directly by a real person (which honestly was so surprising and wonderful to get that kind of support from a company when I’m on a trial license with no formal support agreement or rights).
So lets have a look at the differences in performance and package size. The first thing you notice with the Profiler below is that there is very little difference in performance but we can no longer see our audio stats as it’s been abstracted away from the Unity Engine. The Graph still shows the resources being used by Audio and the Total Audio CPU seems to be up to a third lower than the native Unity Audio statistics. It looks like it’s being clamped at just over 1.2. MB instead of regular peaks over 3 MB.
The Build Report is only a couple of MB larger for the total project size:
Basically a 2 MB difference! The Sounds have been extracted away as a file in the Build Report and we assume they are now part of “Other Assets” above.
I’m kinda blown away by how how little additional file size there is to the build considering the additional libraries code and available complexity that Wwise adds. There is literally a plethora of options and effects that we can play with in the Wwise package. It’s a bit like the excitement I got after the install of my first real Audio DAW. The scope is part boggling and part fantastical wonder at where we can go next. (Audio does get me unusually stimulated but that’s to be expected and tempered accordingly).
The questions I wanted to answer with this whole experiment was 1. Would including an audio middleware like Wwise make my Project more complex and difficult to manage? 2. Would the added Package make my build much larger? and 3. Would the performance of the Audio package be as good as the simple Unity Audio API? The answers are: No. No, and Yes. So I’m pretty happy with that and if the cost point of using the licensed version of Wwise is balanced out against the advantages of using it in the total cost of the Project then I would most definitely one hundred percent go for it.
This is when we make the collider really big on the coin. If the player gets in range of the collider then the coin moves like a magnet towards him. Which is kinda fun when there is lots of coins around and you feel like a millionaire just by standing around.