Terraforming 537
Table 18.3 Terrain Editor Functions
Function Description
Select
Selects grid points that will be painted with the brush.
Adjust Selection
Raises or lowers the currently selected grid points as a group.
Add Dirt
Adds "dirt" to the center of the brush.
Excavate
Removes "dirt" from the center of the brush.
Adjust Height
Drags the brush selection to raise or lower it.
Flatten
Sets the area bounded by the brush surface to be a flat plane.
Smooth
Smoothes, within the bounds of the brush, rough areas of varying terrain height.
Set Height
Sets the terrain within the brush to a constant height as specified in the Terrain
Editor settings.
Set Empty
Converts the squares covered by the brush into holes in the terrain.
Clear Empty
Makes the squares covered by the brush solid.
Paint Material
Paints the current terrain texture material with the brush.
Table 18.4 Terrain Terraform Editor Functions
Function Description
fBm Fractal
Creates bumpy hills.
Rigid Multifractal
So, you've now seen how you can create and modify your game environment. The three
main environmental elements are Sky, Clouds, and Water. We looked at the different ways
each of those three elements can be created using tools and techniques available in Torque.
In most cases, you will probably use some form of all of those techniques when you cre-
ate your game. For example, you would judiciously mix overhead cloud layers with sky-
box renderings of distant clouds on the horizon.
We've also looked at the combined weather effects involved in storms, and how you can
initiate an automated process to start and end storms over time using Torque Script.
In this chapter, we were introduced to sounds in the form of thunder for the lightning
strikes. In the next chapter we will more thoroughly explore how to incorporate sounds
in our game.
Chapter 18
■
Making the Game World Environment538
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
539
Creating and
Programming Sound
chapter 19
A
s I mentioned in Chapter 1, audio artists compose the music and sound in a
game. Good designers work with creative and inspired audio artists to create
musical compositions that intensify the game experience.
It also bears repeating that audio artists work closely with the game designers determining
where the sound effects are needed and what the character of the sounds should be. They
often spend quite a bit of time experimenting with sound-effect sources, looking for differ-
ent ways to generate the precise sound needed. Visit an audio artist at work and you might
catch him slapping rulers and dropping boxes in front of a microphone. After capturing the
basic sound, an audio artist will then massage the sound with sound-editing tools, varying
your sounds directly from a microphone; you can record from a CD or another audio
source. In any event, you need to have that source connected to the correct input and
ensure that your audio mixer is set up to record from that source. You should refer to your
sound card documentation if you don't know how to do this.
The basic operation of Audacity
is quite straightforward for
recording, simple editing, play-
back, and saving your data.
Recording
Let's record some sound:
1. Launch Audacity by choos-
ing Start, Programs, Audac-
ity, Audacity. You will get
the main window, as you
saw earlier in Figure 19.1.
2. Click the Record button, as
shown in Figure 19.2.
Chapter 19
■
Creating and Programming Sound540
Figure 19.1 Audacity main window.
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
The program is now recording from the
microphone. You can see the progress of
the recording and the waveforms of the
sounds in the window as the recording
proceeds, as shown in Figure 19.3.
3. Speak into the microphone, or if you
don't want to hear your
another chunk afterward. That's fine, because it's easy to fix. So, picking up where we left
off in the previous section:
Audacity 541
Figure 19.2 The Record button.
Figure 19.3 Recording in progress.
Figure 19.4 Waveform in Audacity.
Figure 19.5 Stop recording.
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
6. Place your cursor to one side of the portion
of the waveform you want to eliminate, and
drag it across to the other side. This selects an
area to be worked on. See Figure 19.7.
7. Choose Edit, Delete. The selected portion will
be excised from the waveform.
8. Repeat the preceding two steps for the
unwanted portions of the waveform on the
other side of your sound effect. Eventually you
will end up with something like Figure 19.8.
We're not finished with our procedure yet; there's
still some exporting to do. But before we cover
that, I want to mention that above the waveform
panel is a series of numbers on a scale. This is the
elapsed time scale. The example in Figure 19.8
shows that my final waveform is just a little more
than three-quarters of a second in duration.
Exporting
Now, once again picking up where we left off, you need to save the
sound effect as a file before you can use it:
9. Choose File, Export as WAV. Name your file and save it some-
19.1 to review their functions.
The Track Panel contains tools
for managing specific tracks
and groups of tracks. See Table
19.2 for details.
Audacity 543
Envelope
Toolbar
Time Scale
Play Stop Record Master Gain
Selection
Time
Shift
Zoom
Track Delete
Track
Panel
Waveform
Panel
Track Menu
Track Mute
Track Solo
Sample Rate
Figure 19.9 The Audacity main screen.
Table 19.1 Toolbar Tools
Tool Description
Selection Selects a portion of the audio track. You can set the position of the track cursor simply by
clicking at the right place in the track. Select a range of audio by clicking and dragging
over the desired portion. Select multiple tracks by dragging across the tracks. Playback
begins at the position of the track cursor and will play to the end of the track. If you
Common values for audio sample rates are shown in Table 19.4.
Chapter 19
■
Creating and Programming Sound544
Table 19.2 Track Panel Tools
Tool Description
Track Menu Allows the user to display a track in different formats. This menu also provides the
Set Name option that allows the user to create a name for a given track.
Track Delete Immediately deletes a track, without the option to undo. Use this button carefully.
Solo Switches the current track to solo mode. You can change a track out of solo mode
by clicking it again. When in solo mode, the button for that track turns red. Only
tracks that have the Solo button enabled will be played when in solo mode.
Mute Switches off a track without deleting it. You can unmute a track just by clicking the
Mute button again. When muted, a track's Mute button will be green.
Table 19.3 Track Types
Tool Description
Audio Audio tracks contain digitally sampled sounds. Two stereo channels are
represented by two stereo tracks. Each audio track has a sample rate that is the
same as the project sample rate.
Note Note tracks display data loaded from a MIDI file. They cannot be changed or
played, only viewed.
Label Label tracks can be used to mark a document with annotations. Annotations can
be saved to a text file.
Table 19.4 Common Sample Rates
Frequency Usage
8000 Hertz Typical telephone
11025 Hertz Minimum "voice quality"
16000 Hertz Typical "voice quality"
22050 Hertz Common digital interactive media
44100 Hertz CD audio, DAT (digital audiotape)
helps when dealing with complex tasks. Figure
19.13 shows the Project menu, and Table 19.8 con-
tains an itemized description of the menu.
The Effect Menu
Audacity includes many built-in effects and also
lets you use plug-in effects. To apply an effect, sim-
ply select part or all of the tracks you want to mod-
ify, and select the effect from the menu. Figure
19.14 shows the Effect menu, and Table 19.9 con-
tains an itemized description of the menu.
Audacity 545
Figure 19.10 File
menu.
Figure 19.11
Edit menu.
Figure 19.13 Project
menu.
Figure 19.12 View
menu.
Figure 19.14
Effect menu.
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Chapter 19
■
Creating and Programming Sound546
Table 19.5 File Menu
Menu Item Description
New Creates a new empty project window.
Open Presents you with a dialog box to choose a file to open. If a project window
the last time the document was saved.
Redo Redoes edits that were just undone. The redo history remains available until you do a
fresh edit.
Cut Removes the selected audio data and moves it to the Clipboard.
Copy Copies the selected audio data to the Clipboard.
Paste Inserts the Clipboard contents at the position of the selection cursor in the project,
replacing any selected data.
Delete Removes selected data without copying it to the Clipboard.
Silence Replaces selected audio data with silence.
Insert Silence Inserts the prompted amount of silence entered at the current track cursor position in
the project. Overwrites selections.
Split Moves the selected region into its own track or tracks, replacing the affected portion
of the original track with silence.
Duplicate Makes a copy of all or part of a track or set of tracks into new tracks.
Select All Selects all of the audio in all of the tracks.
Table 19.7 View Menu
Menu Item Description
Zoom In Zooms in on a portion of the audio data. Doing this allows you to view
more data detail for a smaller time period.
Zoom Normal Changes the zoom factor to one inch of data for one second of time; this is
the default zoom factor.
Zoom Out Zooms out so you can see a larger time base, at the cost of less detail.
Fit in Window Adjusts the zoom factor so that the entire project fits exactly in the window.
Plot Spectrum Plots a spectrum for a selected portion of a single track. First select a
portion of audio data from a single track, then select this menu item. A
window will open that will display the Power Spectrum of the audio for the
selected data. The Power Spectrum computation uses the
Fast Fourier
Transform
(FFT) algorithm to graph the proportional energy level for each
Align Tracks Together Adjusts the time offset of selected multiple tracks to make them start at the
same time. The starting time is adjusted to the average of all tracks' original
starting times.
Align with Zero Resets the time offset of elected multiple tracks to zero.
New Audio Track Creates a new audio track with no data.
New Label Track Creates a new label track.
Remove Track(s) Removes the selected track or tracks from the project. You only need to
select a portion of a track for it to be removed.
Add Label At Selection Creates a new label at the current selection.
Team LRN
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.