Jump to content

Sound replacement possible?


TRekNexus

Recommended Posts

I just did a similar exercise by going through xcomgame.upk and noting every the parameter of every UnitSpeak call. There are 58 total.

 

The following are not called ingame but do indeed have voices (tested with MakeCharacterSpeak xx console command):

1 / HunkerDown

53 / AlienMoving

55 / AlienReinforcements

56 / AlienSighting

 

This is is called ingame, but no VO is present, so the soldier remains silent.

22 / FlashbangThrown

 

The rest overlap, so by my count that's 57 sounds we'd need from voice actors.

Link to comment
Share on other sites

  • Replies 199
  • Created
  • Last Reply

Top Posters In This Topic

Great, thanks! And that answers Liquid's question as well, these unused sounds could indeed be re-used for other purposes because they do exist in the voice packs. Since FlashBangThrown doesn't exist, you've also proved that partial banks are supported and should work.

 

In other news, it looks like the native GetPossibleVoices() has special logic for male soldiers where it will return shorter arrays of available voices than the 6 voices that all the built-in languages have if a custom language has fewer than 6 voices in it. This is great, because the new language just works in the customization UI without any changes. Unfortunately this isn't the case for females, where it always returns 6 elements. I suspect this is because the ECharacterVoice enum actually has 9 entries for male voices, but only 6 are used. There is no english voice #2, for example, it's actually #3. GetPossibleVoices seems to "pack" the available voices into whatever sized array is appropriate, but only for males. I tested this by removing one of the female voices and it still allows 6 choices in the customize UI, but the one you remove just doesn't play any sounds.

 

This means that if we implement the accented voices as new languages instead of new voices in the english language, a few of the scripts will need modding to get the array size right. I think it's only really two places that care: the customization UI and GetNextFemaleVoice(). If we instead make them new voices in the existing english language, that will require extending the ECharacterVoice enumeration to add new entries, as all 6 female voices are already used. I don't know what other side-effects this will have, as it may prevent GetPossibleVoices from working correctly with values outside the eCharVoice_Male_BEGIN/Male_END and Female_BEGIN/Female_END ranges.

Link to comment
Share on other sites

Cool. I don't have a preference on whether more languages or more voices in existing sets is better -- Technical feasibility comes first, of course.

 

Probably the next step is to use MakeCharacterSpeak to research which of the 57 have multiple entries so we can get a picture of the full submission we would need from the voice actors.

 

Also, can you PM me your email addy? I'll get you on a google drive where we'll take those submissions.

Edited by johnnylump
Link to comment
Share on other sites

I went through the voice banks for male soldier english #1 and pulled out the number of unique sound node names listed throughout all the banks. The only really interesting things that I found were that the "run" and "dash" events actually have two sounds in most banks, for a total of 26 and 27 unique sounds for those two events, respectively. All other events have exactly 1 sound per bank, but most start to periodically recycle sounds from previous banks. For example, there are only 3 distinct StabilizingAlly sounds for this voice, and they repeat throughout the 15 banks.

 

The distributions aren't exactly the same across the other voices, but they're fairly close. There are gaps in the numbering scheme on the sounds for some of them, which could be just clips they recorded from the voice actors but omitted for whatever reason.

 

Here's the raw data for the first voice. Some of these seem really over-represented (really, 13 combat stim voices?), but I think the main takeaway is have lots of move/dash options, and the rest look to average somewhere around 10 except for the really rare events.

 

 

 

Voice # unique nodes
Reload 15
Overwatching 11
Moving 26
Dashing 27
JetPackMove 9
LowAmmo 11
OutOfAmmo 15
Suppressing 15
AreaSuppressing 10
FlushingTarget 15
HealingAlly 6
StabilizingAlly 3
RevivingAlly 6
CombatStim 13
FragOut 10
SmokeGrenadeThrown 7
SpyGrenadeThrown 15
FiringRocket 13
GhostModeActivated 8
JetPackDeactivated 11
ArcThrower 8
RepairSHIV 7
Kill 15
MultiKill 15
Missed 14
TargetSpotted 15
TargetSpottedHidden 9
HeardSomething 15
TakingFire 11
FriendlyKilled 6
Panic 6
PanickedBreathing 2
Wounded 15
Died 4
Flanked 15
Suppressed 11
PsiControlled 15
CivilianRescued 15
MeldSpotted 3
MeldCollected 4
RunAndGun 7
GrapplingHook 5
AlienRetreat 4
AlienNotStunned 7
DisablingShot 13
ShredderRocket 5
PsionicsMindfray 4
PsionicsPanic 3
PsionicsInspiration 2
PsionicsTelekineticField 7
SoldierControlled 9
StunnedAlien 7
Explosion 4
RocketScatter 5
PsiRift 2
Poisoned 5
Strangled 1

 

 

Edited by tracktwo
Link to comment
Share on other sites

Yeah, its a lot. Again I don't think its critical to have exactly as much diversity as the stock ones, especially for the less used events, but it would also get quite repetative if the common events don't have enough variants.

 

All I really need for a proof of concept is a small number of sample sounds, preferably for easy to trigger events. Move, dash, reload, overwatch would be a great start. Having more than one sound for at least one of the events, e.g. 2 or more move sounds, would be ideal so I can test the bank system/random cues.

Link to comment
Share on other sites

I think I know how they work, yes, but I haven't experimented with creating random sound cues yet. The character customization sounds that play as a sample when you choose the voice in the customize screen also use random nodes to choose a random sound from a small set, and I'd like to do the same with the new ones.

 

I suspect the added extra move/dash sounds are no accident. They are the only ones that have more than 15 entries, so testing might have showed them as too repetitive without additional options. But, that's just my guess. It could be that 15 are plenty, especially if you get lots of submissions from different people so the sheer diversity in voices makes up for smaller sets within a single voice.

Link to comment
Share on other sites

 

 

amineri: Yes, it looks to be the case that the voices are mapped per language by the executable algorithmically, but I discovered last weekend that this is just setting the defaults and they can be overridden with VoicePackageInfo lines in the defaultcontent.ini file. The existing entries for VoicePackageInfo just set the voice enum value, but the structure itself also has fields for language and whether or not the voice is for a mec. My first experiment simply added VoicePackageInfo lines for english, but set the voice archetype to voices for other languages. In game, all my "english" soldiers were speaking french, german, and italian.

 

Next, I created a new language enum value and added VoicePackageInfo lines for this new language. I used two voice archetypes for each gender: Zhang/Annette and the blueshirts. This also works, and is selectable through the UI with a localizable language string, but it did have a couple of quirks I'm still researching. First, for the male voices it correctly determined there were only two voices and clicking the spinner arrows would cycle only between voice 1 and 2 in that language. For females, it cycles through all 6. The UI figures out how many voices there are by looking at the possible voices array, originally returned by GetPossibleVoices, so it looks like its behaving differently for the two genders. The second problem is there is no sample sound playing when you select the voice in the UI for the dlc/blueshirt voices. I think I know why this is but need to work a bit more on it.

 

I've verified that this is the case :

1) Languages can be expanded, and voices assigned to new languages via additions in DefaultContent.ini

 

2) The customization spinner for male voices correctly scales from 0 to 9, but the female spinner is always presented as having 6 options -- this is probably a bug in native code

 

3) I was able to swap voices between languages/genders when those voices were from the Voices subfolder with no problem

 

4) Annette, Zhang, and the 2 Blueshirt voices would not preview in the Strategy layer customization UI unless I explicitly added those packages to be loaded with Map=Command1. It's unclear what would happen with brand new voice packages.

 

-----------------------

 

Some details. Expanding the language spinner is done in XGCustomizeLanguageUI.AdvanceLanguage :

//MaxChoice = 7 - 1

The number of languages is hardcoded here to 7. I increased this to 9 - 1 which added two more slots to the spinner.

 

The above change wll break the spinner unless the additional language names are defined in the XComStrategyGame.int (or other localization) :

vanilla :

; SOLDIER CUSTOMIZE
[UISoldierCustomize]
m_strCustomizeFirstName="SET FIRST NAME"
m_strCustomizeLastName="SET LAST NAME"
m_strCustomizeNickName="SET NICKNAME"
m_arrLanguages[0]="English"
m_arrLanguages[1]="French"
m_arrLanguages[2]="German"
m_arrLanguages[3]="Italian"
m_arrLanguages[4]="Polish"
m_arrLanguages[5]="Russian"
m_arrLanguages[6]="Spanish"

nicely, this array is a dynamic array, so no resizing of the array in hex is needed. For testing purposes I added the following two lines :

m_arrLanguages[7]="Japanese"
m_arrLanguages[8]="Chinese"

at which point the spinner functions properly. However with no further configuration the number of configurable voices for these languages is zero.

 

To add configurable languages for language 7, I added the following lines to DefaultContent.ini :

VoicePackageInfo=(VoiceType=eCharVoice_MaleSoldier1, Language=7, isMec=false, ArchetypeName="Voice_BSMVoice1.BSMVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_MaleSoldier2, Language=7, isMec=false, ArchetypeName="Voice_BSFVoice1.BSFVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_MaleSoldier3, Language=7, isMec=false, ArchetypeName="Voice_ZhangVoice1.ZhangVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_MaleSoldier4, Language=7, isMec=false, ArchetypeName="Voice_AnnetteVoice1.AnnetteVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_MaleSoldier5, Language=7, isMec=false, ArchetypeName="Voice_BSMVoice1.BSMVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_MaleSoldier6, Language=7, isMec=false, ArchetypeName="Voice_BSFVoice1.BSFVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_MaleSoldier7, Language=7, isMec=false, ArchetypeName="Voice_ZhangVoice1.ZhangVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_MaleSoldier8, Language=7, isMec=false, ArchetypeName="Voice_AnnetteVoice1.AnnetteVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_MaleSoldier9, Language=7, isMec=false, ArchetypeName="Voice_ZhangVoice1.ZhangVoice1")

VoicePackageInfo=(VoiceType=eCharVoice_FemaleSoldier1, Language=7, isMec=false, ArchetypeName="Voice_BSMVoice1.BSMVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_FemaleSoldier2, Language=7, isMec=false, ArchetypeName="Voice_BSFVoice1.BSFVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_FemaleSoldier3, Language=7, isMec=false, ArchetypeName="Voice_ZhangVoice1.ZhangVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_FemaleSoldier4, Language=7, isMec=false, ArchetypeName="Voice_AnnetteVoice1.AnnetteVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_FemaleSoldier5, Language=7, isMec=false, ArchetypeName="Voice_BSMVoice1.BSMVoice1")
VoicePackageInfo=(VoiceType=eCharVoice_FemaleSoldier6, Language=7, isMec=false, ArchetypeName="Voice_BSFVoice1.BSFVoice1")

For testing purposes I used duplicates of the 2 blueshirt voicepackages and the Annette and Zhang voice packages.

 

As noted in tracktwo's post, the male spinner adjusts correct as the number of configured voices changes, from 0 to 9. However the female spinner always has 6 options, regardless of the number of voices configured. Note that the enum and the return result from GetPossibleVoices limits to 9 male voices in the spinner (eCharVoice_MaleSoldier9 is the highest enum value) and 6 female voices in the spinner (eCharVoice_FemaleSoldier6 is the highest enum value). Note that additional custom voices can be mapped into other voice enum values, such as eCharVoice_MaleSoldier1_Brash to eCharVoice_MaleSoldier9_Brash. Note that MEC voices are handled separately, and there are only 2 MEC enums for each gender. To add more MEC voices it may be preferable to treat them as a new "language" with isMec=false, which would allow up to 9 and 6 voices to be defined, although auto-selected those languages for MECs would take a bit more hex editing.

 

Also as noted in tracktwo's post, the Annette, Zhang, and two blueshirt voicepacks did not load properly in the strategy layer, and so would not play a sound preview clip in the customize UI. I was able to circumvent this by manually specifying those four voice packages to be loaded with Map=Command1 in DefaultContent.ini :

Map=Command1
Package=StrategyResources
Package=UICollection_Strategy
Package=LongWar
Package=Voice_BSMVoice1
Package=Voice_BSFVoice1
Package=Voice_ZhangVoice1
Package=Voice_AnnetteVoice1

The voice packages should be getting dynamically loaded (and the existing voice packs in the Voices subfolder appear to be getting so loaded), but for some reason these are not. It's unclear whether brand-new UDK-cooked voice packages would dynamically load properly or not. Having to statically load all voice packages would start to bloat memory requirements.

 

With the above changes, I was able to make multiple copies of the above 4 voices customizable as an 8th language option (which for test purpose I named "Japanese"), and everything worked properly.

 

Wghost and I are continuing to work on dynamically loading these 4 voice packages, and will post up any results.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...