Page 1 of 1

Map Ambient Sounds

Posted: Sat Oct 06, 2012 6:53 am
by Zero Angel
What is the best way to add ambient sounds to a map?

My original idea was to use some 'cricket' sounds, and have them play all around the player at random and preferably not-too-frequent intervals.

The first thing I tried was creating a special 'grass' ODF that played cricket sounds as its ambientSound

Code: Select all

[GameObjectClass]
geometryName = "mograss01.xsi"
classLabel = "i76building"
collisionRadius = 1.0
scrapCost = 0
scrapValue = 0
maxHealth = 1000
maxAmmo = 0
unitName = "i76building"
heatSignature = 0.1
imageSignature = 1.0
radarSignature = 0.2
explosionName = "xplnxpl"
canDetect = 0
canInteract = 0
canSnipe = 0
powerCost = 0

lightingType = 1

[BuildingClass]
soundAmbient = "vsenvcrickets.wav"
However the grass pieces output no sound. (UPDATE: They do actually, the no sound was due to duplicate assets)

My second and likely better idea is to use a weaponMine that fires a 'null' ordnance with the cricket sound as it's shotSound. However, I would like the weaponMine to be visible in the editor, but invisible outside of the editor -- as well as being ignored by the AI. How would I accomplish that? Or is there a better way to do things?

Re: Map Ambient Sounds

Posted: Sat Oct 06, 2012 9:45 am
by Ded10c
FE used soundmines placed underground, BZ2 used soundcubes. Examples of both are in the respective paks.

Re: Map Ambient Sounds

Posted: Sat Oct 06, 2012 10:15 am
by MrTwosheds
Flare mines can be set up to fire off sounds every now and then, they are a high priority sound. As for being invisible, I sometimes prefer to disguise them as props, crickets sound good as grass or tree's. Rocks can be just set to use ambient sound for wind, they only play on a low priority then (usually better for ambient stuff)
Using spawn points to spawn limited life objects gives you the ability to define 2 different silence periods between firings, so the effect seems more random. eg flare mine fires a 3 seconds sound once every 10 secs with a lifespan of 24 sec's and a respawn time of 1 min. For even more random like firing you can spawn a spawn point that spawns something else. Spawn points are visible only in the editor. And of course you can give them other sounds too.
Wind blows, stops, crickets sing 3 times, dog barks once, silence for 30 seconds then repeats every minute for 3 minutes, then silence for 2 minutes...
Weapon mines are best for proximity triggered sounds really, for ambient sounds they tend to be very predictable.

Re: Map Ambient Sounds

Posted: Sun Oct 07, 2012 11:27 pm
by Zero Angel
Interesting ideas MTS. I never though of using spawn points like this -- it should break the uniformity that soundAmbient on permanent map objects tends to produce. Underground sound mines seems a good idea too.

Re: Map Ambient Sounds

Posted: Mon Oct 08, 2012 12:16 am
by MrTwosheds
Sound ambient is actually best for a lot of sound types, nothing more unrealistic than a bunch of crickets breaking into song mid battle, and being louder than it. Sound ambient is fairly low in priority, so bz2 will not bother with it if there's a lot of other sounds going off, so its a matter of choosing an object type for a certain type of sound. Spawning a limited life "building" with lower priority sound for your crickets would be better than a high priority flare mine, but if you wanted an alarm sound you would want it to be a high priority.

Re: Map Ambient Sounds

Posted: Wed Oct 31, 2012 4:41 pm
by TheJamsh
One great way to do it, is to use an i76building like you did, and just use a basic cube for the mesh, or whatever you want really. I created a few editor-specific meshes a while ago, basically it was just a 3D model of a speaker. You'd place the object on the map, then save it.

Now here's the fun part, you re-open the ODF file of the sound building, and replace the gemoetry with geometryName = NULL. Now when you load up the map in-game, the editor sprites/models are gone. If you need to grab/move them again or want to see where they are, re-add them back in :)

There are btw, a few additional flags for ambient sounds. One of them being soundAmbientDist = ### (max = 250 i believe). It's a good way to specify a cut-off distance for the ambient sound.

If you have the UEP - DM: River and CTF: Torlan use ambient sounds in a few places. Really adds an extra lease of life to a map!

Re: Map Ambient Sounds

Posted: Wed Oct 31, 2012 6:46 pm
by General BlackDragon
Just tested it under [BuildingClass], didn't work.

Stop making up odf variables.

Re: Map Ambient Sounds

Posted: Wed Oct 31, 2012 7:01 pm
by Red Devil
BZ2\Data\audio\soundcube\bane_crack.odf

[BuildingClass]
SoundAmbient = "benv09.wav"
SoundAmbientDist = 0.7

Re: Map Ambient Sounds

Posted: Wed Oct 31, 2012 7:33 pm
by General BlackDragon
Nope, tried using value 50.0 and 0.25, no effect or change from either.

Re: Map Ambient Sounds

Posted: Thu Nov 08, 2012 10:21 am
by TheJamsh
0.7 makes me wonder if it's a multiplier... In Gameprefs, there is a maximum distance for audio (250.0f), which is capped at 225.0f or something (I'm guessing the 'f' means Float?)

I definitely used it in the UEP somewhere. Try opening one of those maps in the editor, finding the (invisible) sound cubes, and then digging them out of the PAK file.

Re: Map Ambient Sounds

Posted: Thu Nov 08, 2012 10:38 am
by Ded10c
Test it using values under 1.0 and see what happens.

Re: Map Ambient Sounds

Posted: Thu Nov 08, 2012 3:44 pm
by General BlackDragon
I tried 0.25 to no avail.

And yes, 250.0f is the max, and f means float.