Here’s a tutorial and some source code I put together for loading, caching, and streaming audio from Amazon Cloudfront into Unity and Unity iPhone. It lets you keep those gi-normous backing audio files out of your core game distribution, but then persists them to your players’ local systems after the first request; it also manages iPhone playback through a native player (but controlled from your Unity script) to work around some Unity AudioSource issues on the iPhone.
Although the iPhone audio playback mechanism is native, it doesn’t require a plugin from Unity, so it ought to work with Unity iPhone Basic (although I believe plugins are expected to be available for free once 3 is out of beta). Anyway, some of that code originally came from the awesome power that is Jeff Murray at Psychic Parrot Games (http://psychicparrotgames.com/) who in turn was inspired (I think) by a tutorial from the amazing guys at Blurst (http://blurst.com).
I updated the objective-c and added a bunch of things, so obviously anything that breaks is my fault, not theirs.
Here’s a zip archive containing the source files and documentation. After you extract it, open the index.html file in the docs directory for all the details.
It’s free for any kind of use you like, commercial or otherwise, and you can make any changes to it that you desire (standard BSD license, to be specific).
Lately I’ve received several emails from folks trying to break in as composers writing music for video games, mostly in the indie game market. I am not sure I’m at a point where I should give advice — but nevertheless, here are a few suggestions from my perspective: Continue Reading
When implementing a soundscape for games, it is not enough to attach audio clips to the correct game objects and hope the game engine handles the audio placement in 3D space correctly. Unless the engine includes a sound propagation engine and advanced audio occlusion and DSP API’s (and an audio engineer who can use them well), the result of merely tagging audio in space are usually weak, watered-down sounds, particularly for the local player in a multiplayer game.
It’s also subtly disconcerting to have a single sound — an explosion, for example — with the exact same waveform representing both local and remote audio, even though that is realistic; that is, it’s often more effective to diverge from realism in some cases, and employ different filters and even sometimes different waveforms altogether. I won’t argue for this statement intellectually, but we can trust our ears to tell us when it is true. Continue Reading
When a game studio requests gameplay underscore, it’s often best to provide several versions of the same loop so that they have the option have mixing in real time even if they don’t have the budget for a full adaptive/interactive score, so the game ends up with more music than the developer has actually commissioned. Here’s an example of how I did this on a recent project. Continue Reading
Unity creates a game engine for 3D game creation targeted at PC, Mac, Wii, web and iPhone. In scoring a couple of recent iPhone games in Unity, I needed a means of adding interactive music; usually I would employ fmod or wWise for this sort of thing in a console or standalone desktop game, but the footprint issues are such that it’s not workable for iPhone, and those features are overkill for what I’ve needed.
It is possible to integrate fmod with Unity, by the way; it’s just not very practical on the iPhone. The startup time alone appears to be increased by 6-10 seconds on a 3Gs (and Unity already has a 7-12 second startup time on the iPhone as it is). Cool interactive audio is not worth making an iPhone user wait 20 seconds or more for the game to start!
So I wrote a simple engine for managing interactive music in Unity specifically for iPhone game development. It’s below, along with a simple demo app that exercises some of its capabilities. I’m placing it under a Creative Commons license, so feel free to grab it if you deem it useful in your project. I will also continue to iterate over it and improve it with further Unity games. I’ve zipped this up in an example project, but you’ll find the example audio files are missing; just add your own if you want to run it.
Blurst has created some great addictive casual and quirky physics games, and they’re now opening up some of the technology and their marketing features to titles produced by other indy developers. Check it out if you think you might have a title that fits what they’ve done in the past: http://blurst.com/developers/. I also really enjoy their musical tastes within their games.
I’m in San Francisco for the Game Developers Conference and while it’s fun to visit with the audio folks — meeting Garry Schyman was a blast because he and Lennie Moore spoke about accenting period storytelling by composing in specific styles, coincidental because I was recently asked to “do something in the style of Bioshock” which was a fantastic score by Garry himself! — but I really feel that despite the temptation of talking gear and processes and dreaming about adaptive/interactive (choose whichever of those terms you hate less) scores and trading gossip and stories, it’s important to break out of the audio camp and talk to developers, artists and animators, game designers, and entrepreneurs.
There are a lot of entrepreneurs in this space; anecdotally, it seems a lot of laid-off employees from game companies are taking the recession as an opportunity to strike out on their own as bootstrappers, which is fantastic and feels like a very American sort of optimism to me.
Here is a suite of themes I recently composed for a fantasy game.
In the game, you wouldn’t hear the full suite and you would rarely hear exactly the same arrangement of the themes each time you played the game. This is because the themes and motifs were written to be split into multiple sections and mixed in real time by the game’s audio engine.
This tactic creates a few hours of different music from about 30 minutes of actual linear theme material. This is fairly common to game audio now, and there is middleware and a few tools (FMod, Miles, Wwise, etc.) to assist. Being a developer as well, I’m just as comfy diving into the code and using the middleware SDK’s and API’s directly vs. using a tool, as it seems that none of them does everything you may need on a given job.
There are some limitations to the modulations that make sense in real time gameplay (for example, the 5/4 sections are not meant to be blended with any of the 3/4 sections), but it’s mostly written with those limits and technical capabilities in mind. For example, the sections in Eb major can be blended well with the sections in D minor (and F maj, its relative major), because although such changes were not written in the linear version of the music, the modulations make good musical sense when wedded to actions that the player takes in the game, and if I’d selected key centers a little farther apart, it would have made less musical sense and put a strain on the audio engine’s pitch-shifting capabilities.
For the sake of this rough mix I did some rough panning to put the instruments where they’d be in a proper live orchestra, but the musical sections (stems) are panned dead center, as they are placed in 3D space relative to the game player by the audio engine as well.
The economy is in shambles, layoffs are replacing holiday bonuses, but the game industry keeps on chugging: 18 percent growth in the U.S. year-on-year, and 35% growth in software sales alone. But there was also this interesting tidbit: The mobile gaming market (including all handhelds) was reported as slightly down over the month, though still up by 7% for the year. Apparently, iPhone ads aside, the console is still the place to be, as families downsize expensive vacation packages to a few new video game titles.
Faced with a tough job market, high debt and maxed-out credit, affluent Americans don’t necessarily eliminate entertainment costs but rather downsize them: instead of a vacation/shopping/theatre trip to Manhattan or London, instead of a weekend of gaming in Vegas, etc., they play more video games. Casual game businesses are booming, and it’s adults that are doing the boom-making, not the overly-aggressive high school age males that many consider the core video game demographic.
With casual games, the prized demographic isn’t so much that hardcore adolescent male gamer on consoles, but the soccer mom set. Women are the big target, and casual games on mobile devices as well as the web are the attraction. The Wii is interesting here, too, because it aims at crossover appeal between the groups.