Composing music for Unreal Tournament

Started by Harbinger, November 15, 2010, 20:56:58

Previous topic - Next topic

Harbinger

In case anyone wants to compose music to be used as background music for Unreal Tournament (some of us are still around), here is some help on using ModPlug to put together the music file. (The standards we'll use are those for UT99, but more recent versions of the game may use more features in track types.)

Files and tracks
Unreal can only read files in its own proprietary format, UMX. Fortunately, ModPlug Tracker (MPT) can read these files -- usually (some UMX files have been known not to load in MPT). And as such, you can learn a lot about how Unreal reads these tracks.
Unreal can use tracks in the following formats:
MOD               S3M                 XM
IT                STM                 FAR                669
Unless you're more comfortable with other module types, it's best to use IT, since there are more features (though not all are recognized during playback in-game).

Transferring tracks to UT
There are 2 ways to make a UMX track -- create one from scratch, or transfer an existing one to a compatible type. To make an existing track UT-compatible, you'll have to go thru the entire track and verify that what you hear in the source track is what will be played in the UT track. This is because UT does not recognize all features and commands in its own engine. At the end of this article is a list of limitations you will have to account for.
If it looks like a note will not be able to be played, or a command won't be able to be processed, the only option is to render a waveform from the note or notes. Many UMX tracks have entire beat loops or filtered synth loops in single samples, and it's not unusual to use the offset command to slice the loops to the part that's to be played.

Creating a UT-compatible track
When creating one from scratch, you probably know how to assemble samples and assign them to instruments if necessary. Just observe the limits described below and you should have a perfectly playable UMX file.
But what if you're using plugins? I myself use a boatload of VSTi's when i compose these kinds of tracks, mixed with a few samples for simplicity. When using plugins, you'll have to divide the playback into patterns, measures, beats, or notes (whichever is most efficient and offers the best reproduction) and "render" the notes that call them.
My advice is to compose in MPT's native format MPTM, since you have 2 important options that you can't get with other formats -- Sequences and Parameter Control Events. Then you can easily transfer to IT when you've completed the composition.
After the song is done to your liking, set up a secondary sequence so you can create all the notes which will need to be rendered. After creating a new pattern, set them in separate channels, one instrument to a channel. You can use multiple notes in any channel if you want to make a cadence; just make sure there are anough rows in the pattern to capture the entire sound. Use PCEs if you want to control the plugin during playback of the note. Right-click on the pattern in the Order List and choose "Render to WAV" from the contextual menu. In the next dialog, select the following options:

  • 22050 Sample rate
  • 16-bit MONO samples
  • Channel mode (so that each channel in the pattern will be saved as its own file)
  • The Order position of the pattern to render (which should already be set)
  • Normalize (if you want to make sure the waveform is as loud as possible without clipping)
In the Save File dialog that follows select a unique name in a place where you can easily retrieve these samples; you will be loading them back into MPT. When you click OK, each channel (in that pattern in that Sequence) between the first channel with data and the last channel with data will be saved in its own index and using the channel name from where it came. The samples will all be exactly the same in length.
The object here is to create a sample-based reproduction of what was being played by plugins, since UMX does not recognize plugins (and may not even be able to play the module). So go back and create samples (apply them to instruments too if you want to use envelopes) and make substitutions for the plugin notes.

Saving in UMX format
You cannot save or export the module you've created from MPT; it must be done from UnrealEd. But first you must save the file in its standardized format, called Compatibility Mode. If your track is in MPTM, save it first as it is, then convert the open document to IT in the Song Properties window (or convert it to one of the other available types that can be imported into UT). If you lose something you didn't intend to, you can reload the MPTM you just saved. If it all still sounds right after conversion, save it as a standard IT by choosing "Compatibility Export" from the File menu. You can then save a copy of the track as a compatible version.
Now to convert this track to UMX. Open UnRealEd and find the Music Browser. From that window, select "Import" from its File menu. Find the file and load it. The module will be brought into UnrealEd and converted to UMX format if it's in the proper module format for its type. You can then play it from the music browser to make sure it sounds correct. You can then save it as a UMX file by choosing "Save" from the browser's File menu.

UMX limits
Here is the known list of limitations in the UT99 module playback engine. If a module will play in UT99 (as a UMX file), it should play in all the other versions of UT. I tested extensively with IT tracks, but the equivalent FX commands for other module types are probably also applicable.

UT99 engine:
1. Plays only mono samples.
2. Plays only 8-bit or 16-bit samples
3. Recognizes instruments' pan and pitch envelopes, but not volume envelopes.
4. Does not recognize all panning controls; these are ignored: pxx (volume effect for pan), Pxx (pan slide), and Yxy (panbrello). In IT, use S8x or Xxx to set the pan position.
5. Does not recognize most volume controls; these are ignored: Mxx (channel volume), Nxx (channel volume slide), Vxx (global volume), and Wxy (global volume slide). Kxy (volume slide + vibrato) and Lxy (volume slide + tone-portamento) process the vibrato or portamento, but do not process the volume slide. In IT tracks, use the volume effect (vxx) or Dxy (note volume slide).
6. Does NOT apply Tremor (Ixy), Fine vibrato (Uxy), S6x (fine pattern delay), S9x (sound control including sample reverse S9F), and SDx (note delay). SBx (pattern loop) repeats forever, not x times.
7. Does not use global ramping. Clean the samples first, by making sure they start and end at 0 (the center line in the sample display). Also do the same with loop points.
8. Does not store values when passing *xx, where * is the command effect. For example H00 does not use the last Hxy value; it's ignored.
9. Does not use samples' Sustain Loops, only Sample Loops.
10. Does not recognize NNAs.
11. Uses up to 32 channels optimally.
12. Does not apply ModPlug's Autovibrato.

Saga Musix

#1
Since I have had my "joy" with the Unreal sond system before (more precisely, its name is "Galaxy sound system" and was also used in Jazz Jackrabbit 2), I have a few corrections here:

Unreal's sound engine was bad designed (i.e. it doesn't fulfil its needs). The main soundtrack contributors (Alex Brandon and Michiel van den Bos) were working in the S3M and IT format, but the Galaxy sound system looks more like an XM player to me. If you look at it from that perspective, you should see pretty quickly why commands like Mxx or Nxx don't work. Basically, it's best to compose tracks in the XM format for maximum compatibility. Also, auto vibrato works, but only when using XM, because in XM it's a per-instrument setting (whereas it's a per-sample setting in IT). Basically, you can have a look at OpenMPT's J2B loader to get a list of supported effects and features. XM is pretty much complete there, but many S3M- and IT-specific things are missing.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Harbinger

Ooo, very good info! Thanks for pointing all this out. I was going to include a section in the manual (or at least in the source docs), and this kind of info is very helpful. :D

LPChip

Maybe not entirely on topic, but for Unreal Tournament 2003 and later, the umx files are encoded .ogg files.

The first Unreal also has the same audio engine as Unreal. Unreal 2 already worked with .ogg files.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Saga Musix

Quote from: Harbinger on November 15, 2010, 20:56:58
some UMX files have been known not to load in MPT
Really? Which ones? UMX is simply a container, not an own module format, and MPT's way of accessing this container is rather dumb, so I'd like to see examples where it fails.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

LPChip

Quote from: Jojo on November 16, 2010, 07:56:05
Quote from: Harbinger on November 15, 2010, 20:56:58
some UMX files have been known not to load in MPT
Really? Which ones? UMX is simply a container, not an own module format, and MPT's way of accessing this container is rather dumb, so I'd like to see examples where it fails.

I can predict that UMX files from newer games will fail because OpenMPT can't load .ogg files. Unreal Tournament and Unreal .UMX files should work normally though, just as loading .zip or .rar files with one module in it will work.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Saga Musix

But those with .ogg files inside wouldn't work in Unreal (Tournament) either... :P
Also, you don't even have an idea how the code works, so how can you claim that all files from UT should "work normally though"? The UMX loader code is not very pretty and it is in fact very easy to create non-working UMX files.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

LPChip

"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Saga Musix

I really can't consider false statements as "helpful"... ::)
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.