Radio Protocol – Arma 3

From Bohemia Interactive Community
Revision as of 10:02, 13 March 2015 by Str (talk | contribs)
Jump to navigation Jump to search

Overview of the radio protocol technology.

Voice

Units' identities:

class CfgVehicles
{
	class myVehicleEN
	{
		identityTypes[] = {"myIdentityEN"};
	};
	class myVehicleCZ
	{
		identityTypes[] = {"myIdentityCZ"};
	};
};

Voices:
Note: In OFP, there were no multiple radio protocols and all definitions (Words, sentences) were placed here. This is reason for some unusual config structures and many obsolete params.

class CfgVoice
{ 	
	// List of used voices.
	voices[] = {myVoiceEN, myVoiceCZ};
	// Words player after every radio message.
	micOuts[] = {micOut1, micOut2, micOut3};
	// Sound file played as preview in profile options menu.
	// When not format is given, *.wss is used.
	preview = "EN\combat\FireInTheHoleE.ogg";
	// Default speaker
	// When not defined or incorrect, first entry of voices[] is used instead
 	default = "myVoiceEN";

	class myVoiceEN
	{
		// Protocol class.
		protocol = RadioProtocolENG;
		// Path to audio files based on 'singleVoice' param in profile (default 0 selects first entry.)
		// Second value is obsolete, was once used for limited demo which contained only one voice.
		directories[] = {
			"\ca\Dubbing_Radio_F\RADIO\myVoiceFolder\",
			"\ca\Dubbing_Radio_F\RADIO\myVoiceFolder\"
		};
		// Filter - what units can use this voice
		identityTypes[] = {"myIdentityEN"};
		// Availability for CfgVoiceTypes
		scope = 2;

		// Discontinued.
		voiceType = "";
		variants[] = {1};
	};
	class myVoiceCZ: myVoiceEN
	{
	};

	// Discontinued.
	femaleVoices[] = {};
	voicePlayer = "";
};

Profile menu:

class CfgVoiceTypes
{
	class myProfileVoice
	{
		// UI text
		name = "James G.";
		// Reference to CfgVoice
		voices[] = {myVoiceEN, myVoiceCZ};
		// Preview voice played in profile menu.
		// When not defined or incorrect, first entry of CfgVoice >> voices is used instead
		preview = "myVoiceEN";
		// Alternative CfgVoiceType class searched after this one (in case some params were wrong)
		alternative = "";
	};
	class myProfileVoice2
	{
		name = "David A.";
		voices[] = {};
		preview = "";
		alternative = "myProfileVoice";
	};
};

Protocol

  • Engine automatically calls predefined sentences
    • Any newly added sentence has to be either supported by engine or linked by other sentence.
  • Sentence can have two different sets of array params, both of them in format {class1, probability1, class2, probability2, ..., classN, probabilityN}
    • class:
      • sentences - class of other sentence.
      • variants - class of version within current sentence.
    • probability
      • Classes within array are selected randomly, taking into account probability weights. See Simple Expressions section for more info about supported expressions.
  • Sound files are combination of following values:
    • [CfgVoice >> myVoice >> directories] + [RadioProtocolENG >> Words >> myWord]
    • e.g. \ca\Dubbing_Radio_F\RADIO\myVoiceFolder\stealth\myWord1.ogg (based on examples above and below)
  • gesture contains link to action in animation config. Execution is same as using playAction command.
  • Protocol is named in format RadioProtocolISO, where ISO is ISO 639-2/B language code of the faction to which protocol belongs.
class RadioProtocolENG
{
	class Words
	{
		myWord1[] = {"myWord1.ogg"};
		myWord2[] = {"myWord2.ogg"};

		class StealthWords
		{
			myWord1[] = {"stealth\myWord1.ogg"};
			myWord2[] = {"stealth\myWord2.ogg"};
		};
	};
	class SelectMySentence
	{
		sentences[] =
		{
			"SentMySentenceA", "(1 - Stealth)",
			"SentMySentenceB", "(Stealth)"
		};
	};
	class SentMySentenceA
	{
		versions[] =
		{
			"Version1", 0.3,
			"Version2", 0.7
		};
		class Version1
		{
			text = "";
			speech[] = {myWord1, myWord2};
			gesture = "myGesture";
		};
		class Version2
		{
			text = "";
			speech[] = {myWord1};
		};
	};
	class SentMySentenceB
	{
		versions[] =
		{
			"Version1", 1,
		};
		class Version1
		{
			text = "";
			wordsClass = "StealthWords";
			speech[] = {%1, myWord2};
		};
	};
};


Words

List of words required by engine.

Background noise, defined in RadioChannels

loop

???

pause

Transmit a message to AI

xmit

Multiple targets separator

and

Numbers (used as units' call-signs)

zero
one
two
three
four
five
six
seven
eight
nine
ten
eleven
twelve
thirteen
fourteen
fifteen
sixteen
seventeen
eighteen
nineteen
twenty
thirty
forty
fifty
sixty
seventy
eighty
ninety
hundred

Addressing to a group of units

all
allGroup		
whiteTeam
redTeam
greenTeam
blueTeam
yellowTeam

Spelling (digits + phonetic alphabet)

zero2
one2
two2
three2
four2
five2
six2
seven2
eight2
nine2
ten2
eleven2
twelve2

alpha
bravo
charlie
delta
echo
foxtrot
golf
hotel
india
juliet
kilo
lima
mike
november
oscar
papa
quebec
romeo
sierra
tango
uniform
victor
whiskey
xray
yankee
zulu

Target side
Texts in "STR_WORD_<wordParam>"

unknown
enemy
friendly
neutral

Map objects for movement orders (defined in Object::GetNameSound)

obj_tree
obj_bush
obj_building
obj_house
obj_forest
obj_church
obj_cross
obj_rock

Relative direction
Texts in "STR_WORD_<wordParam>"

at10
at11
at12
at1
at2
at3
at4
at5
at6
at7
at8
at9

Distances
Texts in "STR_WORD_<wordParam>"

dist50
dist100
dist200
dist500
dist1000
dist2000
far


Vehicle Words

class CfgVehicles
{
	class myVehicle
	{
		textSingular = "My Vehicle";
		textPlural = "My Vehicles";
		speechSingular[] = {};
		speechPlural[] = {};
		// SpeechVariants is used only when root speechSingular and speechPlural params are empty.
		class SpeechVariants
		{
			class Default
			{
				speechSingular[] = {"wordMyVehicle"};
				speechPlural[] = {"wordMyVehicles"};
			};
		};
		// nameSound is still used in some cases.
		nameSound = "wordMyVehicle";
	};
};
class RadioProtocolENG
{
	class Words
	{
		wordMyVehicle[] = {"DEFAULT\path\wordMyVehicle.ogg"};
		wordMyVehicles[] = {"DEFAULT\path\wordMyVehicles.ogg"};
	};
	class Arguments
	{
		class AggrTargets
		{
			modes[] = {"Default"};
		};
	};
};

Weapon Words

Property nameSound defines what word will be used for weapons.

class CfgWeapons
{
	class myWeapon
	{
		nameSound = "wordWeapon";
	};
};

In protocol, matching word has to be defined

class RadioProtocolENG
{
	class Words
	{
		wordWeapon[] = {"DEFAULT\path\wordWeapon.ogg"};
	};
};

displayName param of the weapon is displayed in radio message.

Location Words

Map locations containing speech are evaluated and can be used in position reporting:

class CfgWords
{
	class myWorld
	{
		class Names
		{
			class myLocation
			{
				speech[] = {"wordMyLocation"};
			};
		};
	};
};
class RadioProtocolENG
{
	class Words
	{
		wordMyLocation[] = {"DEFAULT\path\wordMyLocation.ogg"};
	};
};

Such locations can be detected by DistanceToLocation expression (see below) and nearestLocationWithDubbing scripting command.


Arguments

  • Direction
    • %v (%8)
    • %v.n (%8.2)
    • %v.m0n (%8.102)
      • v - variable
      • m - mode
        • 0 - class Relative (default)
        • 1 - class Compass
        • 2 - Procedural "o'clock" system (e.g., "2 O'CLOCK")
      • n - Arguments ID (default is 1)
  • Distance
    • %v (%7)
    • %v.n (%7.2)
    • %v.m0n (%7.101)
      • v - variable
      • m - mode
        • 0 - class Distance (default)
        • >0 - Procedural metres system (e.g., "100 m").
      • n - Arguments ID (default is 1)
class RadioProtocolENG
{
	class Arguments
	{
		// Class names corresponds to azimuth (in degrees).
		class Direction
		{
			class Compass1
			{
				class 0		{text = $STR_Q_NORTH; speech[] = {North};};
				class 45	{text = $STR_Q_NORTH_EAST; speech[] = {NorthEast};};
				class 90	{text = $STR_Q_EAST; speech[] = {East};};
				class 135	{text = $STR_Q_SOUTH_EAST; speech[] = {SouthEast};};
				class 180	{text = $STR_Q_SOUTH; speech[] = {South};};
				class 225	{text = $STR_Q_SOUTH_WEST; speech[] = {SouthWest};};
				class 270	{text = $STR_Q_WEST; speech[] = {West};};
				class 315	{text = $STR_Q_NORTH_WEST; speech[] = {NorthWest};};
			};
			class Relative1
			{
				class 0		{text = "in front of"; speach[] = {InFrontOf};};
				class 90	{text = "right of"; speach[] = {RightOf};};
				class 180	{text = "behind"; speach[] = {Behind};};
				class 270	{text = "left of"; speach[] = {LeftOf};};
			};
		};
		// Class names corresponds to three possible levels of distance (group territory, effective fight distance, far)
		class Distance1
		{
			class Level0	{text = $STR_DISTANCE_DANGER_CLOSE_TO; speech[] = {DangerCloseTo};};
			class Level1	{text = $STR_DISTANCE_NOT_FAR_FROM; speech[] = {NotFarFrom};};
			class Level2	{text = $STR_DISTANCE_FAR_FROM; speech[] = {FarFrom};};
		};
		class AggrTargets
		{	
			modes[] = {"Default"};
		};
	};
};


Simple Expressions

Full article about operations - Simple Expression

Rank 0 when sender is Private, 1 when he is Colonel (see rank).
Captive 1 when sender is captive of unconscious.
Safe 1 when sender is in safe mode.
Combat 1 when sender is in combat mode.
Stealth 1 when sender is in stealth mode.
Morale sender's morale interpolated from interval <-1, 1> to <0, 1>.
Danger perceived danger (ToDo: Find out more, located in AIBrain::GetSEDanger).
UnderWater 1 when sender is underwater and has no re-breather.
GroupCompactness 1 if 80% of the group is in formation, 0 otherwise.
DistanceToUnit distance [m] from ordered unit to its issued destination (SelectCmdMoveSentence) or to aggrTargetList (SelectEnemyDetectedSentence).
DistanceToSender distance [m] between sender and aggrTargetList (SelectEnemyDetectedSentence). Always 1 in SelectCmdMoveSentence.
DistanceToGroup distance [m] from group center to issued destination (SelectCmdMoveSentence) or to aggrTargetList (SelectEnemyDetectedSentence).
DistanceToLocation distance [m] from nearest location with speech param defined to issued destination (SelectCmdMoveSentence) or to aggrTargetList (SelectEnemyDetectedSentence).
GroupCoreRadius distance [m] between the group formation center and the most distant member of the group.
UnitDistanceFactor distance of the closest unit from the aggrTargetList divided by the distance of the second one. Only for SelectEnemyDetectedSentence.
InsideLocation 1 when inside location with speech param defined. "Inside" is based on size defined by radiusA, radiusB and angle params of the location.
MoveToObject 1 if the movement target has an Object nearby. In that case parameter %8 of the movement order returns a valid value. Only in SelectCmdMoveSentence.
DistanceToRecipients distance [m] from group center to message recipient. Only in SelectCmdMoveSentence.
RecipientsRadius returns always 1 for single selected unit's movement orders and for several units, theoretically returns the radius of the circle containing most of the recipients in the formation of the affected units. Only in SelectCmdMoveSentence.
FireBurst number of artillery rounds fired by artillery.


Channels

See also radioChannelCreate

class RadioChannels
{
	class GroupChannel
	{
		// Priority
		level = 1;
		// Word class of background noise
		noise = "loop";
		// Link to CfgVoice param with sounds played after every sentence
		micOuts = "micOuts";

		// Pause after every word in sentence's speech param
		pauseAfterWord = 0;
		// Pause between numbers (e.g., when spelling a grid position)
		pauseInNumber = 0;
		// Pause after direction numbers (e.g., "1 O'CLOCK,_ENEMY SOLDIER")
		pauseAfterNumber = 0;
		// Pause between numbers of selected members (e.g., "2,_3,_4, RETURN TO FORMATION"))
		pauseInUnitList = 0;
		// Pause after numbers of selected members(e.g., "2, 3, 4,_RETURN TO FORMATION")
		pauseAfterUnitList = 0.05;
	};
	class GlobalChannel {};
	class SideChannel {};
	class CommandChannel {};
	class GroupChannel {};
	class VehicleChannel {};
	class DirectSpeakingChannel {};
};

User Interface

  • RscChatListMission - in mission
  • RscChatListMap - in-game map
  • RscChatListBriefing - in-game map before mission starts

Supported params:

Standard UI params Chat list specific params Obsolete params
x, y, w, h colorGlobalChannel colorPlayerBackground
font colorSideChannel iconPlayerMessage
size colorCommandChannel iconNormalMessage
rows colorGroupChannel
shadow colorVehicleChannel
shadowColor colorDirectChannel
shadowColor colorSystemChannel
colorBackground
  • RscDisplayChannel - notification about a current channel
  • RscDisplayVoiceChat - notification about VOIP being active
  • RscDisplayChat - text entry of MP chat


Key Actions

Class Label
prevChannel Previous channel
nextChannel Next channel
chat Chat
pushToTalk Push to Talk
voiceOverNet Voice Over Net
PushToTalkAll Talk on Global channel
PushToTalkSide Talk on Side channel
PushToTalkCommand Talk on Command channel
PushToTalkGroup Talk on Group channel
PushToTalkVehicle Talk on Vehicle channel
PushToTalkDirect Talk on Direct channel


Options

Following settings have effect on how sentences are played and/or displayed.

Param name Menu Name Name space Description
language Game Options Language Arma3.cfg Selects what language will be used in text (does not affect voice).
showRadio Game Options Radio subtitles *.Arma3Profile When disabled, radio subtitles are not shown (but sound is still played).
volumeSpeech Audio Options Speech volume *.Arma3Profile Selects volume level of all sentences (including direct channel).
clockIndicator Difficulty Clock indicator *.Arma3Profile When enabled, visual clock indicator is shown when enemy in direction from group's center is reported.
autoSpot Difficulty Auto report *.Arma3Profile When enabled, player's avatar automatically reports same events as AI team-mates (e.g., reporting enemy, announcing casualties, etc.)