1 / 70

Sega 500

Sega 500. About Sound in UT2003. Jeff “Ezeikeil” Giles jgiles@artschool.com http://gamestudies.cdis.org/~jgiles. Yesterday. We cover a whole pile of sound theory. Hopefully getting the basics and terminology down. Also, imported sound into UT2003. Today .

Download Presentation

Sega 500

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sega 500 About Sound in UT2003 Jeff “Ezeikeil” Giles jgiles@artschool.com http://gamestudies.cdis.org/~jgiles

  2. Yesterday • We cover a whole pile of sound theory. Hopefully getting the basics and terminology down. • Also, imported sound into UT2003.

  3. Today • Although we already know about and how to use the PlaySound function, we’ve not really looked at it’s specifics. • UT has an 8 channel sound system allowing for multiple sounds to play at one time.

  4. Today • It also has a dedicate channel to play the in game music. • We’ll look at each of these in turn.

  5. A note about this lesson… • After much rooting around the internet to find new documentation which related to sound for UT2003, I turned up very little that was significantly different from the previous version.

  6. A note about this lesson… • Hence, this lecture is based in part on the documentation from the previous version of UT and may be dated. • However, my usages of the sound functionality indicates little has changed.

  7. A note about this lesson… • Also, I’ve edited some sample sounds in sound forge to illustrate what I’m talking about…these are formatted differently and may not import into UT directly.

  8. Sound in UT2003 • As we saw yesterday, USound contains a sound sample with the following characteristics: • .WAV format. • 8-bit or 16-bit format. • Monaural. • Either one-shot or looped.

  9. Sound in UT2003 • And will happily accept imports up to 44100hz at 16 bits. • Yet I’ve seen as high as 48000hz…and we talked about why this is not necessarily a good idea.

  10. Sound in UT2003 • Sound effects can be either 8-bit or 16-bit, and can be sampled at any reasonable rate (4kHz-44kHz). • What rate and bit depth to use is entirely a quality vs. memory usage tradeoff. In general, use the lowest bit depth and sampling rate which gives you acceptable sound quality.

  11. Sound in UT2003 • There are a few limitations to be aware of • Software-mixed sound: • 3D sounds are only stereo panned, but not fully spatialized (i.e. phase shifted and bandpass filtered based on sound absorption in the ear as a function of position).

  12. Sound in UT2003 • The sound system is limited to a maximum of 64 channels of music and sound. By default, 16 sound effects channels are allocated, leaving 48 for music. You can change this from the Unreal.ini file. • (note: my default was set to 32 channels)

  13. Sound in UT2003 • Each playing sound effect, ambient sound, and music channel uses CPU time. Therefore, it is recommended to keep the number of sound effects audible to the player fairly low, and keeping music channel usage "lean and mean".

  14. 3D Positioning • Being a 3D game, you’ll notice that the sound appears to pan around the player as he changes his facing in relation to the source. SAMPLE

  15. 3D Positioning • As the actor that played the sound moves around, the actor's sound is repositioned. The affects the following properties: • Distance attenuation. • Doppler shifting. • Stereo panning (if UseStereo is enabled). • Dolby Surround Sound positioning (if UseSurround is enabled).

  16. 3D Positioning • Doppler shifting is based on the emitting actor's Velocity. • Note that it is possible for actors to move around directly with SetLocation or MoveActor without having a valid Velocity, thereby causing no doppler shifting.

  17. 3D Positioning • Dolby SurroundSound software encoding requires a Dolby decoder and four speakers, but it works on all stereo sound cards. • It simply pans sound effects and ambient environment sounds between the four Dolby channels (center, rear, left, and right).

  18. 3D Positioning • Sounds have a radius. They diminish linearly according to distance and are culled when too far away to hear. • Culling distance is a linear function of the sound's volume More on this later

  19. Sound in UT2003 • So, lets kick open the actor class and have a closer look at the playsound function and how it works.

  20. Sound in UT2003 native(264) final function PlaySound ( sound Sound, optional ESoundSlot Slot, optional float Volume, optional bool bNoOverride, optional float Radius, optional float Pitch, optional bool Attenuate );

  21. Sound in UT2003 • It plays a simple, non-looping sound effect emanating from the actor. Use this for all normal game sound effects.

  22. Sound in UT2003 • The Parameters • Sound: A sound effect; should be a one-shot (non-looping) sound.

  23. Sound in UT2003 • Slot: One of the eight "slots" to play the sound in. This enables you to prevent more than one sound from playing on a particular slot. • For example, when an enemy is shot several times in rapid succession, you want the successive sound effects to cut each other off, rather than hearing a chorus of simultaneous, overlapping screams.

  24. Sound in UT2003 • Volume: Sound volume multiplier. 1.0 means "normal volume", 0.5 means "half volume", 2.0 means "double volume"

  25. Sound in UT2003 • bNoOverride: Whether this sound effect should override another sound playing on the same slot, or be ignored. • Radius: Radius of the sound in world units, defaults to 4096.0.

  26. Sound in UT2003 • Pitch: Pitch multiplier. 1.0 means "normal pitch", 0.5 means "half pitch". • Attenuate: the sound fall off over distance from its source.

  27. Sound Slots • Each actor in the world has eight "sound slots", so it can play up to 7 simultaneous (overlapping) sound effects.

  28. Sound Slots // Sound slots for actors. enum ESoundSlot { SLOT_None, SLOT_Misc, SLOT_Pain, SLOT_Interact, SLOT_Ambient, SLOT_Talk, SLOT_Interface, }; • Declared in actor:

  29. Sound Slots • When an actor plays a sound in a slot where an old sound is already playing, the old sound can either be cut off and overridden, or the new sound can be ignored (see the bNoOverride parameter in PlaySound).

  30. Sound Slots • When an actor plays a sound in a slot where an old sound is already playing, the old sound can either be cut off and overridden, or the new sound can be ignored (see the bNoOverride parameter in PlaySound).

  31. Sound Slots • In Unreal, there is a hard limit to the number of sound effects which may be playing simultaneously.  This limit is set in the Unreal.ini file, and can vary from 16 to 32. • Try setting it to like one or two…

  32. Sound Slots • During gameplay, the sound engine prioritizes each sound effect according to its volume and its distance from the listener, and culls the least important sounds.   • High-volume sounds override low-volume sounds, and sounds near the listener override sounds far away from the listener.

  33. Sound in UT2003 • I’m sure you’ve already been using the PlaySound function to make noise, but did you know there are other noise maker functions?

  34. Sound in UT2003 native simulated final function PlayOwnedSound • Play a sound effect, but don't propagate to a remote owner (he is playing the sound clientside) • Also declared in actor.

  35. Sound in UT2003 • But talk a look in the player controller now…there’s another one. simulated function ClientPlaySound( sound ASound, optional bool bVolumeControl, optional float inAtten, optional ESoundSlot slot )

  36. Sound in UT2003 • This will play a sound only on the client side so only client will hear it. • It is called when the client hears a sound. • His sound will not be replicated over a network game.

  37. Sound in UT2003 • There is also a single handy function to help you out with the timing of your sounds. • Which does just as the name promises, returns the length of the sound in seconds…real hand for sorting out timing in your states  GetSoundDuration( sound Sound );

  38. Sound in UT2003 • Right, making noise is all well and good. • But am I to infer that, since we can play sounds that only a client can hear, we can further restrict who hears what?

  39. Sound in UT2003 • Well, yeah…pretty much. • Root around the player controller some more and find this function. ClientHearSound

  40. Sound in UT2003 native event ClientHearSound ( actor Actor, int Id, sound S, vector SoundLocation, vector Parameters, bool Attenuate );

  41. Sound in UT2003 • This is called when a particular PlayerPawn actor hears a sound effect. • This is how sounds are sent to clients in a network game. You may call this function directly (in a particular PlayerPawn) to have only that one player hear a sound.

  42. Sound in UT2003 • Unfortunately, it’s a native function, so we can’t look at how it ticks. • Also, it’s only usage is in a replication statement…so, your guess is as good as mine on how to use this one… • But doing some more mining, we turn up how AI players make and hear sounds.

  43. Sound in UT2003 • Inform other creatures that you've made a noise they might hear (they are sent a HearNoise message, not an actual sound) • Senders of MakeNoise should have an instigator if they are not pawns. native(512) final function MakeNoise( float Loudness );

  44. Sound in UT2003 • And rooting into the controller class we have : • For who made the noise & how loud is was. At this point, it’s just a function stub. Implementation is further down the chain in bot. But being an event, the actual notification comes out of a native file. event HearNoise( float Loudness, Actor NoiseMaker);

  45. Ambient Soundsin UT2003 • Each actor in the level can have one ambient sound effect, which is specified in its AmbientSound property. Things like a running engine, or stream or other “operational” sounds. • This should refer to a sound effect which loops. If a non-looping sound effect is used as an AmbientSound, it will not play properly (it will only play once, so if your nowhere near it when the actor begins…too bad for you!).

  46. Sound in our World • As you may have notice, sound in UT can be obscured by geometry and other game objects… • In effect occluding how we hear it.

  47. Sound in our World • All nicely wrapped in an enum // Sound occlusion enum ESoundOcclusion { OCCLUSION_Default, OCCLUSION_None, OCCLUSION_BSP, OCCLUSION_StaticMeshes, };

  48. Sound in our World • Basically, that which we can’t hear through. • However, This feature works only with a EAX 3.0 SoundBlaster Audigy card. If you have one of these babies…hang on! 

  49. Sound in our World • in effect, providing you with realistic environmental effects, such as reverb and echos. • In addition, we can also create sound effects specific to our zones.

  50. Sound in our World • However, once again, to take full advantage of these, you need the eax 3.0 support of a sound blaster Audigy card. • So if you have one…giddy up!

More Related