Home   Help Search Login Register  

Author Topic: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta 0.3 out now!  (Read 18272 times)

0 Members and 1 Guest are viewing this topic.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Wolfrug's Dynamic Sound AI (RUG DSAI).
Version: 0.3 BETA
Requires: ArmA v.1.08
Credits: ECP for Generic Sounds & Russian voices (and inspiration), Soldier of Fortune II demo for Spanish voices, COD4 demo for Arab voices, BIS for US voices. Armaholic for hosting me!
Beta thread: http://www.ofpec.com/forum/index.php?topic=30495.0

Download links:
(Look in the above thread for link to "full" version)
Filefront link: Beta 0.3 LITE
Armedassault.info mirror: Lite + normal
Armaholic mirror: Lite + normal
Filefront mirror for EXTRA RUSSIAN VOICES : just unzip into the same directory as the full version (will only overwrite init.sqs).

Missions using DSAI:

Were We Soldiers by MrN (requires VTE mod - uses modified v.0.1)

Version history:

V0.1 BETA
- Initial release

v0.2 BETA
- Added two new scripts (UnderFireCheck.sqf & ContactCheck.sqf)
- Changed the scripts from group-centric to unit-array centric.
- Added Spanish sounds (SF2 demo)
- Removed Russian sounds (too big + no word from ECP)
- Added global variable RUG_DSAI_TerminalDistance to decide on range of scripts.
- Split into Lite and normal versions.

v0.3 BETA
- Added more functionality to RUG_DSAI_TerminalDistance (can actually terminate all scripts now).
- Added second global variable RUG_DSAI_CycleTime to decide loop rates of certain scripts.
- Added two new sound level defines to the description.ext, so that there are now three: normal, loud and quiet (GENERAL_SPEECH_SOUND_LEVEL, GENERAL_SPEECH_SOUND_LEVEL2, GENERAL_SPEECH_SOUND_LEVEL3)
- Minor fixes on some scripts.
- Added proper readme :)
- Added some minor elements to the demo mission...

Contents of readme (available in download packages for v0.3)):
1) Concept
2) Use (overall)
3) Guide on how to add to your own mission.

1)Concept:

This is a Dynamic Sound AI (DSAI) much like the one used in the OFP Mod Enhanced Configuration Project (ECP), from where the inspiration to make this came.

What it does is add voices to soldiers which are appropriate to the situation. It is a (in my opinion) easily enough editable package, that can be added to any mission with a minimum of hassle. There are currently two versions: Lite, which only has the default BIS voices, and "normal", which also contains the configs and sound files for Spanish and Arabic.

2)Use (overall):

Everything important is inside a folder named "RUG_DSAI", except the RUG_DSAIinit.sqf scripts (more on them later). The RUG_DSAI folder has within it the *.h files which define the various sounds (included or excluded from the description.ext using #include as wished by the mission maker).

It also has functions (named things such as DSAI_Behaviour.sqf, or DSAI_ArabBehaviour.sqf). These contain within them the LISTS OF SOUNDS used by the scripts withing the RUG_DSAI\Scripts folder. This is where the real "dynamicness" comes in. You can, for instance, make a list of sounds which only use ONE speaker (say Robert Polo, or "number 4", or whatever), and then use that list for that one character, to avoid having one person speak in many different voices. Alternatively, if you don't like certain sounds, you can simply edit them out of this list and they'll never be spoken. The current lists are (for standard English sounds):

DSAI_Behaviour.sqf -> sounds for Safe/aware/combat/stealth.
DSAI_EnemyKilled.sqf -> sounds for "normal" enemy kill (<1000 rating change) and "big" enemy kill (>1000 rating change)
DSAI_Fleeing -> Activated for units within the group that are fleeing.
DSAI_Generic -> not language bound. Contains sounds like "ahem", and "sneeze" and "laugh" (stolen from ECP). Dependant on the current behaviour of the group (i.e., no laughing while in Aware, etc).
DSAI_Misc -> miscellaneous sounds, such as for reloading, throwing grenades, firing weapons.
DSAI_OwnKilled -> Sounds for when someone in the group is killed and teammembers react.
DSAI_Wounded -> Sounds played when and while wounded.
DSAI_Contact -> Sounds played when in contact and out of contact (v0.2)
DSAI_UnderFire -> Sounds played when under fire (sometimes: rather iffy) (v0.2)

The RUG_DSAI\Sounds folder holds within it the sounds. Their paths are defined in the *.h files in the root RUG_DSAI folder. Don't move them around unless you also change their path in the *.h file!

The RUG_DSAI\Scripts folder holds within it the scripts used globally by each "list". Most scripts take two arguments: the name of the list and the name of the group it's to be applied on. Some scripts are run for each unit separately.

And finally: the RUG_DSAIInit.sqf files: these simply run all the scripts in their right folders for the group. It will first pre-compile the lists, then send them off to each script together with the group name.

3)Tutorial on how to add to your own mission:

1) Make sure the mission file in question is "open" (i.e., not in .pbo format), and then copy over to it the whole RUG_DSAI folder, and the DSAIInit.sqf files you need (for instance the default RUG_DSAIInit.sqf and RUG_ArabDSAIInit.sqf). You can remove any sounds you find unnecessary to make the file size smaller.

2) From the description.ext included in the demo mission, first copy over to the other mission's description.ext the top section that says:


Code: [Select]
#define GENERAL_SPEECH_SOUND_LEVEL db-0
#define GENERAL_SPEECH_SOUND_LEVEL2 db-10
#define GENERAL_SPEECH_SOUND_LEVEL3 db-30

#define GENERAL_SPEECH_SOUND_LEVEL4 db-35
#define GENERAL_SPEECH_SOUND_LEVEL5 db-10
#define GENERAL_SPEECH_SOUND_LEVEL6 db-10

(You really only need the top three, the others might be implemented in the future). If the mission doesn't have a description.ext, you can just copy the demo mission's as a whole.

After that, in the other mission's description.ext you need to find a point where it says:


Code: [Select]
class CfgSounds
{
sounds[] = {};

There might or might not be a section like this: if there isn't one, just copy it from the demo mission's description.ext. If there is one, though, copy-paste all the #includes into it (just put them straight under the sounds[]= {}; to make sure they're within the curled brackets. Afterwards it should look something like this:

Code: [Select]
class CfgSounds
{
sounds[] = {};

// RUG_DSAI sounds

#include "RUG_DSAI\DSAI_BehaviourSounds.h"
#include "RUG_DSAI\DSAI_FleeingSounds.h"
#include "RUG_DSAI\DSAI_WoundedSounds.h"
#include "RUG_DSAI\DSAI_OwnKilledSounds.h"
#include "RUG_DSAI\DSAI_EnemyKilledSounds.h"
#include "RUG_DSAI\DSAI_MiscSounds.h"
#include "RUG_DSAI\DSAI_GenericSounds.h"
#include "RUG_DSAI\DSAI_ContactSounds.h"
#include "RUG_DSAI\DSAI_UnderFireSounds.h"

#include "RUG_DSAI\DSAI_RUSBehaviourSounds.h"

#include "RUG_DSAI\DSAI_ArabBehaviourSounds.h"
#include "RUG_DSAI\DSAI_ArabEnemyKilledSounds.h"
#include "RUG_DSAI\DSAI_ArabMiscSounds.h"
#include "RUG_DSAI\DSAI_ArabWoundedSounds.h"
#include "RUG_DSAI\DSAI_ArabOwnKilledSounds.h"
#include "RUG_DSAI\DSAI_ArabContactSounds.h"
#include "RUG_DSAI\DSAI_ArabUnderFireSounds.h"

#include "RUG_DSAI\DSAI_SPABehaviourSounds.h"
#include "RUG_DSAI\DSAI_SPAEnemyKilledSounds.h"
#include "RUG_DSAI\DSAI_SPAWoundedSounds.h"
#include "RUG_DSAI\DSAI_SPAOwnKilledSounds.h"
#include "RUG_DSAI\DSAI_SPAContactSounds.h"
};


Note that if you're not using any of the languages mentioned up above, you can just edit out them (i.e. SPA and RUS). Nothing changes though if you leave them in.

3) After this, it's just a matter of initializing the sounds themselves! This is best done from the init.sqs or init.sqf file of the mission. If the mission for some reason doesn't have an init.sqs or init.sqf, just copy-paste the one from the demo mission. The command is fairly simple:

Code: [Select]
;RUG_TerminalDistance is the distance in meters at which all DSAI scripts shut off automatically. Default = 1000.
;Setting RUG_TerminalDistance to -1 automatically shuts off all DSAI scripts. Setting it to 0 pauses them.
;RUG_CycleTime is a relative number in seconds which determines how often certain sounds are played. Default = 5.

RUG_DSAI_TerminalDistance = 1000;
RUG_DSAI_CycleTime = 5;

RUG_DSAI= [(units aPgrp), (units bPgrp), units dudegrp] execVM "RUG_DSAIinit.sqf"

(note that if you're pasting this into an init.sqf file, you need to delete the commented line that starts with ; up above, and put a ; after each line). What you're seeing above is the standard way of initializing the English-language version for three different groups, named aPgrp, bPgrp and dudeGrp. Most groups in the coop mission should hopefully be named already; you probably need to go into the mission to check out their names (they will have something like "group1 = group this" in their init fields; if they don't, just name the groups using that piece of code (without quotes). Remember to name each group differently!). After you've got the names of each group you want to add, just add them using the same syntax as above. I.e.,


Code: [Select]
RUG_DSAI=[(units NameOfGroup1), (units NameOfGroup2), (units NameOfGroup3)] execVM "RUG_DSAIInit.sqf";

Do the same for the groups you want to have Arab/other language sounds. Find them in the editor, and name them if they aren't already, and then run the same script as above (except with RUG_ArabDSAIInit.sqf, or whichever is applicable). Do note however that if the mission maker has enemy groups (or friendly for that matter) spawn dynamically, you might have to do a lot more work to get the sounds to work with each group. For most standard missions however it should work just fine.  Smiley

NOTE 1: The global variable RUG_DSAI_TerminalDistance. If this is not defined anywhere, it will default to 1000. This will decide the distance in meters around the player that the sounds will be played and the scripts run - mess around with it to see what suits you best. Having a lot of groups far outside of earshot that still have the scripts running is a bit unnecessary, and in cities especially sound occlusion makes it hard to ear very far - so you might want to limit it to something like 500 meters or so. But that's up to you. Setting it to -1 will terminate all RUG_DSAI scripts, setting it to 0 will simply pause them.

NOTE 2: The global variable RUG_DSAI_CycleTime gives a relative amount of time that certain scripts cycle (BehaviourCheck, GenericCheck, WoundedCheck): you can experiment with it to get a quick and easy change on the intervals of those checks (10 is pretty good). It defaults to 5.

NOTE 3: In the description.ext you #defined some variables named GENERAL_SPEECH_SOUND_LEVEL(+ number). The first, unnumbered one, is used by most sounds. The second (GENERAL_SPEECH_SOUND_LEVEL2) is used by the more "shouty" sounds (Behaviour:combat, underfire and contact). The third, GENERAL_SPEECH_SOUND_LEVEL3 is currently only used by the Generic sounds. Basically they are supposed to represent three sound levels: normal, loud and quiet. By either lowering (db-10, for instance) or raising (db+10, for instance) these variables in the description.ext, you can decide how far the voices are heard. It won't raise/lower their -volume-, but they will be heard longer/shorter distances. If you're not happy with 0 (no change), just raise or lower it as you see fit.

Thanks for testing!

Wolfrug out.
« Last Edit: 30 Nov 2007, 19:38:54 by Wolfrug »
"When 900 years YOU reach, look as good you will not!"

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #1 on: 21 Oct 2007, 00:55:40 »
As you are currently worried about performance hit, may you post a mission without sounds defined, or all defined pointing to a short beep or a default ArmA sound just for performance testing purposes?

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #2 on: 21 Oct 2007, 10:29:24 »
 :D 25 mb too big for you, Mandoble?

Anyway, I realised why they're so big. The rus_idle folder has in it several songs that go up to 1.5mb in size, which I don't even use.  :dry: I'll delete those and re-upload a new version. I'll try to convert the COD4 .wavs to .ogg as well...should thin it down.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #3 on: 21 Oct 2007, 13:54:15 »
COD4 didn't copyright their material, eh? Well, why do I have trouble believing that?
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #4 on: 21 Oct 2007, 17:27:13 »
Fair use

Besides, it's entirely non-commercial and for no personal gain what-so-ever. I personally think this goes under the clause of "the court is not interested in trifles, go away". However, if you feel I am infringing upon the rights of the developers of COD4, feel free to send them an e-mail that I've borrowed a couple of their voices, and I'll wait for word from their lawyers.  :scratch:

Crikey.  :D You are a touchy lot sometimes. And no, I'm not going to post up a version that has "beep" sounds instead of the actual sounds. That'd take literal ages to create. However, I -can- change it around so it only uses the sounds that came with the game by default, and remove everything else. This is just a beta version, not a finalized, finished product for everybody's enjoyment.

25 mb is still too much, eh.  :dry:

Wolfrug out.
« Last Edit: 21 Oct 2007, 17:44:49 by Spooner »
"When 900 years YOU reach, look as good you will not!"

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #5 on: 23 Oct 2007, 01:51:05 »
Finaly had time 2 give it a run...  :P  :D

played da demo a lil... it seems nice but deres also some comments i can give from dis fast look

2 much coughing and laughing... b4 fighting starts... it seems some of my soldiers r very very sick... nd da oder 1s just have very special sense of humor (as in cant stop it :P) also it cud b nice 2 have some system datll prevent da repeating of da same sound twice in a row (i got da "Its very hot" or somin da like really close 2 each other)

also da arabic sounds r... interesting... but dey r in arabic :P ;) dey r put a lil 2 much in high language (arabic is complicated... dere r 1000s of difrent dialects... nd i know my areas dialect is difrent from dialects spoken in Iraq... but da language dat ppl write in... ike books nd stuff... is da same dialect... nd its used 2 much in da voices.... but hellz... no1 understands arabic nywayz ;) :D) also i cought som1 screaming "in da revenge of my sister"... interesting :P

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #6 on: 23 Oct 2007, 09:29:11 »
I'll try to add a little something that makes them not repeat the exact same phrase in the exact same voice twice, but keep in mind the original, English sound files came in a whole bunch of different voices who say the same thing. Presently I've only bothered to include two (Howard and RobertPolo), so it's still a bit monotone. Even with more voices however there's a limited amount of voices available.

Coughing/sneezing timeouts can be adjusted in the RUG_DSAI\Scripts\DSAI_GenericCheck.sqf -> it's presently a fairly random number, but yes: a longer pause would probably be good. It is, however, as I said, very easy to change.

What takes the MOST time in this system is in fact making the damned cfgSounds definitions for every single sound, and then also adding these to the various lists (although I think I found a way to read the description.ext's defined sounds using missionConfigFile. We'll see...).

But: anyone had any trouble with performance so far?  :)

And thanks LCD on the notes on Arabic. As you say...who understands Arabic anyway?  :cool2:

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline MattiusRochelle

  • Members
  • *
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #7 on: 24 Oct 2007, 22:55:31 »
Would be nice a client side addon becuase it doesnt make the missions massive and we could play it in MP.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #8 on: 25 Oct 2007, 09:52:40 »
Well, an addon made in the spirit of for instance the HULK_OggPlayer would probably be pretty good, yes, but there are some caveats:

1) I know nothing about addonmaking.  :dunno: If anyone wants to turn this into an addon, they're free to (not very complicated scripting at any rate), but I don't know how and I'm not planning on learning.

2) "Cheating" issue: if this addon for instance was used on Evolution, then those who have it installed could hear the AI shouting random things now and then, which would allow them to find them easier. Sure, it'd be more realistic (IMHO), and probably more "atmospheric". But it'd still be a bit of an unfair advantage.

3) I'm not too concerned with file sizes. These scripts are mostly meant for SP missions. Currently my downloaded addons folder is 1.49 GB, whereas my downloaded missions folder is a measly 256 MB. I understand that a multiplayer mission that has a 10mb+ filesize won't be muchly appreciated, but a SP mission that is 20mb + is something I see as a big bonus: means there're lots of custom resources, sounds and music used.  :cool2:

If someone could tell me how to access (and I mean an actual working, tested solution, not a "it could work like this" kind of thing - believe me, I've tried) the default voices in Sounds/Missions/ROBERTPOLO etc through for instance the description.ext without needing to copy them to the mission folder, then I could cut down on the default filesize with about 11MB (since that's the size of all the voices put together). However I doubt that's doable without an addon.

 :)

I've also sent a message to Zaphod over at ECP asking for use of the ECP DSAI russian/american voices. I do hope he consents.

I'll upload a new version soonish which has removed the ECP/COD4 voices and only leaving the default ones (boring, but what can you do), which will be smaller for you to test, as well as having the new functionality of "Contact!" voices for contact situations.

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Dobermann

  • Members
  • *
  • Ready to disturb you anytime
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #9 on: 29 Oct 2007, 14:23:52 »
Code: [Select]
class voice1
{
name = "voice1";
sound[] = {"\ca\voice\alan\actions\activatebomb.wss", db+1, 1.0};
titles[] =
{
0,
};
};
« Last Edit: 29 Oct 2007, 14:49:52 by Dobermann »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #10 on: 29 Oct 2007, 15:06:19 »
 :D

Dobermann: I figured there are people out there working on this same thing, but clearly no-one has bothered to release their version yet (well, with the exception of the kind that's in for instance XAM, but I've not actually tested that one myself). Otherwise I would've simply used an already existing system.  :cool2:

I'll be glad to cooperate otherwise. My system is fairly...modular...in that you can freely add/remove sounds, and if you know your way around scripting, it's not too hard to modify the scripts themselves to suit: adding and removing conditions and so forth. As mentioned, what takes the most time is compiling the cfgSounds entries (and finding suitable sounds - could really use some spanish sounding ones!). ;)

Anyway, any method of cooperation you want is fine by me. Using the animation to figure out if the unit is healing is a nice touch, although I've found the "heal" animation is used quite a lot (for instance in Evolution to simulate building a FARP/MASH). Nonetheless, if it works it's excellent! Feel free to post your scripts/PM them to me, and we can compare. Alternatively we can simply share sounds. One thing I'm particularly eager to get to work would be a hassle-free way of finding out if a unit is being shot at: default BIS AI seems to get it somehow ("Under fire!" shouts), just not sure how.   :confused:

 :) I'll be publishing a slightly revamped version soonish, which should have the option of cutting off the sounds when the player is more than X meters from the groups/units using the scripts. I'm debating using a waitUntil or a continuos "while...do" loop with a pretty big "sleep" factor. Hm hm.

Oh, and as a btw: the below code doesn't work for me either. I in fact tried it for weapons as well, but no luck.  :(

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Dobermann

  • Members
  • *
  • Ready to disturb you anytime
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #11 on: 30 Oct 2007, 10:37:40 »
« Last Edit: 30 Oct 2007, 18:13:10 by Dobermann »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #12 on: 03 Nov 2007, 18:38:11 »
oooh! I haven't got SOF2 sadly, but a full set of hispanic sounds would be massively cool. If you happen to put them someplace someone might be able to download them...  :shhh:

Anyway, mah PM box is still empty.  :)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Dobermann

  • Members
  • *
  • Ready to disturb you anytime
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta!
« Reply #13 on: 04 Nov 2007, 12:16:35 »

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Wolfrug's Dynamic Sound AI (RUG DSAI) -> beta 0.2 out now!
« Reply #14 on: 18 Nov 2007, 19:55:29 »
New version out! Pardon the crappy "version history".  :D

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"