Understanding Leitmotifs, and using them in your Roguelike
Lachlan Kingsford Last updated 12/15/06


Music is a major element of almost every major commercial game and movie. Using music well can render an otherwise ordinary roguelike extraordinary and skillful use of music can make a 'plot-orientated' roguelike have a lasting effect. Music done badly can force a user into turning the sound on a permanent mute... In this document, I intend to introduce you to a range of musical devices, and in particular give you a grounding knowledge in Leitmotifs, and give you some ideas on how they can be effectively used within your roguelike. I will be using real musical examples which will be shown on sheet music throughout the document, which will be 'clickable' to be able to hear a MIDI of the written music. Some musical knowledge will help, but I aim to make sure that it is not actually essential. I will not be providing any source code though... if you understand the lessons, you will have to implement yourself in the short term - I haven't written any myself yet! At the moment, it is fairly theoretical... Further warning that some plot spoilers for various pieces of fiction exist within this document - but nothing that a self-respecting RL developer shouldn't already know.

Figure 1
A Motif (in a musical context) is a small theme that is repeated often, or is used in many forms for a piece to be built around. Arguable the most famous recognizable motif is shown in Figure 1. Beethoven uses it consistantly throughout his fifth symphony, particularly in its first movement. If you listen to the first movement of the fifth symphony, you hear this motif used regularly - however not always in its complete form. Often he simply cites the ' short short short long' rhythm or the 'high high high low' shape of the melody. Every instrument in the orchestra plays the motif and some point.

A Leitmotif (or Leading Motif) extends this concept. Leitmotifs are motifs which are attatched to a character, or a feeling, or a sword - to whatever. Some Leitmotifs are melodic, some are rhythmic and sometimes they are simply small snippets of intervals. Leitmotifs were pioneered by Richard Wagner, who is best known for his fourteen hour 'Der Ring des Nibelungen' - if you have the patience (and a translation), have a listen to it. Figure 2
However, perhaps the way you would best recognise a leitmotif is in the examples given to us by John Williams in his work within the Star Wars saga(as well as many other movies, and many other composers however Star Wars demonstrates the prospect of a leitmotif particularly well. The most obvious example is 'Darth Vader's Theme' - better known as The Imperial March (2 bars of the theme are shown in Figure 2). The same Leitmotif or 'theme' (I will use the terms interchainably henceforth)is used throughout the movies, whenever Lucas has a ' Touch of Vader'. Whenever Darth Vader is seen on screen, his theme plays. When he dies, the theme is played solmnely on a harp, in a minor key. Throughout the prequel trilogy, the theme is sometimes used with Anakins theme to 'suggest' his eventual fate - normally played slowly and only in glimpses. There are countless themes which Williams uses through the entire Hexicology. Other examples include the Han/ Leia love theme, and the four chord Death Star theme from the original movie.

These Leitmotifs can be very powerful devices, especially in a game such as your roguelike. They can be used in a variety of ways, both in static and dynamic music systems. If thought about when composing a score as a set of different pieces that are played on a 'Per Level' basis, you can add a sense of conformity and familiarity to your works, and allow the music to in many ways mirror the plot. If you are using a specially written scripted dynamic music system, you can use Leitmotifs to provide instant musical feedback to your characters actions and developments in the plot.

Figure 3Figure 4Figure 5
You can create Leitmotifs for your main characters - your PC, your PCs major allies, your PCs major enemy and often your PCs God (or the different Gods that one may follow) - and whoever else you want to. If you want to write a theme for a minor character who your PC will only ever meet once, you can feel free to do so. You may choose to write a 'Shopkeepers Theme' - which will be playing when you enter a shop for example. And when you steal from that shop, the Shopkeepers Theme may play faster and more aggrevated as he chases you around. If you came around a corner and found a brutily murdered shopkeeper, then the motif would be repeated but this time slowly, mysteriously and in a minor key. Perhaps you would choose to hint of the murder through playing a few notes of the murders leitmotif. Examples of the shopkeeper are shown. Figure 3 demonstrates the initial Shopkeepers theme. Figure 4 demonstrates the angry Shopkeepers theme - transposing it to a Harmonic Minor scale and adding the 12/ 8 triplet feel. Figure 5 demonstrates a potential use of the theme when the shopkeeper is dead - however the major modulation in the final chord suggests mystery, or a positive element out of the shopkeepers death. Perhaps the PC found a mysterious note, or an artifact which has its own Leitmotif - perhaps featuring the major 3rd interval as it was played then.

You may also create Leitmotifs for other elements of your game. In some games, certain objects, such as ADOMs Orbs of Chaos or Nethack's Amulet of Yendor are such important plot elements that they deserve their own themes. These themes can reference another theme - if you were writing a Lord of the Rings game, the One Ring's theme should reference the theme of its creator Sauron while maintaining its own musical identity. Themes for essential objects like the Orbs, the Amulet or Ring can be used sparcely as the game starts (except perhaps being played when learning the 'legend') and interspersed more into the games soundtrack as the quest continues, becoming more noticible and important as the goal becomes closer and closer to achievement. Important quests can sometimes have their own themes. You can associate a single chord, or scale form to a mood or theme in the game - perhaps associating a dominant seventh chord with an innocent death and referencing it when an innocent character dies. If he died at the hands of Sorgoth - the evil underlord then use the underlords theme in conjunction with the dominant seventh chord. You can build up musical relationships in many ways, your use of Leitmotifs and themes are limited only by your imagination.


Sources of Inspiration

Musical Excerpts Used


All other excerpts are Copyright © Lachlan Kingsford 2006. Both the excerpts, and the article are not in the public domain. Please contact Lachlan Kingsford if you wish to use this article, or its contents elsewhere.