We have a very capable composer writing and performing some great msic for our project, but we realized we hadn’t really laid out a good framework for how to structure the cuts with loop points, think about transitions between cuts, etc.
Does anyone have a favorite Web site or book that covers these sorts of issues? A quick searc on Amazon didn’t pull up much, so it seems that maybe this hasn’t been formalized as much as some other aspects of the game design space.
You should ask Ron Gilbert how they did their system for Monkey Island, I think it was the first game to have music transitions, they were very proud of it… back in the 80’s!
Now that I think about it, I think it was called iMuse. Apple probably owns them money for the whole iConcept.
I have had to figure out several technical aspects of this over the past few months. My advice to you is to work very closely with the composer in terms of where cues begin and end musically, in milliseconds (instead of relying on the length of audio files). Also, make sure you are using exponential fade-ins and fade-outs via programming, as Unity’s built-in audio volume control doesn’t approximate curves that are suitable for humans very well. (You can’t just Lerp volume and expect it to sound smooth.)
I can contribute what I worked out for CosmoRama if you’d like. I am sure improvements could be made by a more experienced programmer, but I at least think I created some nice fading scripts and made it so that loops didn’t have to start and end at the same time.
I also think a big problem in trying to find information on this is that it really hasn’t been done much, or for very long. I was in a meeting with the composer for the Lord of the Rings console games just a couple years back, and the tech that he was employing to stream various cues seemed very young. I think it is very important to allow your composer to know exactly what it is that he or she will be able to do in-game. Game artists are sort of required to be intimately familiar with the technology, but it is possible for a composer or sound designer to work without knowing a thing about the engine, and just give you a set of audio files. That can totally work, and you can achieve a great-sounding game in this fashion, but this method is probably not going to advance the state of sound in the industry, or make it easier for people to collaborate.
What I have done for CosmoRama is to start all the different audio files upon loading a level, with zero volume. This is the only way I can be sure that they are completely in sync, given the current audio implementation in Unity. Each one loops (sort of) until it is time for the next one to begin, at which point the audio files crossfade, to provide a consistent volume level at all times.
I say “sort of” because it isn’t a simple process of checking the Loop box. Traditional audio loops don’t work with sustained sounds, if you want the piece to sound like a true musical repetition. I wanted to keep the tails of the sounds going after the loop began again. I will post my script for this to the wiki as soon as I figure out how to do so.
Now, what I needed to do for this game was to keep a groove going at all times. Although it appears to the player that new sounds are added after completing a “drawing”, in actuality, a completely new audio file is loaded. This allowed me to do my mixing outside of Unity, and also allows for the destruction of audio objects to conserve CPU resources.
Without knowing more about just what you want to do, what I would recommend is to have the composer tell you exactly what point (in milliseconds) each musical segment ends, for each audio file provided. This would allow the potential for the composer to plan out exactly how each part will loop or lead into the next piece. You can always just fade one cue out, and have the next cue fade in, starting at any given frame, but if you work with the composer to allow this to happen only at certain points in the score, you can create very “musical” transitions. For example, if you were to ask for a piece with a constant tempo, and the composer could supply you with the exact duration of the beats, you could ensure a rhythmically sound “performance” if you only allowed new audio files to begin at integral multiples of that beat duration. It’s up to the whole team to decide how far you want to take that.
There is potential for problems to arise if you have non-musicians trying to communicate with the composer on this, and I assume this is one reason we don’t see cooler things happening in this department. Developing a convincing, life-filled score for a game is a lot more difficult in many ways than doing it for locked picture, because unless the composer is also the audio programmer, there is bound to be confusion about accurate timing issues. Perhaps you could give us some more specific info about your needs. I’ll see what I can think of for your circumstances.
I think this implementation is a bit different than what you’re talking about, but I also think I had to solve a couple problems that you are facing. The title screen is on a 15-second-or-so loop. The main game, about 25 seconds. Occasionally there is a hiccup, and I will hopefully learn to improve that in the near future, but what’s nice, is that because my loops do not end immediately, there is still musical sound happening even if the loop is not seamless for a given iteration. I’m glad to see that someone else is actually concerned about this kind of creative audio in games.
I’m afraid I don’t remember much from the book, but I passed it on to a game audio designer friend of mine ( http://www.thite.com/ ) who said he found it useful.
I have a few other general suggestions on resources:
Hi Jessy, use this wiki entry as a starting point. You’ll have to sign into the wiki first (or sign-up then sign-in if you haven’t already) then;
Create a new page. In the url change index.php?title=Main_Page to index.php?title=CodeName (CodeName being your code’s name) - this will create a new page, click on article and then edit (I think you can just click edit actually)
Add content. Drop in your comments and script with similar formatting to the link above and click Show preview - if all is good then click Save page, if not then continue editing.
How to find it. Add a link to the Script Archive page under the heading Sound Scripts, click edit.
The day after I posted that, I was forced to wipe my Mac clean and reinstall everything because of some weird issues I didn’t know how to solve otherwise (certain programs weren’t installing correctly). I have decided, for the time being, not to install Unity again until 2.0 comes out, because I am busy with other things for now (unless it gets ridiculously delayed). I want to modify these scripts to be more universally helpful, and I would like to test them to make sure they are working great in that form before I submit them.
I’m going with the assumption that 2.0 will become available at the Unite conference, so that the Top DOG winner’s game will actually be allowed to be played. It might be a public beta, but having people create a web player game that no one can play just sounds ludicrous to me.