Skip to main content

Bark banks — .bank, .pfe and bark .spk

Verified via reverse engineering and against the retail files

Traced via GhidraMCP in the symbolized FarCry2_server, which carries the same bark code as Dunia.dll under readable names (CFCXBarkManagerService, CBarkResourceContainer); addresses are that binary's. Counts are over the retail files: 862 .bank, 860 .pfe, 860 bark .spk and the 863-entry bank list.

NPC speech — generic mercenary chatter, buddy lines, mission dialogue — plays from bark banks. A bank is three files sharing one decimal number N:

FileArchiveHolds
scripts\game\BarkData\<N>.bankworlds.datthe bark table, an FCB
scripts\game\BarkData\<N>.pfeworlds.datfacial animation, one entry per line
scripts\game\BarkData\loc\<N>.spkworlds_english.datthe recorded lines, an ordinary sound bank

Only the .spk is localized. These are the only .spk files in the game not named by a hex sound id. scripts\game\BarkData\SPBarkData.banklist, in common.dat, is an FCB listing every bank number as a Bark object with one Bank value. jackall-cli fcb decode reads the .bank and the .banklist as they are.

The bank number​

N packs four fields (CFCXBarkManagerService::GetBankIndex; GetBankInfoFromIndex is its inverse):

N = type × 42900 + character × 825 + mission × 5 + variant
FieldRangeEngine enum
type0–44EBarkBankType — see bank types
character0–51ESpecialCharacterType — see characters
mission0–164EMission — see missions
variant0–4— see variants

Every retail bank number decodes to in-range fields. 1436645 is type 33, character 25 (Nasreen_Davar), mission 64 (A2LM08_SE02), variant 0.

Bank types​

Types come in threes. A base type t is loaded together with t+1 while the player's infamy is low or t+2 while it is high. CFCXCountersComponentPlayerSP::IsInHighInfamy calls infamy high from the midpoint of the current act's infamy range up. Retail ships the infamy pair for only some groups.

TypesRetail banksLoaded forSpeakersExample event tags
0 / 1 / 23 / 3 / 3mental state 0–1GAPEIN, ENO, ENM, DL1
3 / 4 / 51 / 0 / 0alwaysGAADTH, PI2, ST1, BN1
6 / 7 / 816 / 0 / 0buddiesbuddiesBDP, BDD, BDX, BDH
9 / 10 / 1136 / 0 / 0buddiesbuddiesBRN, BW1–BW8
12 / 13 / 1412 / 0 / 0buddiesbuddiesBWH, BWW, BWS, PH01
15 / 16 / 175 / 5 / 5mental state 0–1GAP, GAK, GAZDGI, DFE, DMB, DTS
18 / 19 / 203 / 3 / 3alwaysGMD, GAPAWE, AKR, HFX, HFA
21 / 22 / 232 / 2 / 2alwaysGMD, GAPAKR, ADF, PCL4, WAL4
24 / 25 / 263 / 3 / 3mental state 2–4GAPEIN, ENO, DCD1
27 / 28 / 291 / 1 / 1always, external loadingGAACVSUBV, CVTASK, CVBIOM
30 / 31 / 322 / 2 / 2mental state 2–4GAPPBL2, PCL3, DEL3
33 / 34 / 35589 / 35 / 41every speaker, per missionmission characters, buddiesGREET, DIALA, EXITA, BECKN
36 / 37 / 383 / 0 / 0mental state 2–4GAA, GABILG
39 / 40 / 4136 / 0 / 0buddiesbuddiesBCTR, BCTD, BCQE, BCGW
42 / 43 / 4436 / 0 / 0buddiesbuddiesBFW

Type 33 is the bulk: dialogue for one character in one mission.

When a bank is loaded​

UpdateBarkBankLoading (0x087b6660) rebuilds the set of resident banks on every update:

  1. Always: types 3, 18, 21 and 27, each with its infamy pair, as character 0, mission 0.
  2. Per registered speaker with character c: type 33, plus 6, 9, 12, 39 and 42 when c is a buddy (18–29), plus the mental-state types for that speaker's own state, each with its infamy pair. Each type loads once per active mission and, when c is not 0, once for mission 0.
  3. Crowd chatter: one mental state stands for all nearby mercenaries: the first of 0, 1 or 2 that at least two mercs within range share, otherwise the nearest merc's. Its types load as character 0, mission 0. With no speaker registered the state is 4.

The mental-state types (AddMentalStateBaseBanks) are 0 and 15 for states 0–1, and 24, 30 and 36 for states 2–4. CPawnAgent::GetBarkMentalState (0x08574b80) derives the state from the agent's army-member state; 6 means dead, and states 5 and 6 never become the crowd state.

A mission becomes active through the Lua call LoadMissionBarkBank(tag) (see Lua API surface). GetMissionFromTag turns the tag into its EMission number from the table below.

Variants​

The variant is an alternative recording set of the same bank. Per-speaker banks always load variant 0. The always-loaded and crowd banks load their type's current variant, and UpdateVariationBanks (0x087b6240) rotates it: once the type's duration (GetVariationBankDuration) runs out, the variant moves to the next number if that bank exists (inferred: the manager's bank list, read from SPBarkData.banklist), otherwise back to 0, and the bank's played flags are reset. Retail ships 1, 2, 3 or 5 variants of each always-loaded and mental-state type.

.bank — the bark table​

An FCB whose root holds Bark objects. Tags are hashes; each has a text_ twin carrying the readable tag.

Bark
BarkEventTag, SourceActorTag, TargetActorTag
IsGeneric
EnvironmentStates, SourceActorStates, TargetActorStates
State { StateTag, StateValueTag }
BarkVersions
{ HasPlayed, BarkLines }
Line { SpeakerName, LookAt, GestureTarget, FacialEmotion, Gesture,
VariationBank, ApplyLipSync, BarkSoundIDs [ SoundID ] }

What the 5,141 retail barks contain:

  • Speakers. SourceActorTag and SpeakerName are three-letter codes, one per character. The target is mostly the player, PLY.
  • Conditions. A MIS state tests a mission tag. The most common other tags are TK, AIS and TL on the speaker and IL and STR on the target. All 15 environment tags carry the value NA.
  • Performance. FacialEmotion names an expression (relaxed, mefiant, happy, …) and Gesture an animation (bodywhawha_gestlayer_a0_intlow, pawn_gesture_wave2, …).
  • Lines. A bark has 1–7 versions (88% have one), and a version 1–12 lines. BarkSoundIDs hold 13,281 ids across the banks. Apart from 102 -1 placeholders, which the loader skips, every one is a sound event in the same-numbered .spk.

How the manager picks a version, and what several SoundIDs on one line are for, is not traced.

.spk — the recorded lines​

The container is the ordinary .spk: sound events, the resources they play and the audio. CBarkResourceContainer::SetBankIndex (0x09193140) loads the whole file as a CSoundResource, so every line registers when the bank does. jackall-cli spk list reads them unchanged. A line used by several banks is stored in each: 729 sound ids appear in more than one bark .spk.

External loading: types 27–29​

For types 27, 28 and 29, GetBarkResource (0x087b2c20) puts the bank in external loading mode. SetBankIndex then loads neither .spk nor .pfe, which is why banks 1158300, 1201200 and 1244100 ship neither. LoadBarkResource (0x09191570) adds each line's SoundID one at a time instead (CSoundResource::AddFromSoundId, CFaceAnimResource::AddFaceAnim) (inferred: its flag argument is the external mode). Of their 1,225 SoundIDs, 946 exist only in hash-named soundbinary banks, 277 are inside other bark .spk files, and 2 are in no retail file.

.pfe — facial animation​

SetBankIndex loads it as a CFaceAnimResource. It starts with 01 00 65 46, then a u32 count and that many u32 keys. The count equals the number of sound events in the same-numbered .spk in all 860 pairs. The keys are not the SoundIDs, and the data after the key table is not decoded.

Missing from extractions: 1436645.bank​

The bank list names 1436645, and its .spk and .pfe ship, but its .bank path has the CRC32 4A724578, the same as levels\ige_map\generated\sdat\sd10_shadow.xbt (the collision). One hash is one archive entry, and the worlds.dat entry holds the bank: it starts with FCB magic nbCF, not TBX. An extractor that names files from a list that includes the texture path writes the bank out as sd10_shadow.xbt.

Characters​

The name is what GetSpecialCharacterName returns. The speaker tag is what the retail banks use for that character.

#ESpecialCharacterTypeSpeaker tagBanks
0Nonegeneric: GAP, GAA, GAK, GAZ, GAB, GMD, GAW–GAY61
1Player——
2UFLL_Joaquin_CarbonellRL210
3UFLL_Leon_GakumbaRC15
4APR_Nick_GreavesBL35
5JackalJKL1
6UFLL_Anto_KankarasRL110
7APR_Prosper_KouassiBC15
8UFLL_Addi_MbantuweRW12
9APR_Walton_PurefoyBL210
10APR_Arturo_QuiepoBL110
11Reuben_OluwagembiJRN7
12APR_Oliver_TambossaBW12
13UFLL_Hector_VoorheesRL35
14PrisonGuard1MPG11
15PrisonGuard2——
16PrisonPhysician——
17DJLordHawHawMDJ3
18Andre_HyppoliteBAH49
19Flora_GuillenBFG48
20Frank_BildersBFB52
21Hakim_EchebbiBHE49
22Josip_IdromenoBJI51
23Marty_AlencarBMA82
24Michele_DachssBMD48
25Nasreen_DavarBND48
26Paul_FerencBPF48
27Quarbani_SinghBQS48
28Warren_ClydeBWC50
29Xianyong_BaiBXB50
30World1_ArmsMerchantAM14
31World2_ArmsMerchantAM24
32GRIN_OperativeAGOA12
33GRIN_RefugeeAGRA2
34GRIN_Doctor_ObuaGL24
35GRIN_Father_MaliyaGL15
36APR_CourierMAC3
37Chief_PoliceMCP3
38Chief_BrotherMCB3
39UFLL_PoliticianMUP3
40GuardGRD25
41RadioVoice——
42APR_InformantMAI3
43King_NnyereMKN1
44Prince_OeduardMPO3
45Propaganda_MinisterMPM3
46Seth_UnyiaMSU6
47YabekMYK3
48GRIN_OperativeBGOB12
49GRIN_RefugeeBGRB2
50Arms_Bazaar_Tout——
51Border_Patrol_CommandantBPC1

Missions​

The tag-to-number map GetMissionFromTag builds. Mission 0 is no mission.

All 165 mission numbers
#Tag#Tag#Tag#Tag
0none42A2BSQA_SE0184A2SM08_SE03B126WAG_BJI_LOS
1A1BSQA_SE0143A2BSQA_SE0285A2SM09_SE02A127WAG_BJI_ABN
2A1BSQA_SE0244A2BSQB_SE0186A2SM09_SE02B128WAG_BMA_SRV
3A1BSQB_SE0145A2BSQB_SE0287A2SM09_SE05A129WAG_BMA_LOS
4A1BSQB_SE0246A2BU06_SE0288A2SM09_SE05B130WAG_BMA_ABN
5A1BU0X_SE0347A2BU07_SE0289A3SM10_SE03131WAG_BMD_SRV
6A1BU01_SE0448A2CV05_SE0190A3SM11_SE02A132WAG_BMD_LOS
7A1BU02_SE0449A2CV06_SE0191A3SM11_SE02B133WAG_BMD_ABN
8A1BU03_SE0450A2CV07_SE0192A3SM13_SE01134WAG_BPF_SRV
9A1BU04_SE0451A2CV08_SE0193A3SM14_SE01135WAG_BPF_LOS
10A1CV01_SE0152A2GM02_SE01B94A3SM15_SE01136WAG_BPF_ABN
11A1CV02_SE0153A2GM03_SE0195A3SM15_SE02A137WAG_BQS_SRV
12A1CV03_SE0154A2GM04_SE01A96A3SM15_SE02B138WAG_BQS_LOS
13A1CV04_SE0155A2GM04_SE01B97A3SMXX_SE01H139WAG_BQS_ABN
14A1GM00_SE01A56A2GM04_SE0298A3SMXX_SE01M140WAG_BWC_SRV
15A1GM00_SE01B57A2GM04_SE0399A3SMXX_SE02141WAG_BWC_LOS
16A1GM00_SE0258A2GM04_SE04100A3SMXX_SE03142WAG_BWC_ABN
17A1GM01_SE0159A2JT03_SE01101A3SMYY_SE01H143WAG_SLF_SRV
18A1GM02_SE01A60A2JT04_SE01102A3SMYY_SE01M144WAG_BAH_SRV
19A1GM02_SE0261A2LM07_SE02103A3SMYY_SE02145WAG_BAH_LOS
20A1GM02_SE0362A2LM07_SE03104A3SMYY_SE03146WAG_BAH_ABN
21A1JT01_SE0163A2LM07_SE04105ABW1147WAG_BFB_SRV
22A1JT02_SE0164A2LM08_SE02106ABW2148WAG_BFB_LOS
23A1LM01_SE0265A2LM09_SE02107BU0X_SE02149WAG_BFB_ABN
24A1LM01_SE0366A2LM09_SE05108BU0Y_SE02150WAG_BHE_SRV
25A1LM01_SE0467A2LM10_SE02109HQMR151WAG_BHE_LOS
26A1LM02_SE0268A2LM10_SE04110HQWS152WAG_BHE_ABN
27A1LM02_SE0369A2LM11_SE02111A1BU0X_SE01153WAG_BND_SRV
28A1LM03_SE0270A2LM11_SE03112A2BU05_SE01154WAG_BND_LOS
29A1LM04_SE0271A2LM11_SE05113A3SM12_SE01155WAG_BND_ABN
30A1LM04_SE0372A2LM12_SE02114A3SM13_SE03156WAG_BXB_SRV
31A1LM05_SE0273A2LM12_SE03115A3SMAA_SE02A157WAG_BXB_LOS
32A1LM05_SE0374A2LM12_SE05116A3SMAA_SE02B158WAG_BXB_ABN
33A1LM06_SE0275A2LMXX_SE01117A3SMUU_SE02C159A1GM02_SE01
34A1LM06_SE0376A2LMYY_SE01118A3SMUU_SE02D160A2GM04_SE01
35A1LM06_SE0477A2SM05_SE02119UDLM00_SE02161A1CV00_SE01
36A1LMXX_SE0178A2SM06_SE02120A3SM11_PH01162A3SM16_SURV
37A1LMYY_SE0179A2SM06_SE03121A1BU0X_PH01163A1GMXX_SE01
38A1SM02_SE0280A2SM07_SE01122WAG_BFG_SRV164A2GMXX_SE01
39A1SM03_SE0181A2SM08_SE02A123WAG_BFG_LOS
40A1SM03_SE02A82A2SM08_SE02B124WAG_BFG_ABN
41A1SM03_SE02B83A2SM08_SE03A125WAG_BJI_SRV

Unknowns​

  • The .pfe layout past the key table, and how a key maps to a line.
  • How a bark picks one of its versions, and what several SoundIDs on one line are for.
  • What a line's VariationBank selects. It equals its bank's variant in 8,459 of 9,303 lines; the rest are 0 inside a variant 1–4 bank.
  • Buddy banks (types 6, 9, 39, 42) and types 34/35 ship variants 1–2, but the loading traced above only ever asks a per-speaker bank for variant 0.
  • What the event tags stand for.