3D Game Programming All in One By Kenneth C. Finney
Chapter 20 Game Sound and Music
Game Sound and Music World sounds (3D sounds) –Server generated –Dynamically triggered sounds Walking, weapons, collisions Client-only sounds –Personal noises Breathing, pain –Communications Radio
Game Sound and Music Footsteps Can be animation triggered –(was not in book at press time, is now available for Milkshape) Also can be direct message triggered Client decides to activate, tells server to play sound effect and manage timing so all can hear
Game Sound and Music Footsteps Need a footstep sound, audio descriptor, and profile Need to link messaging to movement key handler Pressing move key tells server to start playing sound Releasing move key tells server to stop
Game Sound and Music Lab 1: Making Footsteps Practice recording sound effect Practice creating an audio descriptor and profile Exposure to movement handler
Game Sound and Music Lab 2: Making Utterances Practice recording sound effect Practice creating an audio descriptor and profile Exposure to key binding code Exposure to random number generation
Game Sound and Music Weapon Sounds Require a complete weapon definition to use a weapon sound correctly State machine controls sound States include: preactivate, activate, ready, no ammo, fire, reload, finished reloading, dry fire, wait trigger release
Game Sound and Music Lab 3: Creating Weapon Sounds Practice recording sounds Practice creating an audio descriptor and profile Exposure to weapon state machine code Learn how to place weapons in game world
Game Sound and Music Vehicle Sounds Idle, acceleration, wheel impact, wheel squeal, soft crash, hard crash Audio profiles are needed Vehicle datablock points to profiles
Game Sound and Music Lab 4: Making Vehicle Sounds Practice recording sounds Practice creating audio profiles Exposure to vehicle datablock Practice placing vehicles in a game world
Game Sound and Music Environmental Sounds Need a profile for each sound Create audio emitters that point to audio profiles Torque has built-in Audio Emitter tools Sounds must record as monophonic sounds to be used as 3D sounds in- game
Game Sound and Music Lab 5: Environmental Sounds Learn how to create audio emitters using the World Editor Creator Use the World Editor Inspector to adjust audio emitter parameters
Game Sound and Music Interface Sounds GuiDefaultProfile objects can emit sounds triggered by the mouse soundButtonDown triggers a sound when the mouse button is pressed soundButtonOver triggers a sound when the mouse cursor passes over the object
Game Sound and Music Music Treat it exactly the same as sound effects Descriptors and profiles are needed Music can be started, stopped, and monitored
Game Sound and Music Lab 6: Create Start-up Music Practice creating emitters Learn how to judge where in code to place music controls Exposure to simple music control functions
Summary Sounds can be played with direct commands, triggered, or scheduled Weapons have a state machine which controls their sounds 3D Sound Emitter objects can be placed at locations in a game world 3D sounds must be monophonic Music is handled exactly the same way as sound effects