Our composer, Adam, has cooked up great new music for Guns Online – and at the same time, we’ve designed a system which allows for music in game to be driven by in game events.
Here is a sample of one of his tracks for Guns Online – if you’re interested in our music system, read on and I’ll go into some depth on our implementation of dynamic music in Unity.
Your browser does not support the audio element.
If anyone played the old LucasArts adventure games, you may have heard of their iMUSE system – a dynamic system for composing music at runtime. I wanted to create something similar – something flexible enough for a composer to be able to actually create music, rather than program it, and also respond to the mood of the player. Also, games should be interactive. I’m constantly disappointed when AAA games today with budgets of hundreds of millions of dollars can’t achieve the same level of interaction as some of the systems in Monkey Island 2. That sai
Our music system relies on a few simple pieces of information. A song is made up of a set of parts. Each part can transition into a subset of the total number of song parts. Song parts have end times, after which, the next part begins playing.
Given a meticulous attention to rhythm on the part of our composer, it is now possible to sync parts without noticeable breaks.
Using Unity’s scriptable objects, and some simple editor scripting, you can see the basics of our dynamic music. Each part specifies it’s valid transitions, and exposes a tension parameter. Just enter a boss fight? The music will adapt. Each of our parts are roughly 20-30 seconds in length, resulting in a unique and dynamic composition, responding directly to player actions.
What’s cool about this is we actually have interactive music in Unity with very little effort. No advanced AI or algorithms required – just a little planning, and any game can have a similar system.