TPW SOAP - SOnic Ambience Program

Author: tpw, autigergrad
Requires: Community Base Addons A3, tpw_ambience.pbo
Compatibility: SP, possibly MP client

Description
-----------
Tired of walking around maps that have no audible signs of human presence other than combat sounds? Wouldn't it be nice to hear the hum of foreign voices, occasional exclamations, the murmur of distant traffic, music, and other sounds of life? TPW SOAP was developed to add just this kind of ambience to any Arma3 playable map. My goal was to create a convincing soundscape so that your ears fill in what the game has trouble providing for your eyes: a living breathing world with a population of men, women and children who react to you and the combat happening around you.  

To do this TPW SOAP adds appropriate Middle Eastern,Greek and Fijian environmental ambience (voices, traffic, radio), spawned into nearby habitable houses. Music and sound volume and spawning frequency are independently modulated over the course of the day, from barely audible at 3am to very lively around 6pm. Volume will also drop during battle (if people are killed), to simulate civilian apprehension. To further the battle atmosphere, nearby gunfire will also elicit screaming, babies crying and dogs barking from houses near the player. The system works most convincingly on Fijian, Greek and Middle Eastern / Central Asian themed maps, but also works surprisingly well on other maps (though may not if you are a Greek/Fijian/Arabic speaker!). TPW SOAP's sounds are dependent on the number of habitable houses near the player: in an isolated hamlet with 2 houses you'll hear occasional voices or traffic, in a densely crowded village you'll hear bazaar-like ambience with a din of voices, music and traffic. Sounds smoothly fade in and out as the footbound player moves around the map. Sounds will not disconcertingly continue to spawn in the house the player is currently in.

TPW SOAP also adds subtle ambience when inside houses. You'll occasionally hear the creak of timbers and doors, and if it's windy outside you'll hear wind whistling around the house and rattling windows/doors. 

TPW SOAP can optionally play the user's music & sounds (this feature is switched off by default). To use your own music or sounds, you'll first need to convert them to OGG VORBIS format using Audacity or similar. Rename them 1.ogg -> 20.ogg (maximum of 20 allowed), and copy songs into @TPW_MODS\music and sounds into @TPW_MODS\sounds. Songs should be less than 3 minutes long each, sounds less than 30 seconds. Set tpw_soap_usermusic and tpw_soap_usersounds to the number of songs and sounds you added, and in game you'll then occasionally hear your music and sounds emanating from various houses, in addition to the built in ambience.

TPW SOAP can be disabled at any time by setting tpw_soap_active = false via the debug shell or a trigger or script, and reanabled by setting tpw_soap_active = true. 

Known issues
---------------------------
	- TPW SOAP is configured to use a maximum of about 16 simultaneous samples. While this causes insignificant load on the game and hard drive, it may potentially cause issues if there are many other sounds playing also. Please increase your number of sound sources to 128 in Arma 3 -> configure -> audio
	- By default TPW SOAP will autodetect Greek / Fijian maps and play Greek / Fijian sounds respectively, and will use Middle Eastern sounds on other maps. It can be forced to use Greek, Fijian or Middle Eastern sounds by setting tpw_soap_region to 1 (Greek), 2 (Middle Eastern) or 3 (Fijian). This behaviour will be expanded on as other regional sounds are added.
	- TPW SOAP largely supersedes the house radios in TPW RADIO, and these are now disabled.
	- TPW SOAP is entirely designed around audio ambience for the footbound player, and is inactive when the player is in any vehicle. The speed of house scanning, number, length, audibility range and volume of sounds is all designed so that ambient noise will always follow the player no matter how fast they walk or run. 
	- TPW SOAP spawns sounds using playsound3d, which does not allow sounds to be controlled (stopped or volume changed) while they are playing. This means that any changes to volume only take affect when new sounds are played. If there are deaths on the map, it may take a minute or so for the overall ambient sound volume to decrease around you.  
	
Thanks
------
An enormous debt of thanks to autigergrad for kind permission to use the astonishing quality sounds from his Middle Eastern regional ambience pack as the initial samples in TPW SOAP. 