Fast Facts
Name:
Asheron's Call
Acronym:
AC
Developer:
Turbine
Publisher:
Turbine
Release Date:
11/02/1999
Country:
USA
Genre:
RPG
ESRB Rating:
Teen
News
League of Legends Dev Diary: Sound Development

The League of Legends team has produced a new developer diary outlining the audio design for the game. Find out how it's done below:

The Audio Development of League of Legends

In this blog, I would like to talk about the audio system for League of Legends. I'll be covering some of the specifics of our audio implementation, like our sound event system, and the third-party sound library we're using. Above and beyond the coding details, however, I'll also be discussing more general software engineer lessons I learned from working on the audio system, including the importance of flexibility in a startup environment, and the need for collaboration to come up with the best possible design.

Let's start with the nitty-gritty. One of the more important decisions you have to make at a small game company is whether you are going to buy or build - that is, which pieces of your game are the differentiators, and therefore need to be coded from scratch in-house, and which pieces are fairly standard and can leverage the expertise provided by a third-party solution. The decision we made for audio for League of Legends was to use FMOD (www.fmod.org), a music and sound effects system that is free to download and experiment with, but that you must license in a commercially released game.

FMOD implements a solid sound engine that handles the details of playing effects in a game, but hides all the complexity behind a simple interface and a sound-designer-friendly visual sound editing tool, the FMOD Designer. The Designer allows a sound designer to easily associate sound files with "sound events"; and it allows a software engineer to easily trigger those "sound events" in the game code. Meanwhile, behind the scenes, FMOD is handling things like managing how many instances of a particular sound, like a spell hit, are playing, and whether you are close enough to hear a sound source.

image

This is exactly what a good software library should do: let you concentrate on the parts of the game you care about, while the rest "just works". Our final audio implementation uses FMOD in three places: in our own event system, in our particles, and in our animations. League of Legends has an internal "event model" that triggers gameplay relevant events, like when you take damage, or when you cast a spell. Once we set up a framework around the FMOD library, the hard part of designing the audio system was figuring out which events in our game we wanted to trigger sounds, and hooking up our code to tell FMOD which sound we wanted to play for that event.

The majority of the sounds in our game trigger on these gameplay events, but we had an additional request to be able to create persistent sounds in the world attached to particles in the game, like having a crackling fire sound on the torches that line the lanes. Moreover, we wanted to be able to trigger sounds during a specific frame of an animation. It turns out that given the way we had implemented the audio framework code, it was trivial to have particles trigger sounds; and it turned out that we already had a way to trigger a particle to play during an animation. With particles that can play sound, and animations that can play particles - voila: animations that can play sounds! That's how you know you've made good software design decisions: you start to get new features almost for free.

Here's a secret: before coming to Riot Games, I had never written a single line of code that had to do with playing sounds. But it turns out that ninety percent (or more) of good software engineering is the same, regardless of what kind of application you are developing, whether it is a 3D real-time game or a NASDAQ over-the-counter trading system. If you are familiar with what an event model is and how to interact with a third-party software library, you can use FMOD.

image

The ability to be flexible is very important in a startup, since you never know what system you might need to work on; in a big company, you'd call in the "sound guy" - in a small company, you learn how to be the "sound guy" on the fly. An important skill in working in such an environment is being able to take your previous experience and to quickly and accurately transform a new problem into one that you've seen before. I have to commend FMOD in creating a very powerful and easy-to-understand library, because it made it very easy for me to translate it to something I'd worked on before, and easy to communicate to the designers. At the heart of it, FMOD is a way to map "file paths" to actual sound files; that is, a "sound event" in FMOD looks pretty much like a full file path in Windows. In the end, FMOD doesn't care how you set up all your "file folders", but how you do so is the heart of every implementation of FMOD in an actual game.

This leads to the second key trait that working on this system reinforced for me: collaboration. I had to work very closely with our Sound Producer, Jeff Jew, to understand what he wanted out of our sound system to be able to configure FMOD correctly and play those FMOD events at the right point in the game. Using FMOD efficiently requires you to load sounds that are going to be used ahead of time so the game does not hitch when you play the sound for the first time; but that must be balanced against loading every single sound you could possibly need, so you don't run out of memory. By communicating well with Jeff, I was able to recommend that we group our sounds on a per-spell-basis; that is, all the sounds associated with a spell would be loaded at once, but you can load a single spell at a time. That way we can only load the spells for the champions we know are going to be in a particular session.

Given that I had never had to deal with audio programming in any capacity before, I was surprised how quickly I was able to get sounds up and running in the game. I was certainly impressed by the combination of power and ease-of-use provided by FMOD. And it was fun to push my envelope - part of the reason why I joined a startup was to be able to learn new things and grow as a software engineer. Finally, it reinforced my belief that communication is the foundation of any good application development process - as well as the final product itself, a kickass game!

image

(Note: I am not being paid to promote FMOD, nor does Riot Games have any association with Firelight Technologies Pty, Ltd.)

SOUNDS good, huh? *chortles*