Working with sounds and .wav files.

This section will outline how to make and work with new sound files. All tutorials by Rellik_jmd.

If when reading these, you find what you know to be an error, send mail to us at DER.

CONTENTS:

  1. Making ambient sound objects with DeHackEd

COMING SOON:

- Utilities for making / modifying wav files.


NOTE: This section is very rough. I was going to just delete it but some of it may be found to be useful.

Putting ambient sounds into your level can make a huge impact if done carefully and correctly. In this tutorial I'll explain how to create the things you'll need in order to install sound objects into levels using DeHackEd. You will need Wintex or XWE, a sound program like WAVEEDIT and EDITPAD to edit the DDF files. All are avaialable from the downloads page.

Making Ambient sound Things

Using Dehacked

For this tutorial we'll be using TNT's BOOM engine to run the patch, since BOOM is a much better engine than the original. If you want information on how to add the patch to the original engine from id Software, check the DEHACKED section under SCRIPTING. For this tutorial we'll install an alarm sound effect (download .wav here).

Step 1. Install the sound file into a wad file. Open up Wintex and select FILE, then NEW WAD ( yu may want to add it to a pre-made wad, but for this tutorial we'll assume you're working from scratch). Name this wad sound.wad and a new window will pop up. From the row of buttons at the bottom click on the one with the little speaker on it. Now go up to EDIT, then select LOAD ENTRY FROM FILE. Now click the drop-down button from the "Enter a Name" box and select DSCYBDTH. Click "Okay" then click on alarm.wav. Now you're sound is in the wad file and you can close Wintex after saving it to your BOOM directory. Unfortunately the only way to add new sound objects with a dehacked patch is to steal sounds and frames from other things. In this case we'll be sacrificing the CyberDemon.

In the initial Dehacked window, use the up and down arrows on the right side boxes to scroll down through the things until you get to thing number 22, the CyberDemon. Now in the upper right side box is listed the sounds the cyberdemon has. You change an entry in DeHackEd by double clicking on it, a small window will pop up and you type the new value in. Change the CyberDemon's death sound to number 68, which is the number for DSCYBDTH, our sound in sound.wad. You can figure out which number belongs to which sound by clicking on F5 SOUNDS at the top of the screen. All sounds are listed there.

At the bottom of the initial screen is a large box filled with check boxes, some with X's, some without. In this case we need to uncheck the boxes for OBSTACLE, SHOOTABLE, and EFFECTS KILL %. Now none of the boxes should be checked. Check the boxes for TOTAL INVISIBILITY AND CAN'T BE HIT.

In the middle right side box, change the number of the 'demons FIRST MOVING FRAME to 692, so immediately upon waking up it plays the death sound frame. If it was visible and you tried to run the game the cyberdemon would explode the instant it saw you!

Now that our sound thing is set up we have to change the frame table a bit.

Step 2. Adjusting the frame table. Click on F3 FRAMES at the top of the screen and you will be taken to the frame table screen. Scroll down to frame 674, which is the first of the cybers frames. Now because we've checked the TOTAL INVISIBILITY box, we don't have to worry about what it will look like, only how it functions.

Because our alarm sound is the cyberdemons death sound, all the other frames will become junk, and not relevant to this tutorial. All we need are it's INITIAL FRAMES, where it's standing there waiting to be awakened, and it's DEATH FRAMES, which will play the sound. Go a little farther down to frame 692, which is the frame that plays the sound.

We need to set the duration of the frame to match how long the sound is. If we have too short a duration, the sound will be cut off before it's finished, and if it's too long there'll be a quiet pause after every sound. In order to get your sound to loop perfectly open up WAVEEDIT and load the alarm1.wav file. On the bottom left side of the status bar will be "Len: 00:02.863" which is the exact length of the sound file. Now to find out how long your frame duration has to be in the things.ddf file, just times the number by 35, because the duration is in a measurement called "gametics" and there are 35 gametics in every second. So after multiplying 2.863 x 35 we get 100.205 which we'll round to 100. Now we change the frames duration to 100 and the sound will match perfectly, or atleast to within 2/35ths of a second.

Now change Frame number 693 so it's next frame is 0 (zero), and it's duration is -1. The -1 duration tells the engine to display that frame forever, and the next frame 0 is a null frame. Now it's all finished. Anywhere where you place a cyberdemon now, you'll have a one-time sound object. One final reminder, because the non-looping sound objects are things that awaken on sight of or contact with the player, you HAVE to make the thing DEAF with your editor otherwise the first shot you fire will set off all you sound objects. You can also put the object in a hallway looking in the opposite direction that the player will travel and the object will sound when the player runs over it.

Looping sounds with DeHackEd. If you've made the above sound effect then, you're one mouse click away from a forever looping sound effect. Just click on Frame 692's NEXT FRAME number and change it to 692 and you're done!

You may notice that the sound doesn't fade with distance and that's because we used the cyberdemon to make it. The cyberdemon and spiderdemon are both unique from other creatures in that any sound they make doesn't fade with distance. if you want the sound to fade with distance, simply use a different thing for it. Any thing with DEATH FRAMES will work, even the Commander Keen thing if you're using DOOM2